Django + Apache - Can't find directory of my website
<p>I have done a website by using django framework. Now I'm trying to deploy using apache+wsgi. Here is my setting.
So I have a ip 59.120.185.12 and here is my .config:</p>

<pre><code>&lt;VirtualHost *:80&gt;
    ServerName www.vbgetech.com
    ServerAlias vbgetech.com
    ServerAdmin webmaster@localhost

    Alias /media/ /home/max/v_bridge/media/
    Alias /static/ /home/max/v_bridge/static/

    &lt;Directory /home/max/v_bridge/media&gt;
        Require all granted
    &lt;/Directory&gt;

    &lt;Directory /home/max/v_bridge/static&gt;
        Require all granted
    &lt;/Directory&gt;

    WSGIScriptAlias / /home/max/v_bridge/v_bridge/wsgi.py


    &lt;Directory /home/max/v_bridge/v_bridge/&gt;
    &lt;Files wsgi.py&gt;
        Require all granted
    &lt;/Files&gt;
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</code></pre>

<p>And its my wsgi.py</p>

<pre><code>"""
WSGI config for website project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application
from os.path import join,dirname,abspath

PROJECT_DIR = dirname(dirname(abspath(__file__)))#3
import sys # 4
sys.path.insert(0,PROJECT_DIR) # 5

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "v_bridge.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
</code></pre>

<p>I think I do follow all the instruction by official document. And It seems that If I type the ip on browser it still return me a apache default page. I guess that is because my server can't map the ip to the .conf file. Anyone has idea about it?</p>

<p>You should access the site using the URL <code>http://www.vbgetech.com</code>. You can't necessarily use the IP address. If you use the IP it will not match by host name lookup against <code>VirtualHost</code> and so the request will instead be handled by the first <code>VirtualHost</code> in the Apache configuration file, or in other words the default <code>VirtualHost</code>. That default <code>VirtualHost</code> is going to give you the default page if you never changed it.</p>

<p>In other words, if you added a new <code>VirtualHost</code> and didn't modify the default one, then you are going to have to use a proper host name in the URL for it to match your <code>VirtualHost</code>.</p>

python django apache mod-wsgi