1.下載pcre#wgethttp://jaist.dl.sourceforge.net/project/pcre/pcre/7.9/pcre-7.9.tar.gz
2.安裝pcre-7.9.tar.gz - #tar zxvf pcre-7.9.tar.gz
- #cd pcre-7.9/
- #./configure
- #make && make install
#tar zxvf pcre-7.9.tar.gz#cd pcre-7.9/#./configure#make && make install
3.下載nginx#wget http://sysoev.ru/nginx/nginx-0.7.61.tar.gz
4.解壓 - #tar -zxvf nginx-0.7.61.tar.gz
- #cd nginx-0.7.61
- #./configure --prefix=/usr/local/nginx --with-pcre=/root/pcre-7.9/ --with-http_stub_status_module --with-http_realip_module
- #make
- #make install
#tar -zxvf nginx-0.7.61.tar.gz#cd nginx-0.7.61#./configure --prefix=/usr/local/nginx --with-pcre=/root/pcre-7.9/ --with-http_stub_status_module --with-http_realip_module#make#make install
5.選項-c </path/to/config> 為 Nginx 指定一個配置文件,來代替缺省的。
-t 不運行,而僅僅測試配置文件。nginx 將檢查配置文件的語法的正確性,并嘗試打開配置文件中所引用到的文件。
-v 顯示 nginx 的版本。
-V 顯示 nginx 的版本,編譯器版本和配置參數(shù)。
6.中止運行的進程: - #ps aux | egrep '(PID|nginx)'
- USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
- root 2213 0.0 0.0 6784 2036 ? Ss 03:01 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
- #kill -15 2213
#ps aux | egrep '(PID|nginx)'USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDroot 2213 0.0 0.0 6784 2036 ? Ss 03:01 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf#kill -15 2213
平滑改變 nginx 配置的選項(請注意,在重載前,要先測試一下配置文件):
- #nginx -t -c /etc/nginx/nginx.conf
- 2006/09/16 13:07:10 [info] 15686#0: the configuration file /etc/nginx/nginx.conf syntax is ok
- 2006/09/16 13:07:10 [info] 15686#0: the configuration file /etc/nginx/nginx.conf was tested successfully
- #ps aux | egrep '(PID|nginx)'
- USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
- root 2213 0.0 0.0 6784 2036 ? Ss 03:01 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
- #kill -HUP 2213