配置OpenResty支持SSL(不受信任的证书)
2023-09-27 14:28:13 时间
#关闭防火墙 chkconfig iptables off service iptables stop #关闭SELINUX sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config setenforce 0 #上传openresty_auto_install到 /usr/local/software mkdir /usr/local/software cd /usr/local/software/openresty_auto_install #更新包 yum update -y yum install -y ghostscript unzip wget gcc gcc-c++ cmake make gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake perl bison ntpdate readline-devel pcre-devel openssl-devel tcl perl make g++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel #调对时钟 ntpdate stdtime.gov.hk ntpdate cn.pool.ntp.org tar zxvf ngx_openresty-1.7.7.1.tar.gz cd ngx_openresty-1.7.7.1 ./configure --prefix=/usr/local/openresty --with-http_stub_status_module --with-http_gzip_static_module --with-luajit --with-http_ssl_module make && make install \cp /usr/local/software/openresty_auto_install/nginx /etc/rc.d/init.d/nginx chmod 777 /etc/rc.d/init.d/nginx chkconfig nginx on #配置conf vi /usr/local/openresty/nginx/conf/nginx.conf server { listen 443; ssl on; ssl_certificate /usr/local/openresty/nginx/conf/server.crt; ssl_certificate_key /usr/local/openresty/nginx/conf/server_nopwd.key; } #cd到目录 cd /usr/local/openresty/nginx/conf cd到目录 #cd /usr/local/nginx/conf 创建服务器私钥 openssl genrsa -des3 -out server.key 1024 签名请求的证书 openssl req -new -key server.key -out server.csr 注意此步骤过程中需要填写一系列的东西(公司名称、所在地等按照实际情况填) 尤其注意 your server' hostname的填写,如果没有域名就直接填ip,如果有域名就填域名(都不需要端口号) 例如: 直接填ip: 61.155.86.78 域名: api.trewanyg.com 模糊域名: * .trewanyg.com 制作解密后的私钥 openssl rsa -in server.key -out server_nopwd.key openssl x509 -req -days 3650 -in server.csr -signkey server_nopwd.key -out server.crt 拷贝证书文件 cp /usr/local/openresty/nginx/conf/server.crt /usr/local/openresty/nginx/html/ 进入nginx的sbin目录,启动nginx service nginx restart 进入nginx主页查看 https://10.10.6.213
http://www.cnblogs.com/yun007/p/3739182.html
相关文章
- Confluence 6 为 Active Directory 配置一个 SSL 连接
- Nginx 安装 SSL 配置 HTTPS 超详细完整全过程
- jenkins 邮件配置一
- springboot-day6-多环境文件配置的切换配置
- mac下host配置 + mac修改了环境变量却不生效:zsh: command not found: xxx
- spring cloud Alibaba nacos 整合Neo4j配置
- nginx安装配置: configure命令
- goDaddy SSL证书 Nginx配置全流程 (转)
- IDEA之google style配置(IDEA)
- Intellij Idea常用配置设置
- Centosserver下安装配置SSL
- nginx配置ssl双向验证 nginx https ssl证书配置
- nginx配置ssl证书
- 创建SSL证书,配置IPython notebook服务器
- centos7服务器,配置ssl,域名解析,域名备案
- 在服务器上正确配置域名https证书(ssl)及为什么不推荐使用宝塔申请免费ssl证书
- Nginx 配置指令的执行顺序(二)
- AMH面板利用SSL扩展给站点配置SSL域名证书方法
- Tomcat配置SSL
- web.config配置详细说明