标签:
参考:
安装:
yum install -y openssl #使用openssl可手动创建证书 yum install -y httpd yum install -y mod_ssl
#防火墙打开80、443端口,然后重启 firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=443/tcp --permanent firewall-cmd --reload
#Apache开启
systemctl enable httpd systemctl start httpd
强制HTTP-->HTTPS:
vim /etc/httpd/conf/httpd.conf
#HTTP --> HTTPS
RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ #另一种写法:RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] #301表示永久移走
标签:
原文地址:http://www.cnblogs.com/flowjacky/p/4313440.html