vhosts-ssl conf文件设置为端口443时,apache无法启动

时间:2019-01-06 08:43:53

标签: apache ssl centos7 virtualhost

我有一个小型的VPS服务器,它使用cwp运行centos7。我一直在收到此ssl协议错误,我试图删除letsencrypt ssl证书并安装新证书。完成后,我重新启动了apache服务器,但失败了,但我尝试了所有操作,但除我更改/usr/local/apache/conf.d/vhosts-ssl.conf

之外,其他方法均无作用
# vhost_start example.com
<VirtualHost 000.00.000.00:80>
    ServerName example.com
    ServerAlias www.example.com
    ServerAdmin webmaster@example.com
    DocumentRoot /home/example/public_html
    UseCanonicalName Off
    ScriptAlias /cgi-bin/ /home/example/public_html/cgi-bin/

    # Custom settings are loaded below this line (if any exist)
    # Include "/usr/local/apache/conf/userdata/example/example.com/*.conf"

    SSLEngine on
    SSLCipherSuite ALL:!ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
    SSLProtocol All -SSLv2 -SSLv3
    SSLCertificateFile /etc/pki/tls/certs/example.com.cert
    SSLCertificateKeyFile /etc/pki/tls/private/example.com.key
    SSLCertificateChainFile /etc/pki/tls/certs/example.com.bundle
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

    <IfModule mod_userdir.c>
        UserDir disabled
        UserDir enabled example
    </IfModule>

    <IfModule mod_suexec.c>
        SuexecUserGroup example example
    </IfModule>

    <IfModule mod_suphp.c>
        suPHP_UserGroup example example
        suPHP_ConfigPath /home/example
    </IfModule>

    <Directory "/home/example/public_html">
        AllowOverride All
    </Directory>

</VirtualHost>
# vhost_end example.com

并在上方替换为

# vhost_start example.com
<VirtualHost 000.00.000.00:443>
    ServerName example.com
    ServerAlias www.example.com
    ServerAdmin webmaster@example.com
    DocumentRoot /home/example/public_html
    UseCanonicalName Off
    ScriptAlias /cgi-bin/ /home/example/public_html/cgi-bin/

    # Custom settings are loaded below this line (if any exist)
    # Include "/usr/local/apache/conf/userdata/example/example.com/*.conf"

    <IfModule mod_userdir.c>
        UserDir disabled
        UserDir enabled example
    </IfModule>

    <IfModule mod_suexec.c>
        SuexecUserGroup example example
    </IfModule>

    <IfModule mod_suphp.c>
        suPHP_UserGroup example example
        suPHP_ConfigPath /home/example
    </IfModule>

    <Directory "/home/example/public_html">
        AllowOverride All
    </Directory>

</VirtualHost>
# vhost_end example.com

一旦执行此操作,我的apache就可以启动,并且我的网站仍然显示安全。现在我的问题是这是正确的方法,还是第一个VirtualHost文件没有错误?请谁能帮助我解决如何解决我的问题,而不必先配置VirtualHost即可。

0 个答案:

没有答案