title: Running multiple flask application on apache server
body: <p>I have multiple flask application in <code>var/www/html</code> like <code>var/www/html/website</code>, <code>var/www/html/summary</code>,<code>var/www/html/sentiment</code></p>
  
  <p>Once I run all application successfully. </p>
  
  <p>Then I added one more application for which I created conf file and restarted server. </p>
  
  <p>After that all application stopped working, only <code>var/www/html/sentiment</code> opens.</p>
  
  <p>I checked code in python, wsgi and conf file for other application is same as it is in sentiment. </p>
  
  <p>Sentiment application code</p>
  
  <p>flaskapp.py</p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  @app.route('/sentiment')
  def hello_world():
    return 'Hello from Sentiment!'
  
  if __name__ == '__main__':
    app.run()
  
  
  </code></pre>
  
  <p>flaskapp.wsgi</p>
  
  <pre><code>import sys
  sys.path.insert(0, '/var/www/html/sentiment/')
  
  from flaskapp import app as application
  </code></pre>
  
  <p>conf file - /etc/apache2/sites-available/sentiment.conf </p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
                  ServerName IP
                  ServerAdmin admin@mywebsite.com
                  WSGIScriptAlias / /var/www/html/sentiment/flaskapp.wsgi
                  &lt;Directory /var/www/html/sentiment/&gt;
                          Order allow,deny
                          Allow from all
                  &lt;/Directory&gt;
                  ErrorLog ${APACHE_LOG_DIR}/error.log
                  LogLevel warn
                  CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  
  </code></pre>
  
  <p>Summary application code
  flaskapp.y</p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  @app.route('/summary')
  def hello_world():
    return 'Hello from Summary!'
  
  if __name__ == '__main__':
    app.run()
  </code></pre>
  
  <p>flaskapp.wsgi</p>
  
  <pre><code>import sys
  sys.path.insert(0, '/var/www/html/summary/')
  
  from flaskapp import app as application
  </code></pre>
  
  <p>/etc/apache2/sites-available/summary.conf</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
                  ServerName IP
                  ServerAdmin admin@mywebsite.com
                  WSGIScriptAlias / /var/www/html/summary/flaskapp.wsgi
                  &lt;Directory /var/www/html/summary/&gt;
                          Order allow,deny
                          Allow from all
                  &lt;/Directory&gt;
                  ErrorLog ${APACHE_LOG_DIR}/error.log
                  LogLevel warn
                  CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Still when I open ip/sentiment it works but ip/summary gives</p>
  
  <p><code>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</code></p>
  
  <p>Any suggestion for this?</p>