Name duplicates previous WSGI daemon definition

2020-06-08 13:35发布

I'm changing the domain name of a site. For a period I want the old domain name and the new domain name to point to the site. I'm running a Python Django site.

My original Apache2 conf works fine and the basis is:

<VirtualHost *:80>
        ServerAdmin name@gmail.com
        ServerName originalsite.co.uk
        ServerAlias www.originalsite.co.uk
        DocumentRoot /var/www/originalsite
        WSGIDaemonProcess originalsite python-path=/var/www/originalsite:/var/www/originalsite/env/lib/python2.7/site-packages
        WSGIProcessGroup originalsite
        WSGIScriptAlias / /var/www/originalsite/originalsite/wsgi.py
        ...
</VirtualHost>

I set up a new conf file with only the following changes:

    ServerName newsite.co.uk
    ServerAlias www.newsite.co.uk

And I'm getting the following error:

Name duplicates previous WSGI daemon definition.

How do I fix this? Thanks for your help

4条回答
你好瞎i
2楼-- · 2020-06-08 13:46

If you're facing this issue while using certbot command to install multiple "Let's Encrypt Certificates" then it may be due to some bug in certbot. As discussed here, for a quick workaround you can comment

WSGIScriptAlias 
WSGIDaemonProcess 
WSGIProcessGroup

to run certbot command and then remove the comments afterwards.

查看更多
做个烂人
3楼-- · 2020-06-08 13:50

I have the same problem with Apache2 configuration. In my case I have duplicated 000-default.conf file in /etc/apache2/sites-enabled.

First I looking 'WSGIDaemon' string in Linux:

grep -iRl "WSGIDaemon" ./

Second analize every line. I found duplicated file on /etc/apache2/sites-enabled/000-default-copy.conf. After delete, checking syntax:

sudo apachectl configtest

return 'Syntax OK'. I spend on this 4 hours... I hope somebody use this :)

查看更多
虎瘦雄心在
4楼-- · 2020-06-08 13:58

The reason for the error is because the name of a mod_wsgi daemon process group must be unique across the whole Apache installation. It is not possible to use the same daemon process group name in different VirtualHost definitions. This is necessary to avoid conflicts when working out what daemon process group is being referred to in certain situations.

查看更多
家丑人穷心不美
5楼-- · 2020-06-08 13:59

change originalsite name

not in the directory address just the name like

WSGIDaemonProcess somethingelse python-path=/var/www/originalsite:/var/www/originalsite/env/‌​lib/python2.7/site-p‌​ackages

and

WSGIProcessGroup somethingelse
查看更多
登录 后发表回答