Nginx安装目录与编译参数教程,nginx编译参数教程


安装目录详解

[root@localhost yum.repos.d]# rpm -ql nginx
# Nginx日志轮转,用于logrotate服务的日志切割,定义周期,按天或月等切割日志
/etc/logrotate.d/nginx
# Nginx配置文件目录
/etc/nginx
# 主要配置文件
/etc/nginx/nginx.conf

/etc/nginx/conf.d
# 默认server加载的配置文件
/etc/nginx/conf.d/default.conf

# cgi配置相关,fastcgi配置
# php fastcgi时需加载fastcgi配置文件
/etc/nginx/fastcgi_params
/etc/nginx/scgi_params
/etc/nginx/uwsgi_params

# 编码转换映射转化文件
/etc/nginx/koi-utf
/etc/nginx/koi-win
/etc/nginx/win-utf
# 设置httpd协议的Content-Type与扩展名对应关系,如jpg,json,xml等
/etc/nginx/mime.types

# 用于配置出系统守护进程管理器管理方式 Centos7.2
/usr/lib/systemd/system/nginx-debug.service
/usr/lib/systemd/system/nginx.service
/etc/sysconfig/nginx
/etc/sysconfig/nginx-debug


# Nginx模块目录
/usr/lib64/nginx/modules
/etc/nginx/modules

# Nginx服务的启动管理的终端命令
/usr/sbin/nginx
# 具体的调试分析
/usr/sbin/nginx-debug

# Nginx的手册和帮助文件
/usr/share/doc/nginx-1.12.2
/usr/share/doc/nginx-1.12.2/COPYRIGHT
/usr/share/man/man8/nginx.8.gz

# Nginx缓存目录
/var/cache/nginx

# Nginx日志目录
/var/log/nginx

安装编译参数详解

[root@localhost yum.repos.d]# nginx -V
# 安装目录或路径
# Nginx主目录
--prefix=/etc/nginx
# Nginx执行命令
--sbin-path=/usr/sbin/nginx
# Nginx模块
--modules-path=/usr/lib64/nginx/modules
# Nginx配置文件
--conf-path=/etc/nginx/nginx.conf
# Nginx错误日志文件
--error-log-path=/var/log/nginx/error.log
# Nginx访问日志文件
--http-log-path=/var/log/nginx/access.log
# Nginx服务所启动的pid
--pid-path=/var/run/nginx.pid
# Nginx锁
--lock-path=/var/run/nginx.lock

# 执行对应模块时,Nginx所保留的临时性文件
--http-client-body-temp-path=/var/cache/nginx/client_temp 
--http-proxy-temp-path=/var/cache/nginx/proxy_temp 
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp 
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp 
--http-scgi-temp-path=/var/cache/nginx/scgi_temp

# 设定Nginx进程启动的用户和组,以root启动服务,实际工作进程(worker)由nginx用户执行(安全)
--user=nginx
--group=nginx

# 设置额外(优化)的参数将被添加到CFLAGS变量
--with-cc-opt=parameters

# 设置附加的参数,链接系统库
--with-ld-opt=parameters

相关内容