安装wget

yum install -y wget

安装gcc gcc-c++ zlib openssl

 yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

安装pcre

cd /usr/local                     
mkdir software
cd software
wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
tar zxvf pcre-8.35.tar.gz
cd pcre-8.35
./configure
make && make install
pcre-config --version

安装nginx

cd /usr/local/software
wget http://nginx.org/download/nginx-1.14.0.tar.gz
tar zxvf nginx-1.14.0.tar.gz
cd nginx-1.14.0
./configure
make && make install
/usr/local/nginx/sbin/nginx -v
ps -ef | grep ngin

 有时候由于Linux 服务器上防火墙会端口拦截,所以我们需要在防火墙中开放80 端口,方便我们待会在物理机上查看

firewall-cmd --permanent --add-port=80/tcp --zone=public

访问ip+port查看是否成功启动nginx(80是默认端口,所以不用加,只用输入ip)

 

 

 

相关链接:https://www.cnblogs.com/xingyunblog/p/9072553.html