コンパイルインストールNginx-1.0.1

1017 ワード

1、Nginxのインストールに必要なpcreライブラリ
wget http://www.92csz.com/downloads/pcre-8.12.tar.gz
tar zxvf pcre-8.12.tar.gz
cd pcre-8.12
./configure
make && make install
cd ..

2、nginxを取り付ける
wget http://nginx.org/download/nginx-1.2.7.tar.gz
tar zxvf nginx-1.2.7.tar.gz
cd nginx-1.2.7
./configure --user=www --group=www --prefix=/data/soft/nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_dav_module --with-http_flv_module --with-http_addition_module --with-http_sub_module
make && make install
cd ..

3、nginxプロファイルの作成
rm -f /data/soft/nginx/conf/nginx.conf
vi /data/soft/nginx/conf/nginx.conf

4、nginxを起動してテストを行う
/data/soft/nginx/sbin/nginx -t
/data/soft/nginx/sbin/nginx
mkdir -p /data/www/test
echo "<?php phpinfo();?>" > /data/www/test/index.php
echo "/data/soft/nginx/sbin/nginx" >> /etc/rc.local