一、centos平台编译环境安装
1,安装make:
yum -y install gcc automake autoconf libtool make
2,安装g++:
yum install gcc gcc-c++
二、安装依赖库(cd /usr/local/src)
1,安装PCRE库(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/)
cd /usr/local/src wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz tar -zxvf pcre-8.37.tar.gz cd pcre-8.34 ./configure make make install
2,安装zlib库(http://zlib.net/)
cd /usr/local/src wget http://zlib.net/zlib-1.2.11.tar.gz tar -zxvf zlib-1.2.11.tar.gz cd zlib-1.2.11 ./configure make make install
3,安装openssl(某些vps默认没装ssl)
cd /usr/local/src wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz tar -zxvf openssl-1.0.1t.tar.gz cd openssl-1.0.1t ./Configure make make install
三、安装nginx
cd /usr/local/src wget http://nginx.org/download/nginx-1.1.10.tar.gz tar -zxvf nginx-1.1.10.tar.gz cd nginx-1.1.10 ./configure make make install
四、nginx重启、关闭、启动
1,启动:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
2,停止(三种)
①快速停止: kill -INT 2132
②从容停止: kill -QUIT 2072
③强制停止: pkill -9 nginx
3,重启
①验证nginx配置文件是否正确: ./nginx -t
②重启:目录sbin下 ./nginx -s reload 或者 kill -HUP 进程号