今天下午研究下证书安装
分别在apache下和nginx下分别配置了证书
记录下,希望对安装证书的童鞋有帮助作用
apache
申请DV证书,填写完申请材料后,做了个域名TXT的指向,还很快就收到的证书的邮件。分三个部分,我认为三个部分,一个是
第一步,开启服务器防火墙的443端口
接下来开始配置
httpd.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
开启,去掉前面的#
httpd-ssl.conf
<VirtualHost _default_:443>
# General setup for the virtual host
DocumentRoot "/alidata/www/huaqimedia"
ServerName huaqimedia.com:443
SSLCertificateFile "/alidata/www/huaqimedia/ssl/huaqimedia.crt"
SSLCertificateKeyFile "/alidata/www/huaqimedia/ssl/huaqimedia.key"
SSLCertificateChainFile "/alidata/www/huaqimedia/ssl/ca.crt"
保存好,重启apache
service httpd restart
完毕
用https://访问即可
nginx
申请完毕后
配置
server {
???listen 443;
???server_name ?car.huaqimedia.com;
???access_log /alidata/log/nginx/access/car.huaqimedia.com.log;
???error_log /alidata/log/nginx/access/car.huaqimedia.com.error.log;
???ssl on;
???root html;
???index index.html index.htm;
???ssl_certificate ??/路径/cert/214596358230204.pem;
???ssl_certificate_key ?/路径/cert/214596358230204.key;
???ssl_session_timeout 5m;
???ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
???ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
???ssl_prefer_server_ciphers on;
???location / {
???????root ??/alidata/www/car.huaqimedia.com/;
???????index ?index.html index.htm index.php;
???}
if ( !-e $request_filename ) {
????????rewrite ^(.*)\.php(.*)$ $1.php?s=$2 last;
????????break;
???}
???location ~ \.php$ {
???????root ??????????html;
???????fastcgi_pass ??127.0.0.1:9000;
???????fastcgi_index ?index.php;
???????fastcgi_param ?SCRIPT_FILENAME ?/alidata/www/car.huaqimedia.com/$fastcgi_script_name;
???????include ???????fastcgi_params;
???}
}
重启service nginx restart
完成
关于apache下和nginx下安装证书的笔记
原文地址:https://www.cnblogs.com/lfzjky/p/8836275.html