我尝试使用来自http://www.napcsweb.com/blog/2012/07/24/securing-a-rails-app-on-passenger-with-ssl/的配置向我的服务器添加 SSL 支持
#<VirtualHost *:80>
# ServerName 54.215.6.127
# RewriteEngine On
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent]
#</VirtualHost>
<VirtualHost *:80>
#<VirtualHost *:443>
ServerName 54.215.6.127
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /home/ubuntu/my_app/current/public
<Directory /home/ubuntu/my_app/current/public>
Satisfy Any
# This relaxes Apache security settings.
AllowOverride all
Require all granted
# MultiViews must be turned off.
Options -MultiViews
</Directory>
#SSLEngine on
#SSLOptions +StrictRequire
#SSLCertificateFile /etc/apache2/certs/54.215.6.127.crt
#SSLCertificateKeyFile /etc/apache2/certs/54.215.6.127.key
</VirtualHost>
看到我评论了将服务器设置为先前状态的行,即非 SSL,但现在服务器无响应。
我确实有 napcsweb 博客中建议的密钥:key、csr 和 crt。
- 我在 SSL 配置中缺少什么?
- 乘客刚刚停止工作,我怎么能重新开始呢?
更新
它可以工作,但只是在更改配置后使用 http,我评论道:
#Satisfy Any
# This relaxes Apache security settings.
#AllowOverride all
#Require all granted
# MultiViews must be turned off.
Options -MultiViews
并重新启动服务器
sudo apachectl restart
sudo service apache2 restart
但无论如何,我需要设置https。
更新 2
端口 80 和 443 正在侦听,但由于某种原因 443 没有响应。