咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
1.首先安装编译用到的包
yum -y install gcc gcc-c++
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
2.建立用户和组
groupadd -r nginx
useradd -s /sbin/nologin -g nginx -r nginx
id nginx
3.下载解压nginx.org
4.设置参数
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_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
5.编译和安装:make && make install
多线程编译安装:make -j `cat /proc/cpuinfo | grep processor| wc -l` && make install