1、如果没有依赖先安装依赖
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
2、下载安装包
cd /usr/local/src/
wget http://nginx.org/download/nginx-1.6.2.tar.gz
--解压
tar zxvf nginx-1.6.2.tar.gz
--进入安装包
cd nginx-1.6.2
3、编译配置
-- 配置
./configure --prefix=/usr/local/nginx
make
make install
测试:
cd /usr/loca/nginx/
./sbin/nginx -t
启动:
cd /usr/local/nginx/sbin