溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Linux服務(wù)器中如何配置apache支持ssl

發(fā)布時間:2021-11-05 16:34:14 來源:億速云 閱讀:243 作者:柒染 欄目:建站服務(wù)器

Linux服務(wù)器中如何配置apache支持ssl,相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

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,設(shè)置監(jiān)聽端口 

[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       //監(jiān)聽的端口

3、修改防火墻配置,開啟對上面端口443的支持

      1)在終端輸入命令“setup”,在彈出的框中選擇“防火墻”,接著選擇“定制”

      Linux服務(wù)器中如何配置apache支持ssl

      2)使用空格鍵選中”https“,接著選擇“轉(zhuǎn)發(fā)”

      Linux服務(wù)器中如何配置apache支持ssl

     3)選擇“添加“

      Linux服務(wù)器中如何配置apache支持ssl

     4)添加端口443,協(xié)議tcp,然后確定

      Linux服務(wù)器中如何配置apache支持ssl

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

      Linux服務(wù)器中如何配置apache支持ssl

6)重啟防火墻

[root@localhost ~]# service iptables restart

iptables:將鏈設(shè)置為政策 ACCEPTfilter nat                [確定]

iptables:清除防火墻規(guī)則:                                 [確定]

iptables:正在卸載模塊:                                   [確定]

iptables:應(yīng)用防火墻規(guī)則:                                 [確定]

[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“ ,看到如下結(jié)果

      Linux服務(wù)器中如何配置apache支持ssl

     2)選擇“我已充分了解”,彈出如下對話框,選擇“確認(rèn)安全例外”就可以正常訪問

      Linux服務(wù)器中如何配置apache支持ssl

 做了一個Linux學(xué)習(xí)的平臺,目前出來一個雛形,各位可以參考使用
鏈接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密碼:n7bk

Linux服務(wù)器中如何配置apache支持ssl

看完上述內(nèi)容,你們掌握Linux服務(wù)器中如何配置apache支持ssl的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI