本文共 1621 字,大约阅读时间需要 5 分钟。
在实际安装nginx时,我们需要对nginx进行编译安装,编译时,会添加相应使用功能的参数。
举例内容:这里举例部分内容进行讲解,实际应用的时候按照所需内容进行编译安装。
./configure--prefix=/data/nginx --sbin-path=/data/nginx/sbin/nginx--conf-path=/data/nginx/conf/nginx.conf--error-log-path=/data/nginx/log/error.log--http-log-path=/data/nginx/log/access.log --pid-path=/data/nginx/log/pid/nginx.pid--lock-path=/data/nginx/log/lock/subsys/nginx --with-http_ssl_module--with-http_realip_module --with-http_addition_module --with-http_sub_module--with-http_dav_module --with-http_flv_module --with-http_gzip_static_module--with-http_stub_status_module --with-http_perl_module--with-ld-opt="-Wl,-E" --with-http_image_filter_module
--prefix: 指定安装目录
--sbin-path: 指定(执行)程序文件位置
--conf-path: 指向配置文件位置
--http-log-path: 指向http日志文件位置
--http-log-path: 指向http日志文件位置
--lock-path :指向lock文件(nginx.lock)(安装文件锁定,防止已安装完毕的文件件被别人利用,或自己误操作。)
--with-http_ssl_module: 启用ngx_http_ssl_module模块内容支持(使其支持https请求)
--with-http_realip_module :启用ngx_http_realip_module模块支持(这个模块允许从请求标头更改客户端的IP地址值,默认为关,这里添加此参数用于测试使用)
--with-http_sub_module: 启用ngx_http_sub_module支持(允许用一些其他文本替换nginx响应中的一些文本,支持文本替换使用)
--with-http_dav_module : 启用ngx_http_dav_module支持(增加PUT,DELETE,MKCOL创建集合、COPY 和 MOVE 方法)默认情况下为关闭,编译后可开启此功能
--with-http_flv_module : 启用ngx_http_flv_module支持(提供寻求内存使用基于时间的偏移量文件)
--with-http_gzip_static_module: 启用ngx_http_gzip_static_module支持(在线实时压缩输出数据流文件,可以使大文件在访问时压缩加快访问速度)
--with-http_stub_status_module : 启用ngx_http_stub_status_module支持(获取 nginx 自上次启动以来的工作状态)
--with-http_perl_module: 启用ngx_http_perl_module支持(该模块使nginx可以直接使用perl或通过ssi调用 perl)
--with-ld-opt="-Wl,-E" : 设置连接文件参数
--with-http_image_filter_module: 第三方模块(模块生成缩略图)
转载地址:http://hbie.baihongyu.com/