在安装之前
1 2
| cd nginx-1.22.0 vim src/core/nginx.h
|
配置
1 2
| sudo yum install -y make gcc gcc-c++ pcre-devel zlib-devel ./configure --prefix=/opt/nginx/nginx
|
编译安装
1 2 3 4 5 6 7 8 9 10 11
| make make install
sudo firewall-cmd --permanent --add-masquerade
sudo firewall-cmd --permanent --zone=public --add-forward-port=port=80:proto=tcp:toport=50080 sudo firewall-cmd --reload /opt/nginx/nginx/sbin/nginx -c /opt/nginx/nginx/conf/nginx.conf
|
开启防火墙
1 2
| sudo firewall-cmd --zone=public --add-port=80/tcp --permanent sudo firewall-cmd --reload
|
问题
问题
1
| checking for C compiler ... not found
|
安装
问题
1
| the HTTP rewrite module requires the PCRE library
|
安装
1
| sudo yum install -y pcre-devel
|
每日一个日志文件
1 2 3 4 5 6 7
| http { map $time_iso8601 $logdate { '~^(?<ymd>\d{4}-\d{2}-\d{2})' $ymd; default 'date-not-found'; } access_log /opt/nginx/nginx/logs/access-$logdate.log json_log; }
|
本文地址: https://github.com/maxzhao-it/blog/post/12e2d0c0/