首页 > 其他 > 详细

linux下安装 nginx配置

时间:2014-02-27 16:03:12      阅读:515      评论:0      收藏:0      [点我收藏+]

1.下载nginx -1.2.5.tar.gz    www.nginx.org/en/download.html      tar -zxvf nginx -1.2.5.tar.gz

2. 编译工具   #yum -y install gcc gcc-c++ autoconf automake 

                  #yum -y install zlib zlib-devel openssl openssl-devel pcre-devel

             zlib : nginx 提供gzip 模块,需要zlib 库支持   。  pcre  :支持地址重写rewrite 功能。

3.  建用户:groupadd -r nginx     useradd -s /sbin/nologin -g nginx -r nginx

4. 编译安装: tar -zxvf nginx-1.2.5tar.gz

                    cd  nginx-1.2.5tar.gz

                   ./configure  --prerix=/usr --sbin-path=/usr/sbin/nginx --config-path=/etc/nginx/nginx.conf

               --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock

          --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module

    --http-log-path=/var/log/nginx/access.log --http-clinet-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi --with-http_stub_status_module

      #make   &&    make install

5.启动  mkdir /var/tmp/nginx/client -pv

          /usr/sbin/nginx -c /etc/nginx/nginx.conf

   检测:ps aux | grep nginx                     netstat -tulnp |grep :80

 停止 :  kill -quit $(cat /var/run/nginx/nginx.pid)       从容关闭quit

            kill -TERM  $(cat /var/run/nginx/nginx.pid)      快速停止

            kill -9 nginx                         强制关闭

 6.加启动   cp nginx /etc/init.d/     

                chmod a+x /etc/init.d/nginx

               chkconfig --add nginx         chkconfig --list nginx

启动  service nginx restart

linux下安装 nginx配置,布布扣,bubuko.com

linux下安装 nginx配置

原文:http://www.cnblogs.com/sunnom/p/3569863.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!