标签:root name 重写 options image for min com ide
1》验站
如下截图,验站就是在DNS域名商哪里,在对应host下面,添加一个TXT记录类型,主机记录,记录值后,检测即可。
2》SSL证书申请
阿里云,腾讯云有很多免费证书申请,免费的缺点是只能绑一个域名和一年使用时间,以下截图是阿里云免费
3》在云服务器控制台打开实例443入口规则
4>centos服务器配置iptables规则
这里要说明下,如果是纯净Centos系统,iptables规则默认转发都是打开的。如果是安装了管理系统,比如宝塔,wd,这种不会搞。
5>apache安装mod_ssl模块
如果是yum安装,直接yum -y install mod_ssl即可。源码安装的查找网上教程。在安装了mod_ssl模块后,在/etc/httpd/conf.d会生成ssl.conf文件
6>编辑ssl.conf
什么也没改,就更改以下:将公钥,私钥,授权链钥配置即可
## ## SSL Virtual Host Context ## <VirtualHost _default_:443> # General setup for the virtual host, inherited from global configuration #DocumentRoot "/var/www/html" #ServerName www.example.com:443 SSLCertificateFile /etc/httpd/cert/a_public.crt SSLCertificateKeyFile /etc/httpd/cert/a.com.key SSLCertificateChainFile /etc/httpd/cert/a_chain.crt </VirtualHost>
7>编辑vhost.conf虚拟文件
配置443虚拟站点,将80站点请求重写到443即可
<VirtualHost *:80> #ServerName 13x.17x.17x.3x ServerName app.qmdaib.com #Serveradmin XXXX@qq.com RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/?(.*)$ https://%{SERVER_NAME}/$1 [L,R=301] DocumentRoot /var/www/html/xxx/ <Directory "/var/www/html/xxx/"> Options FollowSymLinks AllowOverride All #Require all denied Require all granted </Directory> #ErrorLog ${APACHE_LOG_DIR}/error.log #CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> NameVirtualHost *:443 <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/httpd/cert/a_public.crt SSLCertificateKeyFile /etc/httpd/cert/a.com.key ServerName app.qmdaib.com #Serveradmin XXXX@qq.com DocumentRoot /var/www/html/xxx/ <Directory "/var/www/html/xxx/"> Options FollowSymLinks AllowOverride All #Require all denied Require all granted </Directory> #ErrorLog ${APACHE_LOG_DIR}/error.log #CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
最后重启服务器即可
标签:root name 重写 options image for min com ide
原文地址:https://www.cnblogs.com/huhu1020387597/p/11251621.html