4 different domains on single apache/mod_wsgi

2011-01-19 Thread Osiaq
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 *

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/

Order deny,allow
Allow from all

WSGIScriptAlias / /home/django/projects/elg/apache/elg.wsgi

Order allow,deny
Allow from all





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/

Order deny,allow
Allow from all

WSGIScriptAlias / /home/django/projects/cc4h/apache/cc4h.wsgi

Order allow,deny
Allow from all



-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Kenneth Gonsalves
On Wed, 2011-01-19 at 16:20 -0800, Osiaq wrote:
> It doesnt seems as easy as I thought it will be.

it is as easy as falling of a log! If you can tell us what distro you
are using we can point the way.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Osiaq
Hi Kenneth!
Distro: Ubuntu Server 10.04

As I said the firs site, ELG is working OK.
I just changed second site (cc4h) WSGI and it worked, printing "Hello
World!"
so domains are redirected OK. (please see code below)
But the website itself is not working, still can't find the template

Regards!

-
 /home/django/projects/cc4h/apache/cc4h.wsgi
-
#import os, sys
#sys.path.append('/home/django/projects')
#os.environ['DJANGO_SETTINGS_MODULE'] = 'cc4h.settings'
#import django.core.handlers.wsgi
#application = django.core.handlers.wsgi.WSGIHandler()

def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]


On Jan 20, 2:46 am, Kenneth Gonsalves  wrote:
> On Wed, 2011-01-19 at 16:20 -0800, Osiaq wrote:
> > It doesnt seems as easy as I thought it will be.
>
> it is as easy as falling of a log! If you can tell us what distro you
> are using we can point the way.
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Kenneth Gonsalves
On Wed, 2011-01-19 at 16:56 -0800, Osiaq wrote:
> Hi Kenneth!
> Distro: Ubuntu Server 10.04 

well ubuntu follows the debian mode for setting up virtual hosts - you
have virtual hosts files in /etc/apache/sites-available and you symlink
them to /etc/apache/sites-enabled/. Here is a typical virtual host file:


ServerAdmin webmas...@xlquest.web
DocumentRoot /var/www/quadmulc/
ServerName quadmulc.web
ErrorLog logs/quadmulc-error_log
CustomLog logs/quadmulc-access_log common

Alias /media/ /home/lawgon/django-trunk/django/contrib/admin/media/
Alias /smedia/ /home/lawgon/smedia/
Alias /sitemedia/ /home/lawgon/quadmulc/sitemedia/

WSGIScriptAlias / /home/lawgon/quadmulc/apache/django.wsgi


Order deny,allow
Allow from all


Order deny,allow
Allow from all


Order deny,allow
Allow from all


-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-19 Thread Graham Dumpleton
Technically it should be able to made to work. I would recommend though you 
use mod_wsgi daemon mode and delegate each Django site instance to its own 
process, rather than each sharing the same process but in different sub 
interpreters. See:

  
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegation_To_Daemon_Process

This will ensure that leakage of environment variables or other process 
level settings across sub interpreters doesn't occur.

Graham

On Thursday, January 20, 2011 11:20:36 AM UTC+11, Osiaq wrote:
>
> 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 * 
>  
> 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/ 
>  
> Order deny,allow 
> Allow from all 
>  
> WSGIScriptAlias / /home/django/projects/elg/apache/elg.wsgi 
>  
> Order allow,deny 
> Allow from all 
>  
>  
>
>
>  
> 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/ 
>  
> Order deny,allow 
> Allow from all 
>  
> WSGIScriptAlias / /home/django/projects/cc4h/apache/cc4h.wsgi 
>  
> Order allow,deny 
> Allow from all 
>  
>  
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 4 different domains on single apache/mod_wsgi

2011-01-21 Thread Osiaq
Graham, daemonize is a trick a was looking for :) Thank you for the
great idea :)
Problem solved.

On Jan 20, 3:16 am, Graham Dumpleton 
wrote:
> Technically it should be able to made to work. I would recommend though you
> use mod_wsgi daemon mode and delegate each Django site instance to its own
> process, rather than each sharing the same process but in different sub
> interpreters. See:
>
>  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegat...
>
> This will ensure that leakage of environment variables or other process
> level settings across sub interpreters doesn't occur.
>
> Graham
>
> On Thursday, January 20, 2011 11:20:36 AM UTC+11, Osiaq wrote:
>
> > 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 *
> > 
> > ServerNamewww.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/
> > 
> > Order deny,allow
> > Allow from all
> > 
> > WSGIScriptAlias / /home/django/projects/elg/apache/elg.wsgi
> > 
> > Order allow,deny
> > Allow from all
> > 
> > 
>
> > 
> > ServerNamewww.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/
> > 
> > Order deny,allow
> > Allow from all
> > 
> > WSGIScriptAlias / /home/django/projects/cc4h/apache/cc4h.wsgi
> > 
> > Order allow,deny
> > Allow from all
> > 
> > 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.