名称重复以前的WSGI守护程序定义

问题描述 投票:0回答:7

I设置了一个新的conf文件,只有以下更改:

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

我会收到以下错误:

名称重复以前的WSGI守护程序定义。
我如何解决?  感谢您的帮助

更改

originalsite
名称

在目录地址不只是名称中的名称
python django apache mod-wsgi
7个回答
25
投票
WSGIDaemonProcess somethingelse python-path=/var/www/originalsite:/var/www/originalsite/env/‌​lib/python2.7/site-p‌​ackages

WSGIProcessGroup somethingelse

如果您在使用

certbot

命令安装多个“让我们加密证书”时面对此问题,那么可能是由于
certbot
中的某些错误,如

24
投票
所讨论的。要快速解决方法,您可以评论

WSGIScriptAlias 
WSGIDaemonProcess 
WSGIProcessGroup
运行
certbot命令,然后删除评论。

错误原因是因为MOD_WSGI守护程序进程组的名称在整个Apache安装中必须是唯一的。在不同的
VirtualHost
定义中不可能使用相同的守护程序进程组名称。在某些情况下,在研究守护程序过程组时,这是避免冲突的必要条件。

我通过评论以下3行
/etc/apache2/sites-enabled/000-default.conf


7
投票
# WSGIDaemonProcess # WSGIProcessGroup # WSGIScriptAlias

然后重新加载/重新启动apache2.

我将它们像在

5
投票
中一样留下

尽管有正确的答案,但在阅读答案时,我仍然感到困惑。因此,这是针对Apache上一个网站启用HTTP和HTTPS的特定情况的一些澄清。

在您的配置文件之一(例如http)中:
# Add this outside of VirtualHost scope to ensure it's global
WSGIDaemonProcess some_name python-path=/var/www/originalsite:/var/www/originalsite/env/‌​lib/python2.7/site-p‌​ackages

...


# Within VirtualHost
WSGIProcessGroup some_name

在其他配置文件(https)中:

WSGIProcessGroup some_name
这就是它。它的作用是在两个配置文件中链接同一组。该过程名称仅在一个配置文件中定义,这使Apache感到高兴。


2
投票
首先在linux中查找“ wsgidaemon”字符串:

grep -iRl "WSGIDaemon" ./

秒对每一行进行分析。我在
/etc/apache2/sites-enabled/000-default-copy.conf
上找到了重复的文件。删除后,检查语法:

sudo apachectl configtest
返回'语法OK'。我花了这4个小时...希望有人使用这个:)


1
投票
一个旧线程,但可以在2025年使用Ubuntu 24.04的解决方案。

问题是由于certbot

bug。

format conf file

/etc/apache2/sites-enabled/000-default.conf
(或
/etc/apache2/sites-enabled/example.com.conf

)as:

Define wsgi_daemon "myexample_proc"

<VirtualHost *:80>
ServerName example.com

...
<IfDefine !wsgi_init>
            WSGIDaemonProcess ${wsgi_daemon} python-home=/home/ubuntu/myapp/venv python-path=/home/ubuntu/myapp user=ubuntu socket-user=ubuntu request-timeout=60
            WSGIProcessGroup ${wsgi_daemon}
            WSGIScriptAlias / /home/ubuntu/myapp/myapp/wsgi.py
            Define wsgi_init 1
</IfDefine>
...

</VirtualHost>

solution从:
Https://github.com/certbot/certbot/issues/8373#issuecomment-934030469


0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.