系统:Linux Centos 7.9
gcc 、c++、pcre、zlib、openssl等
yum install -y gcc-c++
yum install -y pcre
yum install -y pcre-devel
yum install -y zlib
yum install -y zlib-devel
yum install -y openssl
yum install -y openssl-devel
Nginx
源码并解压wget -c http://nginx.org/download/nginx-1.15.7.tar.gz
mkdir -p /usr/lib/nginx
tar -zxvf nginx-1.15.7.tar.gz -C /usr/lib/nginx
cd /usr/lib/nginx/nginx-1.15.7 # 进入解压目录
./configure
make && make install
vim /etc/profile # 编辑文件
source /etc/profile
添加内容
export NGINX_HOME=/usr/local/nginx
export PATH=${NGINX_HOME}/sbin:$PATH
./nginx # 启动Nginx
./nginx -t # 检测是否有语法错误
./nginx -s reload # 重新加载配置文件
./nginx -s stop # 强制停止
vim /etc/rc.local
/usr/local/nginx/sbin/nginx
chmod 755 /etc/rc.local