1.安裝編譯須要用到的庫和工具html
apt-get install build-essential libtool gcc automake autoconf make
2.安裝pcre,支持重寫rewrite功能nginx
源碼下載地址:https://ftp.pcre.org/pub/pcre/ wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz tar -zxvf pcre-8.40.tar.gz cd pcre-8.40.tar.gz ./configure make && make install
3.安裝zlib, 支持gzip壓縮ubuntu
源碼下載地址:http://zlib.net wget http://zlib.net/zlib-1.2.11.tar.gz tar -zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure make && make install
4.安裝sslide
源碼地址:https://www.openssl.org/source/ wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz tar -zxvf openssl-1.0.2o.tar.gz cd openssl-1.0.2o ./config make && make install
五、安裝Nginx:工具
源碼地址:http://nginx.org/en/download.html wget http://nginx.org/download/nginx-1.13.12.tar.gz tar -zxvf nginx-1.13.12.tar.gz cd nginx-1.13.12.tar.gz ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
預編譯:ui
./configure --sbin-path=/usr/local/nginx/nginx \ --conf-path=/usr/local/nginx/nginx.conf \ --pid-path=/usr/local/nginx/nginx.pid \ --with-http_ssl_module \ --with-pcre=/usr/local/src/pcre-8.40 \ --with-zlib=/usr/local/src/zlib-1.2.11 \ --with-openssl=/usr/local/src/openssl-1.0.2o
編譯安裝:.net
make && make install
安裝完成:
啓動目錄:code
/usr/local/nginx/sbin/nginx -s reload 查看是否運行: ps-ef|grep nginx