本文共 925 字,大约阅读时间需要 3 分钟。
1,去Nginx官方网站下载源码包并解压
curl -O 或wget 跟下载链接
tar -xf 解压2,进入nginx解压后的目录执行./configure …
./configure --prefix=/usr/local/sc_nginx --user cali --group cali --with stream --with threads --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module
参数解释:
–prefix 用于指定nginx编译安装后的目录 –user 指定用户 –group 指定组 –with stream 启动nginx四层负载均衡(传输层) –with threads 启动进程池模块 –with-http_ssl_module 启动nginx的https服务 –with-http_realip_module 启动realip模块 –with-http_stub_status_module 启动nignx的状态查看模块其他模块:
日志记录模块ngx_http_log_module 压缩相关选项ngx_http_gzip_module 重定向模块ngx_http_rewrite_module 引用模块ngx_http_referer_module 反向代理模块ngx_http_proxy_module更多模块详情
注:
直接执行上述的./configure 命令 可能会出错,需要我们手动解决依赖关系,根据提示安装一些依赖包,一般需要安装: yum install pcre-devel gcc openssl-devel -y3,编译安装
make && make install 安装后可看到指定目录的目录结构4,启动nginx
转载地址:http://emlzi.baihongyu.com/