#nginx安装
yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++
cd /usr/local/src
//获取扩展链接 pcre zlib ssl
链接:https://pan.baidu.com/s/1_4xCxY5NAa-qf5j7_NPs4Q
提取码:lhy9
tar -zxvf pcre-8.41.tar.gz
cd pcre-8.39
./configure
make && make install
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make && make install
tar -zxvf openssl-1.1.0.tar.gz
./config
make && make install
tar -zxvf nginx-1.18.1.tar.gz
cd nginx-1.18.1.tar.gz
./configure
–prefix=/usr/local/nginx
–sbin-path=/usr/local/nginx/sbin/nginx
–conf-path=/usr/local/nginx/nginx.conf
–pid-path=/usr/local/nginx/nginx.pid
–user=nginx
–group=nginx
–with-http_ssl_module
–with-http_flv_module
–with-http_mp4_module
–with-http_stub_status_module
–with-http_gzip_static_module
–http-client-body-temp-path=/var/tmp/nginx/client/
–http-proxy-temp-path=/var/tmp/nginx/proxy/
–http-fastcgi-temp-path=/var/tmp/nginx/fcgi/
–http-uwsgi-temp-path=/var/tmp/nginx/uwsgi
–http-scgi-temp-path=/var/tmp/nginx/scgi
–with-pcre=/usr/local/src/pcre-8.41
–with-zlib=/usr/local/src/zlib-1.2.11
–with-openssl=/usr/local/src/openssl-1.1.0 \
make && make install
#启动
cd /usr/local/nginx/sbin
nginx -s reload
#开启80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
#启动firewall
firewall-cmd --reload