CentOS编译安装Nginx

 1 #下载
 2 wget http://nginx.org/download/nginx-1.14.0.tar.gz
 3 #解压缩
 4 tar -zxvf nginx-1.14.0.tar.gz -C /root
 5 #安装依赖
 6 yum install gcc gcc-c++ make automake autoconf pcre pcre-devel zlib zlib-devel openssl openssl-devel libtool -y
 7 #配置
 8 cd /root/nginx-1.14.0
 9 ./configure  --prefix=/usr/local/nginx  --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log  --http-log-path=/var/log/nginx/access.log  --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock  --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre
10 #创建client-body-temp-path文件夹
11 mkdir -p /var/tmp/nginx/client/
12 #编译
13 make && make install
14 #
15 cd /usr/local/nginx/sbin
16 ./nginx
17 ./nginx -s stop
18 ./nginx -s reload

 

posted @ 2018-10-09 15:52  面向bug编程  阅读(71)  评论(0)    收藏  举报