Nginx 1.13.6 源碼安裝
系統:Centos 7.3 Server with GUI
軟件:nginx-1.13.6.tar.gz
其他所需軟件:openssl pcre zlib openssl-devel
安裝方式:源碼編譯安裝
安裝位置:/usr/local/nginx
下載地址:
http://nginx.org/en/download.html
https://www.openssl.org/source/
https://ftp.pcre.org/pub/pcre/
http://zlib.net/
安裝需要gcc-c++
#yum install gcc-c++ -y
其他依賴包(只需要解壓出來不需要安裝)
# tar -xvf openssl-1.1.0g.tar.gz
# tar -xvf zlib-1.2.11.tar.gz
# tar -xvf pcre-8.41.tar.gz
添加一個用戶
# useradd nginx
# tar -xvf nginx-1.13.6.tar.gz
#./configure --help #配置的時候可查看幫助,切勿盲目配置
# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_ssl_module --with-openssl=/root/openssl-1.1.0g --with-pcre=/root/pcre-8.41 --with-zlib=/root/zlib-1.2.11 --with-http_stub_status_module --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid
# ./nginx -h 查看幫助
# ./nginx -t 測試配置文件
# ./nginx #啟動nginx
nginx: the configuration file /usr/local/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/nginx.conf test is successful
# ps -ef|grep nginx
root 84479 1 0 22:08 ? 00:00:00 nginx: master process ./nginx
nginx 84480 84479 0 22:08 ? 00:00:00 nginx: worker process
Nginx 1.13.6 源碼安裝