下载安装包
http://nginx.org/download/nginx-1.4.7.tar.gz
解压
tar zxvf http://nginx.org/download/nginx-1.4.7.tar.gz
进入目录
cd nginx-1.4.7
安装(一般会报错pcre库未安装和make未安装,前两行预先安装)
yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
./configure --prefix=/usr/local/src/nginx
make && make install
启动
./nginx
关闭防火墙
/etc/init.d/iptables stop