准备环境
系统环境:
Linux 192.168.1.111 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
安装依赖:
#yum -y install gcc
#yum -y install pcre pcre-devel
#yum -y install openssl openssl-devel
#yum -y install zlib zlib-devel
下载nginx安装包
安装路径为:/usr/local
#wget http://nginx.org/download/nginx-1.11.6.tar.gz
编译安装
默认安装到的路径:/usr/local/nginx
1.解压
#tar -zxvf nginx-1.11.6.tar.gz
#cd /usr/local/nginx-1.11.6
2.编译
#./configure
3.安装
#make
#make install
管理nginx
启动
#/usr/local/nginx/sbin/nginx
停止
#/usr/local/nginx/sbin/nginx -s stop
测试配置文件正确性
#/usr/local/nginx/sbin/nginx -t
重新加载配置文件
#/usr/local/nginx/sbin/nginx -s reload