nginx官网 nginx.org
# nginx版本
Mainline version 开发版本
Stable version 稳定版本
Legacy version 历史版本的升级
# pgp安全校验工具 校验nginx包的是否有注入等安全隐含
#CHANCE 版本更新信息
# 安装
1. yum方式
a)点击stab版本,copy nginx的yum源,在linux上新建nginx的repo文件,vim /etc/yum.repos.d/nginx.repo
b)复制yum源到linux,修改源中系统版本信息 OS/OSRELEASE => centos/7
c) yum list| grep nginx
d) yum install nginx-
e) nginx -v 查看版本
f) nginx -V 查看编译参数
nginx版本,编译的gcc版本,支持ssl ,
--prefix=/etc/nginx 安装目录
--sbin-path=/usr/sbin/nginx 执行文件路径
--modules-path= nginx模块路径
--error-log-path
--http-log-path
--conf-path。。。。
--with-xxxx_module 安装的插件
--http-client-body-temp-path=/var/cache/nginx 缓存路径
fcgi。。。。等
--user=nginx指定了以nginx用户进行启动
--group=nginx 用户组
--with-cc-opt=设置额外参数被添加到CFLAGS内
--with-ld-opt 设置附件参数链接系统库
2. 官网下载方式
2.1 源码安装
2.2 下载可执行程序
# 安装目录
rpm -qa|grep nginx 命令可以查看安装路径
## /etc/logrotate.d/nginx nginx日志轮转,用logrotate服务进行日志切割
配置eg:
[root@hs-10-20-64-224 logrotate.d]# cat yum
/var/log/yum.log {
missingok
notifempty
size 30k
yearly
create 0600 root root
}
[root@hs-10-20-64-224 logrotate.d]# cat syslog
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
## /etc/nginx/
nginx.conf 主要配置文件
conf.d/default.conf
## fastcgi_xx php cgi模式
## uwsgi_xx
## scgi_xx
## koiXXX win-utf
## conf/mime.types content-type类型及扩展名对应关系
text/html html htm shtml;
## /var/cache/nginx 缓存目录
## /var/log/nginx 日志目录