目录
整体的操作流程
二、然后配置网络yum源 并mv CentOS-* backup挪动到上层目录中
四、添加两种编译模块./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module
五、 显示少什么就 yum install (缺少的依赖的名称)-devel
下图为安装完成
六、输入make && make install 增加两个功能 一个是支持openssl 和状态检查
进入下图所示的界面修改内容
七、生成证书
文件生成的路径与命令
openssl genrsa -out nginx.key 1024
(生成一个私钥文件,在当前路径下 文件名叫nginx.key 1024位)
输入 vim aginx.key查看
输入openssl rsa -in nginx.key -text
生成请求文件
openssl x509 -req -days 3650 -in nginx.csr -signkey nginx.key -out nginx.crt
查看
输入命令
进入注释掉这段并整改为
输入以下命令
整改路径并查看
新建个终端
打开pid 整改为如图所示
查看私钥文件:openssl rsa -in nginx.key -text
生成证书请求文件
openssl req -new -key ./private/nginx.key -out nginx.csr
生成证书
openssl x509 -req -days 3650 -in nginx.csr -signkey ./private/nginx.key -out nginx.crt
查看证书:
openssl x509 -req -days 3650 -in nginx.csr -signkey ./private/nginx.key -text
⑷证书生成
mkdir /etc/pki/nginx/private -p
生成私钥文件(包含公钥和私钥)
cd /etc/pki/nginx/private
openssl genrsa -out nginx.key
查看私钥文件:openssl rsa -in nginx.key -text
生成证书请求文件
cd /etc/pki/nginx
openssl req -new -key ./private/nginx.key -out nginx.csr
生成证书
cd /etc/pki/nginx
openssl x509 -req -days 3650 -in nginx.csr -signkey ./private/nginx.key -out nginx.crt
查看证书:
openssl x509 -req -days 3650 -in nginx.csr -signkey ./private/nginx.key -text
nginx配置SSL nginx.conf中去掉ssl配置注释,修改证书请求文件及证书文件的名称。
测试 https://192.168.115.132