问题描述
我将 Apache 用于 HTTP,daphne 用于 WebSockets,Django 用于 Web 应用程序和
我正在关注 this documentation 创建 HTTPS 认证,但是当我使用
sudo certbot --apache
我收到错误
Could not reverse map the HTTPS VirtualHost to the original
IMPORTANT NOTES:
- Unable to install the certificate
我试过了:
-
sudo certbot certonly --apache
- 它没有抛出任何错误,甚至说“恭喜!您的证书和链已保存在:”,但它似乎不起作用。我的 apache 项目 .conf 文件没有改变,没有创建新文件,https://myproject.com 没有工作。 - 注释服务器名称
- 注释 WebSocket 部分(
RewriteEngine on
后 3 行) - 评论 Wsgi 部分(如 this tutorial)
Apache 项目配置:
<VirtualHost *:80>
ServerName www.tdchat.net
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/n3rsti/TodoChat/todochat/static
<Directory /home/n3rsti/TodoChat/todochat/static>
Require all granted
</Directory>
Alias /media /home/n3rsti/TodoChat/todochat/media
<Directory /home/n3rsti/TodoChat/todochat/media>
Require all granted
</Directory>
<Directory /home/n3rsti/TodoChat/todochat/todochat>
AllowOverride All
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WsgiScriptAlias / /home/n3rsti/TodoChat/todochat/todochat/wsgi.py
WsgiDaemonProcess django_app python-path=/home/n3rsti/TodoChat/todochat python-home=/home/n3rsti/TodoChat/venv
WsgiProcessGroup django_app
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://127.0.0.1:8001%{REQUEST_URI} [P,QSA,L]
</VirtualHost>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)