Author:    SuperBO
Date:       2010-04-25

Version: 

Kernel:    Linux version 2.6.18-128.el5
OS:         CentOS release 5.3 (Final)
Nginx:     Nginx-0.8.36


        

Depend Library

1. gzip module requires zlib library
2. rewrite module requires pcre library
3. ssl support requires openssl library

Install

Zlib library:

未使用gzip,暂不安装 ╮(╯_╰)╭

pcre library:

下载地址:http://sourceforge.net/projects/pcre/files/
tar zxvf pcre-8.02.tar.gz
cd pcre-8.02
./configure
make && make install

openssl library:
yum -y install openssl-devel

-------------------------------------------------------------------------------------

Create User & Group for Nginx 

groupadd www
useradd www -g www -p abc_123

Create Folder for web & logs

创建以下文件夹:
[root@CentOS-BO www.site1.com]# tree -Ad /data/
/data/
+-- logs
|   +-- www-logs
|       +-- http
|       +-- www.site1.com
|       +-- www.site2.com
|       +-- www.site3.com
+-- lost+found
+-- web
    +-- www.site1.com
    |   +-- htdocs
    +-- www.site2.com
    |   +-- htdocs
    +-- www.site3.com
        +—htdocs

Change owner & owner group

chown –R www:www /data/logs/www-logs
chown –R www:www /data/web

-------------------------------------------------------------------------------------

Install Nginx

下载地址:http://nginx.org/en/download.html
tar zxvf nginx-0.8.36.tar.gz
cd nginx-0.8.36

./configure --prefix=/opt/nginx/ --user=www --group=www --http-log-path=/data/logs/www-logs/ --with-http_stub_status_module --with-http_ssl_module

make && make install

 

DONE : )