1.編譯
./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-log-path=/var/log/nginx/access.log \
--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 \
--with-http_stub_status_module \
--with-http_sub_module \nginx
2.安裝nginx
make && make installui
3. 運行 或 從新裝載配置
nginxspa
nginx -s signal
Where signal may be one of the following:
stop — fast shutdown
quit — graceful shutdown
reload — reloading the configuration file
reopen — reopening the log filesip
4. 卸載
rm -rf /usr/sbin/nginx
rm -rf /etc/nginx
rm -rf /var/log/nginx
rm -rf /var/run/nginx.pid
rm -rf /var/tmp/nginssl
注意: /var/tmp/nginx 目錄沒有的話,需手動建立it