源码编译方式:
#一般系统中已经装了了make和g++,无须再装
安装make:
yum -y install autoconf automake make
安装g++:
yum -y install gcc gcc-c++
#安装nginx依赖的库
yum -y install pcre pcre-devel yum -y install zlib zlib-devel yum install -y openssl openssl-devel
#配置
#--prefix指定安装目录
#--with-http_ssl_module安装https模块
#creating objs/Makefile 代表编译成功
wget http://nginx.org/download/nginx-1.9.15.tar.gz tar -zxvf nginx-1.9.0.tar.gz cd nginx-1.9.0 ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
#make编译
#make install安装
make && make install
yum安装:
centos6:yum install epel-release -y #yum扩展源
yum install nginx -y