1、下載&安裝 nginx模塊依賴以下庫:gzip模塊需要zlib庫、rewrite模塊需要pcre庫、ssl功能需要openssl庫 "pcre" "zlib" "openssl" "nginx" 2、運行 目錄結構 : client_body_temp conf fastcgi_temp htm ...
1、下載&安裝
nginx模塊依賴以下庫:gzip模塊需要zlib庫、rewrite模塊需要pcre庫、ssl功能需要openssl庫
pcre
wget http://netassist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.bz2
tar -jxvf pcre-8.38.tar.bz2
cd pcre-8.38
ls -al
ls *confi*
./configure
make
make install
zlib
wget http://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
ls -al
ls *confi*
./configure
make
make install
openssl
wget http://www.openssl.org/source/openssl-1.0.1s.tar.gz
tar -zxvf openssl-1.0.1s.tar.gz
cd openssl-1.0.1s
ls -al
ls *confi*
./config
make
make install
nginx
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8.1.tar.gz
./configure --with-openssl=/home/lingy/download/openssl-1.0.1s --with-pcre=/home/lingy/download/pcre-8.38 --with-zlib=/home/lingy/download/zlib-1.2.8
make
make install
2、運行
目錄結構:ls -al /usr/local/nginx
client_body_temp
conf
fastcgi_temp
html
logs
proxy_temp
sbin
scgi_temp
uwsgi_temp
配置文件
fastcgi.conf
fastcgi.conf.default
fastcgi_params
fastcgi_params.default
koi-utf
koi-win
mime.types
mime.types.default
nginx.conf[^1]
nginx.conf.default
scgi_params
scgi_params.default
uwsgi_params
uwsgi_params.default
win-utf
運行
cd /usr/local/nginx/sbin/
./nginx -t
./nginx
重啟
./nginx -s reload
訪問
在地址欄上敲:http://localhost:8099
註:需要在nginx.config中將80埠(預設80)改成8099埠