Это продолжение следующих проблем на github:
https://github.com/certbot/certbot/issues/1820
а также
https://github.com/certbot/certbot/issues/2546
Letsencrypt не может работать с конфигурацией WSGI apache
Я запускаю apache2 со следующей конфигурацией
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
# DocumentRoot /var/www/html
ServerName mywebsitedomain.com
ServerAlias www.mywebsitedomain.com
DocumentRoot /var/www/html/mywebsitedomain-com
Alias /static/ /home/ubuntu/Sites/mywebsitedomain-com/myproductionfolder/static/
<Directory /home/ubuntu/Sites/mywebsitedomain-com/myproductionfolder/static>
Require all granted
</Directory>
# adjust the following line to match your Python path
<Directory "/home/ubuntu/Sites/mywebsitedomain-com/myproductionfolder">
<Files wsgi.py>
AllowOverride all
Options FollowSymLinks
Require all granted
</Files>
</Directory>
WSGIDaemonProcess mywebsitedomain.com processes=2 threads=15 display-name=%{GROUP} user=www-data group=www-data python-path=/home/ubuntu/Sites/mywebsitedomain-com:/home/ubuntu/Sites/mywebsitedomain-com/venv/lib/python3.5/site-packages
WSGIProcessGroup mywebsitedomain.com
WSGIScriptAlias / /home/ubuntu/Sites/mywebsitedomain-com/myproductionfolder/wsgi.py process-group=mywebsitedomain.com application-group=%{GLOBAL}
Alias /phpmyadmin /var/www/html/phpmyadmin
<Location /phpmyadmin>
</Location>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
Когда я выполняю шаги, описанные здесь
https://certbot.eff.org/lets-encrypt/ubuntuxenial-apache
следующее :
$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-apache
$ sudo certbot --apache
это не удается со следующей ошибкой
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.
AH00526: Syntax error on line 31 of /etc/apache2/sites-enabled/mywebsitedomain.app.conf:
Name duplicates previous WSGI daemon definition.
Rolling back to previous server configuration...
Error while running apache2ctl configtest.
Action 'configtest' failed.
Следовательно, как описано в следующей ссылке:
https://github.com/certbot/certbot/issues/1820
Я закомментировал строки WSGI следующим образом
# WSGIDaemonProcess mywebsitedomain.com processes=2 threads=15 display-name=%{GROUP} user=www-data group=www-data python-path=/home/ubuntu/Sites/mywebsitedomain-com:/home/ubuntu/Sites/mywebsitedomain-com/venv/lib/python3.5/site-packages
# WSGIProcessGroup mywebsitedomain.com
# WSGIScriptAlias / /home/ubuntu/Sites/mywebsitedomain-com/myproductionfolder/wsgi.py process-group=mywebsitedomain.com application-group=%{GLOBAL}
И снова запустите certbot следующим образом:
$ sudo certbot --apache
На этот раз certbot завершает свое сообщение следующим сообщением:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/mywebsitedomain.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/mywebsitedomain.com/privkey.pem
Однако, когда я раскомментирую следующие 3 строки из сгенерированного
Файл /etc/apache2/sites-available/mywebsitedomain.com-le-ssl.conf
следующее :
WSGIDaemonProcess mywebsitedomain.com processes=2 threads=15 display-name=%{GROUP} user=www-data group=www-data python-path=/home/ubuntu/Sites/mywebsitedomain-com:/home/ubuntu/Sites/mywebsitedomain-com/venv/lib/python3.5/site-packages
WSGIProcessGroup mywebsitedomain.com
WSGIScriptAlias / /home/ubuntu/Sites/mywebsitedomain-com/myproductionfolder/wsgi.py process-group=mywebsitedomain.com application-group=%{GLOBAL}
И беги
$ sudo service apache2 start
Кажется, что Apache запускается, но веб-сайт https://mywebsitedomain.com не загружается
Также не работает http://mywebsitedomain.com
Пожалуйста, помогите отладить эту проблему, чтобы я мог получить https для загрузки с конфигурацией wsgi для приложения django на apache.
settings.py
? - person cezar   schedule 13.07.2018