1-Nginx 編譯安裝

一、安裝相關組件

    yum -y install pcre pcre-devel zlib zlib-devel  openssl openssl-devel

二、下載安裝包

    wget http://nginx.org/download/nginx-1.9.7.tar.gz

三、安裝Nginx

   解壓縮:tar xf nginx-1.9.7.tar.gz && cd nginx-1.9.7

 編譯: ./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 install

四、配置環境變量

   vim /etc/profile.d/nginx.sh

    NGINX_HOME=/usr/local/nginx

    PATH=$NGINX_HOME/sbin:$PATH

    export  PATH

 

  source /etc/profile

五、測試訪問

  啓動服務: nginx

  檢查是否啓動: netstat -tlnp |grep 80

  ps uax |grep nginx

  lsof -i:80

 

  測試:       curl http://localhost

          curl  --head http://localhost

          elinks http://localhost

   


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章