nginx编译安装流程:

nginx环境安装流程:

  1. yum -y install gcc gcc-c++ autoconf automake make
  2. yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
  3. groupadd www
  4. useradd -g www www
  5. mkdir -p /usr/local/nginx && cd $_
  6. wget http://nginx.org/download/nginx-1.9.9.tar.gz
  7. tar -zxvf nginx-1.9.9.tar.gz
  8. ln -s nginx-1.9.9 latest
  9. cd 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_module
  10. make -j4 && make install
  11. 安装完成,测试
    /usr/local/nginx/latest/sbin/nginx -v
  12. 配置环境变量
    vim /etc/profile
#nginx environment
export NGINX_HOME=/usr/local/nginx/latest
export PATH=$PATH:$NGINX_HOME/sbin
  1. source /etc/profile



配置服务,后期增加
nginx 多配置文件


相关下载

其他版本下载地址:http://nginx.org/download/
--conf-path:使用此配置后,可以直接使用nginx命令,不带配置文件位置,根据指定配置文件位置

你可能感兴趣的:(nginx编译安装流程:)