Name duplicates previous WSGI daemon definition

元气小坏坏 提交于 2020-05-10 07:34:08

问题


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


回答1:


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



回答2:


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.




回答3:


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:


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.



来源:https://stackoverflow.com/questions/39317200/name-duplicates-previous-wsgi-daemon-definition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!