Nginx安裝問題
下載nginx,地址:http://nginx.org/en/download.html
解壓安裝,這個不解釋
問題出現1:
./configure: error: the HTTP rewrite module requires the PCRE library.You can either disable the module by using --without-http_rewrite_moduleoption, or install the PCRE library into the system, or build the PCRE librarystatically from the source with nginx by using --with-pcre=<path> option.
解決1:
sudo apt-get install libpcre3 libpcre3-dev
問題出現2:
./configure: error: the HTTP gzip module requires the zlib library.You can either disable the module by using --without-http_gzip_moduleoption, or install the zlib library into the system, or build the zlib librarystatically from the source with nginx by using --with-zlib=<path> option.
解決2:
下載zlib庫,地址:http://www.zlib.net/
直接解壓安裝
which zlib
查看一下,有可能還需要安裝:
sudo apt-get install openssl libssl-dev
執行configure操作:
./configure –prefix=/usr/local/nginx –pid-path=/var/run/nginx.pid--with-http_stub_status_module –with-http_ssl_modulemakemake install
啟動:
/usr/local/nginx/sbin/nginx
測試:
curl -i http://localhost
干凈卸載nginx
命令:
sudo apt-get --purge autoremove nginx
命令:
which nginx
如果沒有提示,證明卸載成功,嘿嘿~