[b]Apache支持ssl[/b]
1、检测是否安装ssl模块,如果没有就安装
[root@localhost cgi-bin]#[b] rpm -qa | grep mod_ssl //查看是否安装ssl模块[/b]
[root@localhost cgi-bin]#[b] yum install -y mod_ssl //安装ssl[/b]
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Complete!
[root@localhost cgi-bin]#
2、修改ssl的配置文件“/etc/httpd/conf.d/ssl.conf”如下,开启ssl,设置监听端口
[root@localhost ~]# [b]gedit /etc/httpd/conf.d/ssl.conf[/b]
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
[b]LoadModule ssl_module modules/mod_ssl.so //开启ssl功能[/b]
# When we also provide SSL we have to listen to the
# the HTTPS port in addition.
[b] Listen 443 //监听的端口[/b]
3、修改防火墙配置,开启对上面端口443的支持
1)在终端输入命令“setup”,在弹出的框中选择“防火墙”,接着选择“定制”
![163627jd5gki9tbcu0uk6v.png](https://i-blog.csdnimg.cn/blog_migrate/3177b15d2daa2657d1972d46d6db12a5.png)
2)使用空格键选中”https“,接着选择“转发”
![163634eom5bg7gmckkg9mc.png](https://i-blog.csdnimg.cn/blog_migrate/0a30ef257fd601d2d7573a2dc6e966d4.png)
3)选择“添加“
![163635oogh323ei1we8k8j.png](https://i-blog.csdnimg.cn/blog_migrate/c5695be51ea1964119c968fa2d6f8788.png)
4)添加端口443,协议tcp,然后确定
![163635tfyafcfktxcupyf7.png](https://i-blog.csdnimg.cn/blog_migrate/8b6a2d421b82bae7204414f1315551a2.png)
5)回到最初的界面,“确定”
![163636j71o1w720xmmt6o7.png](https://i-blog.csdnimg.cn/blog_migrate/a701511015575c6e2ab61336f3cbced8.png)
6)重启防火墙
[root@localhost ~]# service iptables restart
iptables:将链设置为政策 ACCEPT:filter nat [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
iptables:应用防火墙规则: [确定]
[root@localhost ~]#
7)重启apache
[root@localhost ~]# service httpd restart
停止 httpd: [确定]
正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[确定]
[root@localhost ~]#
4、测试