0

I have the following httpd.conf. Based on the different domain, it should route the request to the appropriate entry showing a different site based on a similar code base.

The problem is that it swaps between site 1 and site 2 every few requests:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName www.mysite1.com
    ServerAlias mysite1.com
    DocumentRoot /var/www/html/mysitedjango
    WSGIScriptAlias / /var/www/html/mysitedjango/mysite1/mysite1_wsgi.py
</VirtualHost>

<VirtualHost *:80>
    ServerName www.mysite2.com
    ServerAlias mysite2.com
    DocumentRoot /var/www/html/mysitedjango
    WSGIScriptAlias / /var/www/html/mysitedjango/mysite1/mysite2_wsgi.py
</VirtualHost>



Alias /static/ /var/www/html/mysitedjango/shared/static/

<Directory /var/www/html/mysitedjango/shared/static/>
Order deny,allow
Allow from all
</Directory>

WSGIPythonPath /var/www/html/mysitedjango

<Directory /var/www/html/mysitedjango>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>

Is there something I can do to stop this confusion from happening?

4
  • Do you have the NameVirtualHost *:80 entry? You will need that to enable name based virtual hosting.
    – Daniel t.
    Apr 11, 2015 at 3:55
  • @Danielt. I thought what I had above is the name based virtual hosts? Can you provide an example?
    – petey
    Apr 11, 2015 at 16:24
  • Yes. In order to turn on name based virtual hosts, you will need the line NameVirtualHost *:80 in your Apache configuration file. Do you have that line?
    – Daniel t.
    Apr 11, 2015 at 19:41
  • @Danielt. yes I had this, but I added it here as well.
    – petey
    Apr 11, 2015 at 20:07

0

You must log in to answer this question.

Browse other questions tagged .