1. 下載
# 進入安裝目錄
cd /user/local
# 下載nginx
wget http://nginx.org/download/nginx-1.6.2.tar.gz
# 解壓
tar zxvf nginx-1.6.2.tar.gz
# 編譯
make && make install
2. 配置
# 進入配置
cd ../nginx/conf/nginx.conf
進行配置端口域名等
3. 啓動
# 啓動
/user/local/nginx/sbin/nginx
# 重啓
/user/local/nginx/sbin/nginx -s reload
4. 查看
查看配置的端口
netstate -nltp
5. 問題
1. make: *** 沒有指明目標並且找不到 makefile。 停止。
使用make && make install 命令時報錯,報上述錯誤
需要安裝:
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-deve