windows server Apache 证书部署/httpd-ssl.conf 文件怎么修改?

  • 回答 (4)
  • 关注 (0)
  • 查看 (129)
用户1625814用户1625814提问于
人生的旅途辣鸡前端回答于

登入到windows server ,打开conf/httpd.conf配置文件

找到#LoadModule ssl_module modules/mod_ssl.so#Include conf/extra/httpd-ssl.conf,去掉前面的#号注释;

然后编辑Apache根目录下 conf/extra/httpd-ssl.conf 文件,修改如下内容

<VirtualHost 0.0.0.0:443>
    DocumentRoot "/var/www/html"
    ServerName www.domain.com
    SSLEngine on
    SSLCertificateFile /usr/local/apache/conf/2_www.domain.com_cert.crt
    SSLCertificateKeyFile /usr/local/apache/conf/3_www.domain.com.key
    SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
</VirtualHost>

配置完成后,重新启动 Apache 就可以使用https://www.domain.com来访问了。

Dust资深服务器虚拟化工程师。回答于

可以使用winscp连接到服务器后,打开httpd-ssl.conf 文件,修改内容参考以下:

<VirtualHost 0.0.0.0:443>
    DocumentRoot "/var/www/html"
    ServerName www.domain.com
    SSLEngine on
    SSLCertificateFile /usr/local/apache/conf/2_www.domain.com_cert.crt
    SSLCertificateKeyFile /usr/local/apache/conf/3_www.domain.com.key
    SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
</VirtualHost>
嗨喽你好摩羯座回答于

可以使用linux里面的vim编辑器进行修改,在windows下可以使用winscp进行修改。linux下:

切换到/httpd-ssl.conf 目录下,输入vim httpd-ssl.conf,然后按下i键,即可编辑

内容参考:

<VirtualHost 0.0.0.0:443>
    DocumentRoot "/var/www/html"
    ServerName www.domain.com
    SSLEngine on
    SSLCertificateFile /usr/local/apache/conf/2_www.domain.com_cert.crt
    SSLCertificateKeyFile /usr/local/apache/conf/3_www.domain.com.key
    SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
</VirtualHost>

修改完成后,按esc,按shift+:,然后输入wq,即可修改成功。

心愿回答于
<VirtualHost 0.0.0.0:443>
    DocumentRoot "/var/www/html"
    ServerName www.domain.com
    SSLEngine on
    SSLCertificateFile /usr/local/apache/conf/2_www.domain.com_cert.crt
    SSLCertificateKeyFile /usr/local/apache/conf/3_www.domain.com.key
    SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
</VirtualHost>

参考

扫码关注云+社区

领取腾讯云代金券