Name duplicates previous WSGI daemon definition

2,684 views
Skip to first unread message

Jon

unread,
Jul 2, 2009, 5:13:04 PM7/2/09
to modwsgi
Hello,

I am trying to use mod_wsgi to run Django on Apache.

I have followed the tutorial here http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
to run in daemon mode however I am having problems. (NB. I have
replaced my domain name with example.com in the following)

$ /etc/init.d/apache reload
Syntax error on line 5 of /etc/apache2/sites-enabled/example.com:
Name duplicates previous WSGI daemon definition.
failed!

My vhost config for my domain is as follows:

<VirtualHost *:80>

ServerName www.example.com

WSGIDaemonProcess www.example.com user=www-data group=www-data
threads=10
WSGIProcessGroup www.example.com

Alias /static/ /var/www/www.example.com/static/

<Directory /var/www/www.example.com/static>
Order allow,deny
Allow from all
</Directory>

WSGIScriptAlias / /home/jonathan/src/website/apache/django.wsgi

<Directory /home/jonathan/src/website/apache>
Order allow,deny
Allow from all
</Directory>

LogLevel warn
ErrorLog /var/log/apache2/example.com/error.log
CustomLog /var/log/apache2/example.com/access.log combined

</VirtualHost>

I have other vhosts, however none are using mod_wsgi - they are just
serving basic PHP sites.

Grepping the output of ps aux for wsgi doesn't show any wsgi processes
running.

I noticed someone with a similar error posting another discussion in
the group, but still I have not been able to resolve this issue.

Any ideas what I am doing wrong?

Thanks,
Jon

Graham Dumpleton

unread,
Jul 2, 2009, 6:51:32 PM7/2/09
to mod...@googlegroups.com
2009/7/3 Jon <jonh...@gmail.com>:

>
> Hello,
>
> I am trying to use mod_wsgi to run Django on Apache.
>
> I have followed the tutorial here http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
> to run in daemon mode however I am having problems.  (NB. I have
> replaced my domain name with example.com in the following)
>
> $ /etc/init.d/apache reload
> Syntax error on line 5 of /etc/apache2/sites-enabled/example.com:
> Name duplicates previous WSGI daemon definition.
>  failed!

Which means that you must have multiple WSGIDaemonProcess directives
for same name in your Apache configuration file. That or if using
include to include your snippet, you are including it twice somehow.
Either way, a WSGIDaemonProcess for same name is being seen twice.

> My vhost config for my domain is as follows:
>
> <VirtualHost *:80>
>
>  ServerName  www.example.com
>
>  WSGIDaemonProcess www.example.com user=www-data group=www-data
> threads=10

There is no point setting user/group here as those are the user/group
that Apache runs as anyway. You only need to set them if you want to
use something different.

>  WSGIProcessGroup www.example.com
>
>  Alias /static/ /var/www/www.example.com/static/
>
>  <Directory /var/www/www.example.com/static>
>    Order allow,deny
>    Allow from all
>  </Directory>
>
>  WSGIScriptAlias / /home/jonathan/src/website/apache/django.wsgi
>
>  <Directory /home/jonathan/src/website/apache>
>    Order allow,deny
>    Allow from all
>  </Directory>
>
>  LogLevel warn
>  ErrorLog  /var/log/apache2/example.com/error.log
>  CustomLog /var/log/apache2/example.com/access.log combined
>
> </VirtualHost>
>
> I have other vhosts, however none are using mod_wsgi - they are just
> serving basic PHP sites.
>
> Grepping the output of ps aux for wsgi doesn't show any wsgi processes
> running.

That is because they will show as httpd process unless you use
'display-name' option to WSGIDaemonProcess. See:

http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess

> I noticed someone with a similar error posting another discussion in
> the group, but still I have not been able to resolve this issue.
>
> Any ideas what I am doing wrong?

Also ensure you are using most up to date mod_wsgi and not some older version.

Graham

Jon

unread,
Jul 3, 2009, 4:28:01 AM7/3/09
to modwsgi
On Jul 2, 11:51 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:

> > $ /etc/init.d/apache reload
> > Syntax error on line 5 of /etc/apache2/sites-enabled/example.com:
> > Name duplicates previous WSGI daemon definition.
> >  failed!
>
> Which means that you must have multiple WSGIDaemonProcess directives
> for same name in your Apache configuration file. That or if using
> include to include your snippet, you are including it twice somehow.
> Either way, a WSGIDaemonProcess for same name is being seen twice.

Ahh, I had two symlinks in my /etc/apache2/sites-enabled directory, a
000-default one and an example.com one. I've ditched the latter and
now it's working :-)

Thanks for helping me to realise this mistake, and for the other tips
too.
Reply all
Reply to author
Forward
0 new messages