2009/1/14 Frédéric Sidler <[email protected]>:
> I'm using scalr.net to manage my application. We set up different subdomain
> for different services (feed, sms, etc.) actually hosted on the same
> instance. We did that so we can split these service in the future and don't
> ask users to change their RSS urls, SMS urls, etc.
>
> But now all subdomain point to the same instance. In scalr.net their is a
> template from which all "application" (subdomain) herit. So for all
> subdomains there is the same WSGI deamon definition. And when I launch
> apache, I get the following error. Is there a way to be modwsgi and scalr
> compatible in the same time. How do I manage subdomains with WSGI deamon
>
> Syntax error on line 31 of /etc/apache2/sites-enabled/jocada.com.vhost.conf:
> Name duplicates previous WSGI daemon definition.
> ...fail!
>
> All subdomain are using the same *.conf actually and scalr create a separate
> configuration file for each of them. Here is one of them. I'm using mod_wsgi
> 2.3 on ubunutu 8.04.
>
> WSGIImportScript /home/mixint/webapps/django/mixin/_lib/deploy/mixin.wsgi
> process-group=mixint application-group=mixint
> NameVirtualHost *
> <VirtualHost *:80>
> ServerAlias www.jocada.com jocada.com
> ServerAdmin [email protected]
> DocumentRoot /var/www
> ServerName www.jocada.com
>
> <Directory /var/www>
> Order allow,deny
> Options Indexes
> Allow from all
> IndexOptions FancyIndexing
> </Directory>
>
> ErrorLog /var/log/apache2/error.log
> LogLevel info
> CustomLog /var/log/http-jocada.com-access.log combined
> ServerSignature On
>
> Alias /media/
> /usr/lib/python2.5/site-packages/django/contrib/admin/media/
> <Directory
> /usr/lib/python2.5/site-packages/django/contrib/admin/media">
> Order allow,deny
> Options Indexes
> Allow from all
> IndexOptions FancyIndexing
> </Directory>
>
> SetEnv USER mixint
> SetEnv DJANGO_SETTINGS_MODULE mixin.settings
> WSGIDaemonProcess mixint user=mixint group=mixin
> WSGIProcessGroup mixint
> WSGIApplicationGroup mixint
> WSGIScriptAlias /
> /home/mixint/webapps/django/mixin/_lib/deploy/mixin.wsgi
>
> <Directory /home/mixint/webapps/django/mixin/_lib/deploy>
> Order allow,deny
> Allow from all
> </Directory>
>
> </VirtualHost>
First off, you probably don't want:
WSGIApplicationGroup mixint
If you are going to force it into a specific sub interpreter, you are
better off forcing it into the first interpreter as some third party
Python extension modules will only work in first interpreter.
WSGIApplicationGroup %{GLOBAL}
As to:
WSGIDaemonProcess mixint user=mixint group=mixin
WSGIProcessGroup mixint
When you generate these, can you generate them so that name of virtual
host is used for daemon process group instead:
WSGIDaemonProcess www.jocada.com user=mixint group=mixin
WSGIProcessGroup www.jocada.com
It is this name that needs to be unique across all virtual hosts.
Finally, having:
SetEnv DJANGO_SETTINGS_MODULE mixin.settings
will not work like it does if using mod_python. That is, there is no
special hack in Django to pick up values from request environment and
push it into os.environ. You should be setting this environment
variable in the WSGI script file.
I don't understand how you are using USER to know if will be same issue there.
So, I guess the question is, is this tempate paramaterisable in any
way? If you can have the name of the daemon process group be
automatically substitutable by the name of the virtual host, all
should be okay. At least so long as only handling port 80 on the
virtual host and so don't also need to distinguish based on port.
Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---