Nginx安裝與設定檔解析 nginx配置tcp nginx配置jsp nginx緩衝配

來源:互聯網
上載者:User
導讀 Nginx是一款開放原始碼的高效能HTTP伺服器和反向 Proxy伺服器,同時支援IMAP/POP3代理服務,是一款自由的軟體,同時也是營運工程師必會的一種伺服器,下面我就簡單的說一下Nginx伺服器的安裝和檔案解析。

簡單安裝

本教程一Centos 6.3為例講解,軟體包可以在官方網站下載,編譯安裝之前,我們需要使用YUM提前將所需的軟體依賴包安裝完成。

安裝命令如下:

[root@centos6 ~]# wget http://nginx.org/download/nginx-1.4.0.tar.gz[root@centos6 ~]# tar -xzf nginx-1.4.0.tar.gz -C /usr/src[root@centos6 ~]# yum -y install gcc pcre pcre-devel openssl \>openssl-devel gd gd-devel perl perl-ExtUtils-Embed[root@centos6 ~]# cd /usr/src/nginx-1.4.0/[root@centos6 nginx-1.4.0]# ./configure --prefix=/usr/local/nginx \>--with-ipv6 \>--with-http_ssl_module \>--with-http_realip_module \>--with-http_addition_module \>--with-http_dav_module \>--with-http_flv_module \>--with-http_mp4_module \>--with-http_gzip_static_module \>--with-http_perl_module \>--with-mail \>--with_main_ssl_module[root@centos6 nginx-1.4.0]# make && make install

Nginx Web伺服器軟體安裝完成後,程式主目錄位於/usr/local/nginx/,該目錄下的內容分別為cong、html、logs、sbin。下面是Nginx常用的進程管理指令:

[root@centos6 ~]# /usr/local/nginx/sbin/nginx          #啟動主程式[root@centos6 ~]# /usr/local/nginx/sbin/nginx -c  \         #指定設定檔啟動主程式[root@centos6 ~]# /usr/local/nginx/sbin/nginx -s stop       #關閉主程式[root@centos6 ~]# /usr/local/nginx/sbin/nginx -s reload     #重新載入設定

設定檔解析

Nginx預設的設定檔為/usr/local/nginx/conf/nginx.conf,設定檔包括全域、event、http、server設定,event主要用來定義Nginx工作模式,http提供Web功能,server用來設定虛擬機器主機,server必須位於http內部,一個設定檔中可以有多個server。

本文原創地址:http://www.linuxprobe.com/nginx-installation-parsing

免費提供最新Linux技術教程書籍,為開源技術愛好者努力做得更多更好:http://www.linuxprobe.com/

以上就介紹了Nginx安裝與設定檔解析,包括了nginx,設定檔方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.