I设置了一个新的conf文件,只有以下更改:
ServerName newsite.co.uk
ServerAlias www.newsite.co.uk
我会收到以下错误:
名称重复以前的WSGI守护程序定义。
我如何解决? 感谢您的帮助
名称更改
originalsite
在目录地址不只是名称中的名称
WSGIDaemonProcess somethingelse python-path=/var/www/originalsite:/var/www/originalsite/env/lib/python2.7/site-packages
和
WSGIProcessGroup somethingelse
如果您在使用
certbot
certbot
中的某些错误,如
WSGIScriptAlias
WSGIDaemonProcess
WSGIProcessGroup
运行
certbot
命令,然后删除评论。
错误原因是因为MOD_WSGI守护程序进程组的名称在整个Apache安装中必须是唯一的。在不同的VirtualHost
定义中不可能使用相同的守护程序进程组名称。在某些情况下,在研究守护程序过程组时,这是避免冲突的必要条件。
我通过评论以下3行
/etc/apache2/sites-enabled/000-default.conf
# WSGIDaemonProcess
# WSGIProcessGroup
# WSGIScriptAlias
然后重新加载/重新启动apache2.我将它们像在
尽管有正确的答案,但在阅读答案时,我仍然感到困惑。因此,这是针对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-packages
...
# Within VirtualHost
WSGIProcessGroup some_name
在其他配置文件(https)中:
WSGIProcessGroup some_name
这就是它。它的作用是在两个配置文件中链接同一组。该过程名称仅在一个配置文件中定义,这使Apache感到高兴。
grep -iRl "WSGIDaemon" ./
秒对每一行进行分析。我在
/etc/apache2/sites-enabled/000-default-copy.conf
上找到了重复的文件。删除后,检查语法:
sudo apachectl configtest
返回'语法OK'。我花了这4个小时...希望有人使用这个:)
问题是由于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