首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Apache2 13.1上为OpenSuSE配置SSL

如何在Apache2 13.1上为OpenSuSE配置SSL
EN

Unix & Linux用户
提问于 2015-12-20 17:52:45
回答 1查看 9.8K关注 0票数 5

我在虚拟主机服务器上安装了OpenSuSE,运行多个虚拟网站。在普通的http上一切都很好。除了http之外,我现在还想在https上运行我的一个虚拟站点。因此,我购买了SSL证书。我已将我的证书文件复制到服务器:

代码语言:javascript
复制
SSLCertificateFile    /etc/apache2/crt/site.crt
SSLCertificateKeyFile /etc/apache2/key/my.key
SSLCACertificateFile  /etc/apache2/ca.txt

我在文件"/etc/sysconfig/apache2“中启用了Apache Modules中的SSL

代码语言:javascript
复制
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说:

代码语言:javascript
复制
Listen 80
<IfDefine SSL>
    <IfDefine !NOSSL>
        <IfModule mod_ssl.c>
            Listen 443
        </IfModule>
    </IfDefine>
</IfDefine>

我的vhost配置文件说:

代码语言:javascript
复制
<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”。

我不太清楚我是怎么配置错的。

EN

回答 1

Unix & Linux用户

发布于 2016-02-10 14:30:49

还需要将SSL标志添加到/etc/sysconfig/apache2中的APACHE_SERVER_FLAGS中。

代码语言:javascript
复制
# 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"
票数 10
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/250563

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档