创建文件
vim nginx-install.sh
添加如下文本
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
mkdir /usr/local/nginx
cd /usr/local/nginx
wget https://nginx.org/download/nginx-1.8.0.tar.gz
cd /usr/local/nginx
tar zxvf nginx-1.8.0.tar.gz
cd /usr/local/nginx/nginx-1.8.0
./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client
\
--http-proxy-temp-path=/var/temp/nginx/proxy
\
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi
\
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi
\
--http-scgi-temp-path=/var/temp/nginx/scgi
--http-scgi-temp-path=/var/temp/nginx/scgi
make
make install
mkdir /var/temp/nginx/client -p
cd /usr/local/nginx/sbin
./nginx
授予 可执行文件权限
chmod +x nginx-install.sh
#启动文件
./nginx-install.sh
静静地等待安装完成即可 出现输入全部熟入 Y
访问 路径 IP:80 端口号 即可
如果有任何问题可以
实践群 :422035079