1. 安裝wget。nginx
sudo yum -y install wget
2. 下載nginx發佈代碼。服務器
sudo wget http://nginx.org/download/nginx-1.8.0.tar.gz
3. 解壓縮。spa
sudo tar -zxvf nginx-1.8.0.tar.gz
4. 安裝編譯須要的軟件包。code
sudo yum -y install gcc pcre pcre-devel zlib-devel openssl-devel
5. 配置、編譯並安裝。blog
sudo ./configure --prefix=/opt/nginx --with-pcre --with-http_stub_status_module --with-http_ssl_module sudo make sudo make install
6. 啓動nginx服務器。ssl
sudo /opt/nginx/sbin/nginx
7. 重啓nginx服務。get
sudo /opt/nginx/sbin/nginx -s stop sudo /opt/nginx/sbin/nginx