Wednesday, January 19, 2011

4 different domains on single apache/mod_wsgi

Hi all!
I have 2 separate projects, with 2 separate domains

The problem: first website, ELG, is working OK.
Another, cc4h, cannot find template index.html, but is working perfect
on localhost with Django development server.

Do you know any good tutorial regarding multiple domains on single
Apache?
It doesnt seems as easy as I thought it will be.

Thank you

Code:

Both WSGI files (projects ELG and CC4H):
---------------------------------
/home/django/projects/elg/apache/elg.wsgi
/home/django/projects/cc4h/apache/cc4h.wsgi
---------------------------------
import os, sys
sys.path.append('/home/django/projects')
os.environ['DJANGO_SETTINGS_MODULE'] = 'elg.settings' #for project
cc4h is 'cc4h.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

--------------------------------
My httpd.conf:
--------------------------------
NameVirtualHost *
<VirtualHost *>
ServerName www.domain1.com
ServerAdmin ***l@gmail.com
Alias /robots.txt /home/django/projects/elg/media/robots.txt
Alias /favicon.ico /home/django/projects/elg/media/favicon.ico
AliasMatch ^/([^/]*\.css) /home/django/projects/elg/media/css/$1
AliasMatch ^/([^/]*\.js) /home/django/projects/elg/media/js/$1
Alias /media/ /home/django/projects/elg/media/
<Directory /home/django/projects/elg/media>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /home/django/projects/elg/apache/elg.wsgi
<Directory /home/django/projects/elg/website>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


<VirtualHost *>
ServerName www.domain2.com
ServerAdmin ***l@gmail.com
Alias /robots.txt /home/django/projects/cc4h/media/robots.txt
Alias /favicon.ico /home/django/projects/cc4h/media/favicon.ico
AliasMatch ^/([^/]*\.css) /home/django/projects/cc4h/media/css/$1
AliasMatch ^/([^/]*\.js) /home/django/projects/cc4h/media/js/$1
Alias /media/ /home/django/projects/cc4h/media/
<Directory /home/django/projects/cc4h/media>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /home/django/projects/cc4h/apache/cc4h.wsgi
<Directory /home/django/projects/cc4h/website>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate