标签:nginx安装
Nginx部署
1、环境准备
[root@nginx-master~]# yum install pcre* openssl*
注明:
pcre ---> 支持rewrite功能
openssl* ---> 需要ssl的支持
2、安装nginx
[root@nginx-mastertools]# tar zxf nginx-1.6.3.tar.gz
[root@nginx-master nginx-1.6.3]# ./configure\
>--prefix=/usr/local/nginx \
>--with-http_ssl_module \ 支持https
>--with-http_spdy_module \
>--with-http_stub_status_module \ 支持nginx状态查询
>--with-pcre 支持rewrite重写
[root@nginx-masternginx-1.6.3]# make
[root@nginx-masternginx-1.6.3]# make install
3、启动nginx
[root@nginx-master ~]# /usr/local/nginx/sbin/nginx
[root@nginx-master ~]# netstat -ntulp | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 29900/nginx
4、nginx关闭
[root@nginx-master ~]# /usr/local/nginx/sbin/nginx -s stop
nginx reload(重置出错)
[root@nginx-master ~]# /usr/local/nginx/sbin/nginx -s reload
nginx: [error] open()"/usr/local/nginx/logs/nginx.pid" failed (2: No such file ordirectory)
解决办法:
[root@nginx-master ~]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
本文出自 “Shaw Blog” 博客,请务必保留此出处http://opsedu.blog.51cto.com/9265055/1747096
标签:nginx安装
原文地址:http://opsedu.blog.51cto.com/9265055/1747096