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

<br />
配置服务,后期增加
nginx 多配置文件


相关下载

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容