赞
踩
若第一次编译nginx时没有支持ssl模块但是又想支持https则需要二次编译nginx,使其支持https。
首先查看nginx编译了什么
- cd /usr/local/nginx/sbin/
- ./nginx -V #查看编译了什么
安装nginx可参考:
yum -y install openssl openssl-devel pcre pcre-devel zlib zlib-devel
1.下载nginx安装包
wget http://nginx.org/download/nginx-1.8.0.tar.gz
2.解压nginx-1.8.0.tar.gz
tar -zxvf nginx-1.8.0.tar.gz
3.进入nginx目录
cd nginx-1.8.0
./configure --prefix=/usr/local/nginx --user=www --group=www --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module
报错总结:
1.出现如下错误,依赖包未安装
执行:
yum -y install openssl openssl-devel pcre pcre-devel zlib zlib-devel
用cp -rfp objs/nginx /usr/local/nginx/sbin/nginx解决
8.测试nginx是否正确
/usr/local/nginx/sbin/nginx -t
(nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful)
9.重启nginx
/usr/local/nginx/sbin/nginx -s stop
/usr/local/nginx/sbin/nginx -s reload
转载于:https://blog.51cto.com/13363488/2350495
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。