1) 安裝依賴 prce庫 進入/usr/local目錄,依次鍵入以下命令: 下載壓縮包:$ wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz 解壓縮:$ tar -zxf pcre-8.42.tar.gz 進入解壓後目錄:$ cd pcre-8 ...
1) 安裝依賴
prce庫
進入/usr/local目錄,依次鍵入以下命令:
下載壓縮包:$ wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
解壓縮:$ tar -zxf pcre-8.42.tar.gz
進入解壓後目錄:$ cd pcre-8.42
執行安裝:$ ./configure
$ make
$ sudo make install
zlib庫
進入/usr/local目錄,依次鍵入以下命令:
$ wget http://zlib.net/zlib-1.2.11.tar.gz
$ tar -zxf zlib-1.2.11.tar.gz
$ cd zlib-1.2.11
$ ./configure
$ make
$ sudo make install
OpenSSL
進入/usr/local目錄,依次鍵入以下命令:
$ wget http://www.openssl.org/source/openssl-1.1.1b.tar.gz
$ tar -zxf openssl-1.1.1b.tar.gz
$ cd openssl-1.1.1b
./config --prefix=/usr/local/ssl shared zlib-dynamic
$ make
$ sudo make install
2) 安裝Nginx-1.17.2版本
$ wget https://nginx.org/download/nginx-1.17.2.tar.gz
$ tar zxf nginx-1.17.2.tar.gz
$ cd nginx-1.17.2
./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=../pcre-8.43 \
--with-zlib=../zlib-1.2.11 \
--with-openssl=../openssl-1.1.1b \
$ make
$ sudo make install
3) 啟動Nginx,執行命令/usr/local/nginx/sbin/nginx,查看進程(命令:ps -ef|grep nginx)