分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 前端开发

关于apache下和nginx下安装证书的笔记

发布时间:2023-09-06 01:49责任编辑:蔡小小关键词:apachenginx

今天下午研究下证书安装

分别在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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved