nginx环境安装流程:
yum -y install gcc gcc-c++ autoconf automake makeyum -y install zlib zlib-devel openssl openssl-devel pcre pcre-develgroupadd wwwuseradd -g www wwwmkdir -p /usr/local/nginx && cd $_wget http://nginx.org/download/nginx-1.9.9.tar.gztar -zxvf nginx-1.9.9.tar.gzln -s nginx-1.9.9 latestcd latest; ./configure --user=www --group=www --prefix=/usr/local/nginx/latest --conf-path=/etc/nginx/conf/nginx.conf --with-http_stub_status_module --with-http_ssl_module --with-stream --with-http_gzip_static_module --with-http_sub_modulemake -j4 && make install- 安装完成,测试
/usr/local/nginx/latest/sbin/nginx -v - 配置环境变量
vim /etc/profile
#nginx environment
export NGINX_HOME=/usr/local/nginx/latest
export PATH=$PATH:$NGINX_HOME/sbin
source /etc/profile
<br />
配置服务,后期增加
nginx 多配置文件
相关下载
其他版本下载地址:http://nginx.org/download/
--conf-path:使用此配置后,可以直接使用nginx命令,不带配置文件位置,根据指定配置文件位置