nginx のインストール

[nginex インストール on CentOS 5.4]


nginex のインストール手順についてまとめます。

* yum -y install gcc gcc-c++ openssl-devel をコンパイル用にインストールしておく
* PCREをインストル
o ftp://ftp.csx.cam.ac.uk/pub/software...cre-7.9.tar.gz
o tar xvzf pcre-7.9.tar.gz
o cd pcre-7.9
o ./configure
o make
o make install
* nginex をインストール
o wget http://sysoev.ru/nginx/nginx-0.7.64.tar.gz
o tar xvzf nginx-0.7.64.tar.gz
o cd ../nginx-0.7.64
o ./configure --with-http_ssl_module
* spawn-cgi をsrc からインストール
o wget http://www.lighttpd.net/download/spa...i-1.6.3.tar.gz
o cd ../spawn-fcgi-1.6.3./configure
o make
o make install
* nginex を起動
o nginex ユーザ追加
o /usr/sbin/useradd nginex
o ※/usr/local/nginex/conf/nginex.conf の設定は添付を参照(server,httpセクションを適宜修正 )
o /usr/local/nginx/sbin/nginx -t (テスト起動)
o /usr/local/nginx/sbin/nginx (起動)
* php-cgi をspawn-cgi 経由で起動
o /sbin/service php-cgi start
o ※php-cgi は添付を参照
o

リクエストの流れ

PC[ブラウザ] -----------> nginex(port:8080) -----------> spawn-cgi(php-cgi(fcgi) port:9000)

[参考サイト]

http://d.hatena.ne.jp/perezvon/20091016/1255713335

http://www.shinstudio.com/blog/backe...x-http-server/