[英]SSL with Apache and Passenger
我嘗試通過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。
我評論說:
#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。
端口80和443正在偵聽,但由於某些原因443無法響應。
我的EC2安全組有一個錯誤。 我允許訪問端口443,它可以正常工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.