#!/bin/bash # # ########################## . /etc/init.d/functions ### 1.安装Nginx所需的pcre库 ### yum -y install pcre pcre-devel ### 2.安装所需依赖包 ### yum -y install gcc openssl openssl-devel ### 3.创建www用户 ### useradd www -s /sbin/nologin -M ### 4.编译安装 ### cd /tmp/tools tar xvf nginx-1.6.3.tar.gzcd nginx-1.6.3./configure --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --prefix=/application/nginx-1.6.3/ make && make install ### 5.创建软连接 ### ln -s /application/nginx-1.6.3/ /application/nginx ### 6.启用Nginx ### /application/nginx/sbin/nginx -t/application/nginx/sbin/nginx netstat -antulp | grep 80 ### 7.结果验证 ###curl http://10.0.0.8:80
时间: 2024-10-10 17:03:28