centos下使用nginx搭建https服务器
来源:互联网 发布:美国华人医师网络医院 编辑:程序博客网 时间:2024/05/22 04:51
centos下安装nginx (注:如果nginx成功启动后还是不能访问查看一下防火墙策略)
安装编译环境
yum -y install gcc gcc-c++ autoconf automake
安装依赖包
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
下载nginx源码
http://nginx.org/en/download.html
解压nginx
tar zxvf nginx-版本号.tar.gz
cd到目录
cd nginx-版本号
生成make文件
./configure --with-http_ssl_module
编译
make
安装
make install
配置conf
server {
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key;
}
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/nginx/conf/server.crt /usr/local/nginx/html/
进入nginx的sbin目录,启动nginx
# cd /usr/locacl/nginx/sbin
# nohup ./nginx &
进入nginx主页查看
https://61.155.86.78:443
1 0
- centos下使用nginx搭建https服务器
- centos下使用nginx搭建https服务器
- centos使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用nginx搭建https服务器
- 使用 Nginx 搭建 HTTPS 服务器
- 【Nginx】使用nginx搭建https服务器
- MAC下 nginx搭建https服务器
- MAC下 nginx搭建https服务器
- MAC下 nginx搭建https服务器
- Centos Nginx搭建https
- centos下使用nginx部署https
- android应用设备兼容性
- NLP自然语言处理系列——LDA主题词模型探析
- Oracle存储过程基本语法介绍
- mac 远程连接 windows
- NYoj171聪明的kk(动态规划)
- centos下使用nginx搭建https服务器
- XML 文件读写 自己
- quartz
- Gson使用
- camera中设置界面初探
- linux下bluetooth编程(一)基础概念
- 实习整理(十四)
- zTree动态添加节点
- 字符串和编码