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重写

[[email protected]]# make

[[email protected]]# 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

    

4nginx关闭

[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


你可能感兴趣的:(nginx安装)