title: Error on deploying Django app using WSGI on Apache2 server
body: <p>I am trying to setup the Django app on Apache2 server with Ubuntu.
  I used the following tutorials to do the essentials.<br>
  <a href="https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04</a></p>
  
  <p>I also used the following solution but it did not work for me.<br>
  <a href="https://stackoverflow.com/questions/3534678/django-wsgi-and-wordpress-coexisting-in-apache-virtualhost">Django (wsgi) and Wordpress coexisting in Apache virtualhost</a></p>
  
  <p>Other References:<br>
  <a href="https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/</a></p>
  
  <p>My config file for apache2 is as follows.</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  
      Alias /static /home/ubuntu/test_pfi_app/static
      #Alias /media /home/ubuntu/test_pfi_app/media
  
      #DocumentRoot /var/www/html
  
      &lt;Directory /home/ubuntu/test_pfi_app/static&gt;
          Require all granted
      &lt;/Directory&gt;
  
      WSGIDaemonProcess myproject python-path=/home/ubuntu/test_pfi_app:/usr/local/lib/python2.7/site-packages
      WSGIProcessGroup myproject
      WSGIScriptAlias /django /home/ubuntu/test_pfi_app/myproject/wsgi.py process-group=myproject
      #WSGIScriptAliasMatch /django /home/ubuntu/test_pfi_app/myproject/wsgi.py
  
      &lt;Directory /home/ubuntu/test_pfi_app/myproject&gt;
          &lt;Files wsgi.py&gt;
              Require all granted
          &lt;/Files&gt;
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
  ServerName app1.example.co.in
  DocumentRoot /var/www/html/ocdemo
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
  ServerName app2.example.co.in
  DocumentRoot /var/www/html/echosuat
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;
  ServerName task.example.co.in
  DocumentRoot /var/www/html/tasks
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I am able to access the django app using <code>IP/django</code> but accessing the root of the server redirects to the the <code>/var/www</code> url as shown in the below image.</p>
  
  <p><a href="https://i.stack.imgur.com/PfT42.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PfT42.png" alt="enter image description here"></a></p>
  
  <p>And all the other apps are accessible from <code>IP/html/app_name</code> while they should be accessible from <code>IP/app_name</code></p>
  
  <p>I am unable to make the correct configuration in the configuration file.</p>
  
  <p>Also, I am unable to see the "welcome to django" page on accessing <code>IP/django</code>. It rather gives a "<strong>Page not found (404)</strong>"  </p>
  
  <p><strong>Not getting the default django page, on accessing <code>IP/django</code>.</strong><br>
  <a href="https://i.stack.imgur.com/JDwjq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JDwjq.png" alt="enter image description here"></a></p>
  
  <p><strong>Getting this page on accessing <code>IP/django</code></strong><br>
  <strong>Though, <code>IP/django/admin</code> works fine.</strong><br>
  <a href="https://i.stack.imgur.com/utRJQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/utRJQ.png" alt="enter image description here"></a></p>