WebFaction
Community site: login faq

Hi guys,

I have 3 django projects for 2 subdomains parents.abc.com,teachers.abc.com and abc.com. under one django application.

Inside the httpd.conf file, I have the following:

ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess django processes=5 python-path=/home/carrier24sg/webapps/django:/home/carrier24sg/webapps/django/lib/python2.6 threads=1
WSGIPythonPath /home/carrier24sg/webapps/django:/home/carrier24sg/webapps/django/lib/python2.6
NameVirtualHost *:37049

<VirtualHost *:37049>
        WSGIScriptAlias / /home/carrier24sg/webapps/django/myproject.wsgi
        ServerName abc.webfactional.com
        ServerAlias abc.webfactional.com
</VirtualHost>
<VirtualHost *:37049>
        WSGIScriptAlias / /home/carrier24sg/webapps/django/parents.wsgi
        ServerAlias parents.abc.webfactional.com
</VirtualHost>

<VirtualHost *:37049>
        WSGIScriptAlias / /home/carrier24sg/webapps/django/teachers.wsgi
        ServerAlias teachers.abc.webfactional.com
</VirtualHost>

Under the wsgi files, I set DJANGO_SETTINGS_MODULE to point to the appropriate settings file for each project.

My problem comes (after a restart) if I visit parents.subdomain.com, followed by teachers.subdomain.com (or vice versa), I will encounter url error in the second because it seem like it is referencing the urls.py for the first project. i.e teachers.subdomain.com is looking at the settings file for parents.subdomain.com (vice versa).

Anything wrong with my httpd.conf file =?

asked 21 Mar '11, 00:26

amateur
1111416
accept rate: 0%

Hi,

I don't see anything wrong with your configuration here, have you defined a separate set of URLs for both of the WSGI files in your code somewhere?

(21 Mar '11, 00:41) klynton

yea, i have from django.core.handlers.wsgi import WSGIHandler

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.parents_settings' application = WSGIHandler() and settings.teachers_settings in the other wsgi

(21 Mar '11, 01:38) amateur

Hi,

Looking at this old post here:

http://forum.webfaction.com/viewtopic.php?pid=13326#p13326

You need to set up the Daemon process stuff per VirtualHost, this is what is causing the error you are seeing. So I was wrong the first time, there is something wrong with your apache2/conf/httpd.conf. :)

permanent link

answered 21 Mar '11, 02:22

klynton
1.6k1210
accept rate: 41%

ah.. great. I managed to get it after adding wsgidaemonprocess and wsgiprocessgroup

(21 Mar '11, 11:11) amateur
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×225

question asked: 21 Mar '11, 00:26

question was seen: 4,131 times

last updated: 21 Mar '11, 11:11

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM