我在虚拟主机服务器上安装了OpenSuSE,运行多个虚拟网站。在普通的http上一切都很好。除了http之外,我现在还想在https上运行我的一个虚拟站点。因此,我购买了SSL证书。我已将我的证书文件复制到服务器:
SSLCertificateFile /etc/apache2/crt/site.crt
SSLCertificateKeyFile /etc/apache2/key/my.key
SSLCACertificateFile /etc/apache2/ca.txt我在文件"/etc/sysconfig/apache2“中启用了Apache Modules中的SSL
APACHE_MODULES="rewrite actions alias auth_basic authn_file authz_host authz_groupfile authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir php5 reqtimeout authn_core authz_core alias_module headers"在/etc/apache2中,我的listen.conf说:
Listen 80
<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>
Listen 443
</IfModule>
</IfDefine>
</IfDefine>我的vhost配置文件说:
<IfDefine SSL>
<IfDefine !NOSSL>
<VirtualHost *:443>
DocumentRoot "/srv/www/vhosts/dialogis-mediation.de/"
ServerName dialogis.coach:443
ServerAdmin juergen.tolksdorf@mac.com
ErrorLog /var/log/apache2/error_log
TransferLog /var/log/apache2/access_log
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLCertificateFile /etc/apache2/crt/site.crt
SSLCertificateKeyFile /etc/apache2/key/my.key
SSLCACertificateFile /etc/apache2/ca.txt
SSLCertificateChainFile /etc/apache2/ca.txt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/srv/www/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /var/log/apache2/ssl_request_log ssl_combined
</VirtualHost>
</IfDefine>
</IfDefine>现在问题: Apache甚至没有启用端口443。
我已经做过的事情:在"listen.conf“中的”List80“之后直接添加”List443“到下一行。在本例中,服务器监听端口443,但在Chrome中给出了错误:"ERR_SSL_PROTOCOL_ERROR”。
我不太清楚我是怎么配置错的。
发布于 2016-02-10 14:30:49
还需要将SSL标志添加到/etc/sysconfig/apache2中的APACHE_SERVER_FLAGS中。
# Notably, to enable ssl support, 'SSL' needs to be added here.
# To enable the server-status, 'STATUS' needs to be added here.
#
# It does not matter if you write flag1, -D flag1 or -Dflag1.
# Multiple flags can be given as "-D flag1 -D flag2" or simply "flag1 flag2".
#
# Specifying such flags here is equivalent to giving them on the commandline.
# (e.g. via rcapache2 start -DReverseProxy)
#
# Example:
# "SSL STATUS AWSTATS SVN_VIEWCVS no_subversion_today"
#
APACHE_SERVER_FLAGS="SSL"https://unix.stackexchange.com/questions/250563
复制相似问题