1、安裝相關組件nginx
yum -y install pcre pcre-devel zlib zlib-devel openssl openssl-develvim
2、下載安裝包curl
wget http://nginx.org/download/nginx-1.9.7.tar.gzide
3、安裝Nginx測試
解壓縮:tar xf nginx-1.9.7.tar.gz && cd nginx-1.9.7url
編譯: ./configure --prefix=/usr/local/nginx --with-http_gzip_module --with-http_stub_status_module --with-http-ssl_module --with-http_flv_module --with-http_rewrite_module && make && make installspa
4、配置環境變量xml
vim /etc/profile.d/nginx.ship
NGINX_HOME=/usr/local/nginxssl
PATH=$NGINX_HOME/sbin:$PATH
export PATH
source /etc/profile
5、測試訪問
啓動服務: nginx
檢查是否啓動: netstat -tlnp |grep 80
ps uax |grep nginx
lsof -i:80
測試: curl http://localhost
curl --head http://localhost
elinks http://localhost