码迷,mamicode.com
首页 > 其他好文 > 详细

域名阿里云免费ssl证书配置安装

时间:2018-12-06 14:31:59      阅读:1491      评论:0      收藏:0      [点我收藏+]

标签:proc   example   data   cer   director   directory   ica   thinkphp   this   

去阿里云盾申请 成功后下载 有三个文件******.com_public.crt ******.com.key *******.com_chain.crt

Apache安装配置SSL证书方法教程(普通版)

https://www .wosign.com/support/ssl-Apache1.htm


把正书放在了/usr/local/apache/conf/ssl 里面(自己创建的ssl)

修改了/usr/local/apache/conf/extra下面的httpd-vhosts.conf

<VirtualHost *:443>
ServerAdmin webmaster@example.com
#php_admin_value open_basedir "/home/wwwroot/xthinkphp:/tmp/:/var/tmp/:/proc/"
DocumentRoot /home/wwwroot/xthinkphp
ServerName x.acg170.com
SSLEngine On
SSLOptions +StrictRequire
SSLCertificateFile /usr/local/apache/conf/ssl/******.com_public.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl/******.com.key
SSLCertificateChainFile /usr/local/apache/conf/ssl/*******.com_chain.crt
<Directory "/home/wwwroot/xthinkphp">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
</Directory>
</VirtualHost>

#路径(/home/wwwroot/xthinkphp)一定要写对 我报了You don‘t have permission to access /getdata/wx_data/p/1 on this server.
Apache Server at x.acg170.com Port 443

找了半天在https://blog.csdn.net/tianlianchao1982/article/details/6161308收到启发路径错了然后就ok了

修改项目中.htaccess文件

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.* https://%{SERVER_NAME}%{REQUEST_UR} [L,R]
</IfModule>

域名阿里云免费ssl证书配置安装

标签:proc   example   data   cer   director   directory   ica   thinkphp   this   

原文地址:https://www.cnblogs.com/yang1022/p/10076043.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!