yum -y install gcc zlib zlib-devel pcre-devel openssl open-devel
cd /usr/local mkdir nginx cd nginx wget http://nginx.org/download/nginx-1.13.7.tar.gz tar -xvf nginx-1.13.7.tar.gz cd nginx-1.13.7 ./configure make //执行make命令 make install
为了不与其他端口冲突,我们设置端口为8089(这一步可以不做)
vim /usr/local/nginx/conf/nginx.conf//修改端口号为8089
/usr/local/nginx/sbin/nginx -s reload
如果报错,执行下面的语句再重新启动:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf