Certbot Apache错误“名称重复了先前的WSGI守护程序定义". [英] Certbot Apache error "Name duplicates previous WSGI daemon definition."

查看:213
本文介绍了Certbot Apache错误“名称重复了先前的WSGI守护程序定义".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Ubuntu 16.04服务器上,我在/etc/apache2/sites-enabled/000-default.conf处有一个Apache conf文件,它看起来像这样(缩写):

On my Ubuntu 16.04 server, I have an Apache conf file at /etc/apache2/sites-enabled/000-default.conf, which looks like this (abbreviated):

WSGIApplicationGroup %{GLOBAL}

<VirtualHost *:80>
    ServerName example.com
    WSGIDaemonProcess myprocess user=ubuntu group=ubuntu threads=10 home=/home/ubuntu/myapp
    WSGIProcessGroup myprocess
    ...
</VirtualHost>

它在HTTP模式下工作正常,但是当我运行$ sudo certbot --apache设置HTTPS时,它失败,并显示错误Syntax error on line 7 of /etc/apache2/sites-enabled/000-default.conf: Name duplicates previous WSGI daemon definition.第7行是从WSGIDaemonProcess开始的行.

It works fine in HTTP mode, but when I run $ sudo certbot --apache to set up HTTPS, it fails with the error Syntax error on line 7 of /etc/apache2/sites-enabled/000-default.conf: Name duplicates previous WSGI daemon definition. Line 7 is the line beginning with WSGIDaemonProcess.

推荐答案

事实证明,如果我的Apache conf文件000-default.conf only 声明<VirtualHost *:80>...</VirtualHost>,则Certbot将其复制并创建一个 second 名为000-default-le-ssl.conf的Apache conf文件,用于定义<VirtualHost *:443>...</VirtualHost>.

It turns out that if my Apache conf file 000-default.conf only declares <VirtualHost *:80>...</VirtualHost>, then Certbot duplicates it and creates a second Apache conf file called 000-default-le-ssl.conf to define <VirtualHost *:443>...</VirtualHost>.

出现Name duplicates previous WSGI daemon definition错误是因为两者 Apache conf文件具有定义WSGIDaemonProcess myprocess...的同一行.这似乎是已知的Certbot错误.

The Name duplicates previous WSGI daemon definition error appears because both Apache conf files have the same line defining WSGIDaemonProcess myprocess.... This appears to be a known Certbot bug.

我发现的解决方法是相同 Apache conf文件中定义两个VirtualHosts(80和443)(这样Certbot不会创建第二个文件) ),并在两个VirtualHost外部定义WSGIDaemonProcess,如下所示:

The workaround I've found is to define both VirtualHosts (80 and 443) in the same Apache conf file (so that Certbot doesn't create a second file), and to define WSGIDaemonProcess outside both VirtualHosts, like this:

WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess myprocess user=ubuntu group=ubuntu threads=10 home=/home/ubuntu/myapp
WSGIProcessGroup myprocess

<VirtualHost *:80>
    ServerName example.com
    ...
</VirtualHost>
<VirtualHost *:443>
    ServerName example.com
    ...
</VirtualHost>

这篇关于Certbot Apache错误“名称重复了先前的WSGI守护程序定义".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆