相关链接:
在CentOS 7 1804 中 安装 Apache HTTP Server 并 配置 阿里云 SSL
在CentOS 1804 中的 Tomcat 9 设置 SSL( https ) 加密 (多域名加密,阿里云 SSL+ 腾讯云 SSL)
在CentOS 1804 中设置 Apache Tomcat 9.0.12 开机自启
- 安装httpd:
[root@CentOS-x86-64-DVD-1804-Desktop ~]# yum -y install httpd
- 启动httpd:
查看是否启动:[root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl start httpd.service
[root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl status httpd.service
- 设置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
- 查看防火墙是否开启:
开启防火墙:[root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl status firewalld
[root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl start firewalld
- 查看防火墙是否开机自启:
开启防火墙的开机自启:[root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl list-unit-files |grep firewalld
[root@CentOS-x86-64-DVD-1804-Desktop ~]# systemctl enable firewalld.service
- 查看80/443端口是否开放:
开启80/443端口(需要重启防火墙):[root@CentOS-x86-64-DVD-1804-Desktop ~]# firewall-cmd --list-ports
重启防火墙:[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
- 访问httpd:
- 安装mod_ssl:
[root@CentOS-x86-64-DVD-1804-Desktop cert]# yum -y install mod_ssl
- 安装openssl:
[root@CentOS-x86-64-DVD-1804-Desktop cert]# yum -y install openssl
- 上传证书:
- 修改ssl配置文件:
内容如下(指向ssl证书):[root@CentOS-x86-64-DVD-1804-Desktop conf.d]# vim /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/httpd/cert/2_https.wimcn.cn.crt SSLCertificateKeyFile /etc/httpd/cert/3_https.wimcn.cn.key SSLCACertificateFile /etc/httpd/cert/1_root_bundle.crt
- 重启httpd:
[root@CentOS-x86-64-DVD-1804-Desktop conf.d]# systemctl restart httpd.service
- 访问httpd:
相关链接:
在CentOS 7 1804 中 安装 Apache HTTP Server 并 配置 阿里云 SSL
在CentOS 1804 中的 Tomcat 9 设置 SSL( https ) 加密 (多域名加密,阿里云 SSL+ 腾讯云 SSL)