Linux服务器---apache支持ssl

简介: [b]Apache支持ssl[/b] 1、检测是否安装ssl模块,如果没有就安装       [root@localhost cgi-bin]#[b] rpm -qa | grep mod_ssl           //查看是否安装ssl模块[/b]       [root@localhost .
[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
      2)使用空格键选中”https“,接着选择“转发”
       163634eom5bg7gmckkg9mc.png
     3)选择“添加“
       163635oogh323ei1we8k8j.png
     4)添加端口443,协议tcp,然后确定
       163635tfyafcfktxcupyf7.png
     5)回到最初的界面,“确定”
       163636j71o1w720xmmt6o7.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、测试
   1)在浏览器输入https://127.0.0.1,注意必须是“https“ ,看到如下结果
       163637lal3k0zo13bau9b0.png
     2)选择“我已充分了解”,弹出如下对话框,选择“确认安全例外”就可以正常访问
       163637ff2mlhgemlwz67me.png
      

相关文章
|
10天前
|
网络安全 Apache
Apache服务器安装SSL证书
Apache服务器安装SSL证书
14 0
|
10天前
|
Java Linux
Springboot 解决linux服务器下获取不到项目Resources下资源
Springboot 解决linux服务器下获取不到项目Resources下资源
|
13天前
|
Linux
linux下搭建tftp服务器教程
在Linux中搭建TFTP服务器,需安装`tftp-server`(如`tftpd-hpa`)。步骤包括:更新软件包列表,安装`tftpd-hpa`,启动并设置开机自启,配置服务器(编辑`/etc/default/tftpd-hpa`),添加选项,然后重启服务。完成后,可用`tftp`命令进行文件传输。例如,从IP`192.168.1.100`下载`file.txt`: ``` tftp 192.168.1.100 <<EOF binary put file.txt quit EOF ```
28 4
|
28天前
|
Linux Shell 网络安全
【Shell 命令集合 网络通讯 】Linux 与SMB服务器进行交互 smbclient命令 使用指南
【Shell 命令集合 网络通讯 】Linux 与SMB服务器进行交互 smbclient命令 使用指南
40 1
|
6天前
|
Linux 数据安全/隐私保护
Linux基础与服务器架构综合小实践
【4月更文挑战第9天】Linux基础与服务器架构综合小实践
1192 6
|
18天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器
|
18天前
|
Linux
Linux安装bind9搭建自己的域名服务器
Linux安装bind9搭建自己的域名服务器
11 0
|
21天前
|
网络协议 Linux 网络安全
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
17 0
|
28天前
|
网络协议 安全 Shell
【Shell 命令集合 系统设置 】Linux 从远程时间服务器获取当前日期和时间 rdate命令 使用指南
【Shell 命令集合 系统设置 】Linux 从远程时间服务器获取当前日期和时间 rdate命令 使用指南
33 0
|
28天前
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
29 0

热门文章

最新文章