如何在Ubuntu中的Apache服务器中安装SSL证书 [英] How to install SSL certificate in apache server in ubuntu
本文介绍了如何在Ubuntu中的Apache服务器中安装SSL证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想输入 https://localhost 之类的本地主机,我需要使用ssl进行此操作.如何在Ubuntu的Apache服务器中安装SSL证书?
I want enter localhost like a https://localhost, I need to do this with ssl. How to install SSL certificate in apache server in ubuntu?
预先感谢
推荐答案
您必须将证书添加到VirtualHost
部分的httpd.conf
文件中,并将端口更改为433.最小配置如下所示:
You have to add your certificate to your httpd.conf
file in the VirtualHost
section and change the port to 433. A Minimal config looks like this:
LoadModule ssl_module modules/mod_ssl.so
Listen 443
<VirtualHost *:443>
# maybe additional config here
ServerName www.example.com
SSLEngine on
SSLCertificateFile "/path/to/www.example.com.cert"
SSLCertificateKeyFile "/path/to/www.example.com.key"
</VirtualHost>
httpd.conf
应该位于/etc/httpd
,/etc/apache/
或类似名称中.
The httpd.conf
should be in /etc/httpd
, /etc/apache/
or similar.
此后重新启动服务器.
有关 Apache服务器SSL 的详细信息.
这篇关于如何在Ubuntu中的Apache服务器中安装SSL证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文