安装gcc环境:
yum install gcc-c++ -y
zlib库:
yum install zlib-devel -y
openssl:
yum install openssl openssl-devel -y
上传pcre的压缩包到root目录下:
创建pcre的执行目录:
mkdir -p /usr/local/pcre
解压pcre压缩包:
tar -xf pcre-8.45.tar.gz
进入到pcre目录下:
cd pcre-8.45/
指定目录:
./configure --prefix=/usr/local/pcre
编译安装:
make && make install
上传nginx压缩包到root目录下:
创建nginx的执行目录:
mkdir -p /usr/local/nginx
解压nginx压缩包:
tar -xf nginx-1.21.6.tar.gz
进入到nginx目录下:
cd nginx-1.21.6/
执行:
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre
编译安装:
make && make install
进行启动:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
关闭防火墙:
systemctl stop firewalld
进浏览器访问本机ip即可: