如何源碼安裝nginx
2016-03-17 17:24:36
11489
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.設(shè)置參數(shù)
./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