# a2enmod ssl && service apache2 restartnetstat -nutlp,Apache正在监听端口80和443。我的虚拟主机设置如下:
<VirtualHost *:443>
SSLEngine On
SSLCertificateKeyFile SSL_DIR/ssl.key
SSLCertificateFile SSL_DIR/ssl.crt
</VirtualHost>
<VirtualHost *:80 *:443>
ServerAdmin webmaster@localhost
ServerAlias website.com *.website.com
ServerName www.website.com
# Just a few connection resets so that I don't waste my bandwidth on "hackers"
SecRuleEngine On
SecRule &REQUEST_HEADERS:User-Agent "@eq 0" drop,phase:1
SecRule REQUEST_HEADERS:User-Agent "^$" drop,phase:1
SecRule REQUEST_LINE "://" drop,phase:1
SecRule REQUEST_URI "^/admin" drop,phase:1
SecRule REQUEST_URI "^/mail" drop,phase:1
SecRule REQUEST_URI "^/webmail" drop,phase:1
DocumentRoot /path/public_html
<Directory /path/public_html/>
Options FollowSymLinks MultiViews
Order allow,deny
allow from all
</Directory>
</VirtualHost>当我注册我的SSL证书时,我也得到了两个.pem文件,并且找不到如何处理它们的任何东西。
我的问题是,为什么SSL不起作用?它与.pem文件有关吗?
发布于 2013-05-19 23:38:52
首先,必须启用ssl。
sudo a2enmod ssl而不是你必须包括你的pem文件(迷你例子)
<VirtualHost *:443>
SSLEngine On
SSLCertificateKeyFile SSL_DIR/ssl.key
SSLCertificateFile SSL_DIR/ssl.crt
ServerAdmin webmaster@localhost
ServerAlias website.com *.website.com
ServerName www.website.com
# Just a few connection resets so that I don't waste my bandwidth on "hackers"
SecRuleEngine On
SecRule &REQUEST_HEADERS:User-Agent "@eq 0" drop,phase:1
SecRule REQUEST_HEADERS:User-Agent "^$" drop,phase:1
SecRule REQUEST_LINE "://" drop,phase:1
SecRule REQUEST_URI "^/admin" drop,phase:1
SecRule REQUEST_URI "^/mail" drop,phase:1
SecRule REQUEST_URI "^/webmail" drop,phase:1
DocumentRoot /path/public_html
<Directory /path/public_html/>
Options FollowSymLinks MultiViews
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerAlias website.com *.website.com
ServerName www.website.com
# Just a few connection resets so that I don't waste my bandwidth on "hackers"
SecRuleEngine On
SecRule &REQUEST_HEADERS:User-Agent "@eq 0" drop,phase:1
SecRule REQUEST_HEADERS:User-Agent "^$" drop,phase:1
SecRule REQUEST_LINE "://" drop,phase:1
SecRule REQUEST_URI "^/admin" drop,phase:1
SecRule REQUEST_URI "^/mail" drop,phase:1
SecRule REQUEST_URI "^/webmail" drop,phase:1
DocumentRoot /path/public_html
<Directory /path/public_html/>
Options FollowSymLinks MultiViews
Order allow,deny
allow from all
</Directory>
</VirtualHost>https://stackoverflow.com/questions/16640606
复制相似问题