1、nginx官网下载安装包:http://nginx.org/en/download.html,本次使用的版本为1.4.3
2、解包
tar zxvf nginx-1.4.3.tar.gz
mv nginx-1.4.3 /usr/lib/
3、检查系统环境 ./configure
报错:./configure: error: the HTTP rewrite module requires the PCRE library 缺少pcre library
./configure: error: the HTTP rewrite module requires the zlib library 缺少zlib library
解决:yum -y install openssl-devel
yum -y install pcre-devel
4、安装 make && make install
安装过程出现错误,原因是虚拟机的时间与当前时间相差了几个月,修改时间,date -s "2013-10-09 16:41:23" && clock -w
5、启动、停止 ./nginx ./nginx -s stop
参考:http://www.blogjava.net/cenly60/archive/2008/12/12/245965.html