Apache支持ssl

1、检测是否安装ssl模块,如果没有就安装

[root@localhost cgi-bin]# rpm -qa | grep mod_ssl           //查看是否安装ssl模块

[root@localhost cgi-bin]# yum install -y mod_ssl           //安装ssl

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 ~]# gedit /etc/httpd/conf.d/ssl.conf

# 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.  

LoadModule ssl_module modules/mod_ssl.so           //开启ssl功能

# When we also provide SSL we have to listen to the 

# the HTTPS port in addition.

Listen 443       //监听的端口

3、修改防火墙配置,开启对上面端口443的支持

1)在终端输入命令“setup”,在弹出的框中选择“防火墙”,接着选择“定制”

2)使用空格键选中”https“,接着选择“转发”

3)选择“添加“

4)添加端口443,协议tcp,然后确定

5)回到最初的界面,“确定”

6)重启防火墙

[root@localhost ~]# service iptables restart

iptables:将链设置为政策 ACCEPTfilter nat                [确定]

iptables:清除防火墙规则:                                 [确定]

iptables:正在卸载模块:                                   [确定]

iptables:应用防火墙规则:                                 [确定]

[root@localhost ~]#

7)重启apache

[root@localhost ~]# service httpd restart

停止 httpd                                              [确定]

正在启动 httpdhttpd: 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“ ,看到如下结果

2)选择“我已充分了解”,弹出如下对话框,选择“确认安全例外”就可以正常访问

做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用
链接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密码:n7bk

Linux服务器---apache支持SSL的更多相关文章

  1. Linux服务器---apache支持cgi

    Apache支持cgi  1.打开Apache配置文件httpd.conf,搜索“cgi”,找到下面的一段,去掉“addhandler”前面的“#“,这样就开启了Apache的cgi功能 [root@ ...

  2. linux 服务器所支持的最大句柄数调高数倍(与服务器的内存数量相关)

    https://github.com/alibaba/p3c/blob/master/阿里巴巴Java开发手册(详尽版).pdf 2. [推荐]调大服务器所支持的最大文件句柄数(File Descri ...

  3. linux下apache安装ssl步骤

    制作证书: 参考:linux下运用opensll制作ssl证书 生成三个证书 server.crt .server-ca.crt.server.key 安装openssl tar -xzvf open ...

  4. Linux下Apache配置SSL支持https

    参考:http://www.thinksaas.cn/group/topic/280017/ 生成证书过程如下 Step :生成服务器密钥: mkdir -p /etc/pki/test cd /et ...

  5. ubuntu16.04服务器apache的ssl证书配置

    背景:在腾讯云申请的免费证书1年,服务器ubuntu 16.04版本,我的是多域名 1.ssl模块的安装 sudo a2enmod ssl //开启apache ssl模块 a2ensite defa ...

  6. Linux让Apache支持中文URL图片/文件名

    需要用到iconv_hook和mod_encoding Apache(32位): 安装环境:CentOS 5.6 + Apache 2.2.15 (Apache2.4同样适用) 安装结果:安装后支持“ ...

  7. centos linux服务器apache+mysql环境访问慢优化方法

    查找软件安装目录:find / -name 软件名称 一.优化apache配置增加MaxClients的值 默认情况下,2.0及以上apache版本MaxClients的值为256,对于中大型应用访问 ...

  8. Linux服务器---apache配置文件

    Apache配置文件 Apache的配置文件默认路径是“/etc/httpd/conf/httpd.conf”,编辑该文件就可以修改Apache的配置 1.设置网页主目录,参数DocumentRoot ...

  9. linux服务器apache 一个IP,一个端口,建立多个网站的方法。

    找到apache-tomcat-6.0.14\conf\server.xml ,再services 后面添加此段代码: Xml代码 <!-- 此处  新增的项目配置-->  <Ser ...

随机推荐

  1. mysql if判断

    select if(SUBSTR('06622200556',1,2)='06',0,1) from t_member_product_adb limit 2 输出结果为:0,0

  2. Django---简单模板遍历渲染

    简单路由: urlpatterns = [ path('admin/', admin.site.urls), path('index/', views.index), path('list/', vi ...

  3. DLRS(近三年深度学习应用于推荐系统论文汇总)

    Recommender Systems with Deep Learning Improving Scalability of Personalized Recommendation Systems ...

  4. 在 CSS 中,width 和 height 指的是内容区域的宽度和高度

    增加内边距.边框和外边距不会影响内容区域的尺寸,但是会增加元素框的总尺寸. 改变宽度就可以,去掉

  5. eclipse+gnuarm+使用报错

    Description Resource Path Location TypeProgram "echo" not found in PATH stm32 Project Prop ...

  6. Win10 下 RabbitMQ 的 安装 配置

    记录下本人在win10环境下安装RabbitMQ的步骤,以作备忘. 第一步:下载并安装erlang 原因:RabbitMQ服务端代码是使用并发式语言Erlang编写的,安装Rabbit MQ的前提是安 ...

  7. Java applets A Java applet example

    https://en.wikipedia.org/wiki/Ajax_(programming) https://zh.wikipedia.org/wiki/AJAX Ajax (also AJAX; ...

  8. inaccessible

    $w = (object)array('key0'=>'a','key1'=>'b',0,1,2,0=>'0w',1=>'1w','11'=>'11str'); var_ ...

  9. HTML标签_head标签

    HTML标签分为两种,自闭合标签和主动闭合标签:没有另一半 自动闭合标签,有另一半叫主动闭合标签. 自动闭合标签,只有开头没有结尾,即没有另一半:如<meta charset="UTF ...

  10. 建立一个更高级别的查询 API:正确使用Django ORM 的方式(转)

    add by zhj: 本文作者是DabApps公司的技术主管,作者认为在view中直接使用Django提供的ORM查询方法是不好的,我对此并不赞同,可能作者 写这篇文章是给Django的初学者看,所 ...