1.基础环境
安装gcc:
yum install gcc-c++
安装PCRE:
yum install -y pcre pcre-devel
安装zlib:
yum install -y zlib zlib-devel
安装OpenSSL:
yum install -y openssl openssl-devel
2.安装nginx
安装nginx:
wget -c https://nginx.org/download/nginx-1.10.1.tar.gz
解压:
tar -zxvf nginx-1.10.1.tar.gz
进入目录:
cd nginx-1.10.1
使用默认配置:
./configure
安装:
make
make install
查看安装目录:
whereis nginx
cd /usr/local/nginx/sbin/
基本命令:
./nginx
./nginx -s stop
./nginx -s quit
./nginx -s reload
重启nginx:
./nginx -s quit
./nginx
重新加载配置文件:
./nginx -s reload