在CentOS 7 1804 中 安裝 Apache HTTP Server 並 配置 阿里雲 SSL

相關鏈接:

在CentOS 7 1804 中 安裝 Apache HTTP Server 並 配置 騰訊雲 SSL

在CentOS 1804 中的 Tomcat 9 設置 SSL( https ) 加密 (多域名加密,阿里雲 SSL+ 騰訊雲 SSL)

在CentOS 1804 中設置 Apache Tomcat 9.0.12 開機自啓

在tomcat中設置http自動跳轉https


  1. 安裝httpd:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# yum -y install httpd
    
  2. 啓動httpd:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl start httpd.service
    查看是否啓動:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl status httpd.service
  3. 設置httpd開機自啓:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl enable httpd.service 
    查看是否設置了開機自啓:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl list-unit-files |grep httpd.service
  4. 查看防火牆是否開啓:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl status firewalld
    開啓防火牆:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl start firewalld
  5. 查看防火牆是否開機自啓:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl list-unit-files |grep firewalld
    開啓防火牆的開機自啓:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl enable firewalld.service
  6. 查看80/443端口是否開放:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# firewall-cmd --list-ports
    開啓80/443端口(需要重啓防火牆):
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# firewall-cmd --zone=public --add-port=443/tcp --permanent
    重啓防火牆:
    [root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl restart firewalld.service
  7. 訪問httpd:

     
  8. 安裝mod_ssl:
    [root@CentOS-x86-64-DVD-1804-Desktop cert]# yum -y install mod_ssl
  9. 安裝openssl:
    [root@CentOS-x86-64-DVD-1804-Desktop cert]# yum -y install openssl
  10. 上傳證書:
  11. 修改ssl配置文件:
    [root@CentOS-x86-64-DVD-1804-Desktop conf.d]# vim /etc/httpd/conf.d/ssl.conf
    內容如下(指向ssl證書):
    SSLCertificateFile /etc/httpd/cert/public.pem
    SSLCertificateKeyFile /etc/httpd/cert/214951881520647.key
    SSLCertificateChainFile /etc/httpd/cert/chain.pem
  12. 重啓httpd:
    [root@CentOS-x86-64-DVD-1804-Desktop conf.d]# systemctl restart httpd.service
  13. 訪問httpd:

 


相關鏈接:

在CentOS 7 1804 中 安裝 Apache HTTP Server 並 配置 騰訊雲 SSL

在CentOS 1804 中的 Tomcat 9 設置 SSL( https ) 加密 (多域名加密,阿里雲 SSL+ 騰訊雲 SSL)

在CentOS 1804 中設置 Apache Tomcat 9.0.12 開機自啓

在tomcat中設置http自動跳轉https

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章