Supervisor 管理 Nginx 报错
文章
林里克斯
使用进程管理工具 Supervisor
管理 Nginx
报错处理
实验平台:CentOS 7.7.1908
1.Supervisor
搭建这里就不细说了,需要的自取
点我 --> 用 Supervisor 批量管理进程
2.nginx.ini
$ cat /etc/supervisord.d/nginx.ini
[program:nginx]
command=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf -g 'daemon off;'
directory=/usr/local/nginx/
autostart=true
autorestart=true
user=nginx
redirect_stderr=true
stdout_logfile=/usr/local/nginx/logs/nginx_stdout.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10
stdout_capture_maxbytes=10MB
stderr_logfile=/usr/local/nginx/logs/nginx_errot.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=10
stderr_capture_maxbytes=10MB
log_stdout=true
log_stderr=true
3.使用 Supervisor
启动 Nginx
报错
$ supervisorctl start nginx
nginx: ERROR (abnormal termination)
4.查看报错
$ tail -1f /usr/local/nginx/logs/nginx_stdout.log
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
5.原因
Linux
只有 root
用户可以使用 1024
以下的端口
6.解决方法
1). /usr/local/nginx/conf/nginx.conf
文件中的 80
端口改为 1024
以上
$ vim /usr/local/nginx/conf/nginx.conf
server {
listen 8080;
#将监听端口修改为 8080
server_name localhost;
location / {
root html;
index index.html index.htm;
}
}
2).修改为 root
用户
[program:nginx]
command=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf -g 'daemon off;'
directory=/usr/local/nginx/
autostart=true
autorestart=true
user=root
#修改为 root
redirect_stderr=true
stdout_logfile=/usr/local/nginx/logs/nginx_stdout.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10
stdout_capture_maxbytes=10MB
stderr_logfile=/usr/local/nginx/logs/nginx_errot.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=10
stderr_capture_maxbytes=10MB
log_stdout=true
log_stderr=true
Over~
版权协议须知!
本篇文章来源于 Uambiguous ,如本文章侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
1434 0 2020-09-08
博主卡片
运维时间
搭建这个平台,只为分享及记载自己所遇之事和难题。
现在时间 2025-02-22
今日天气
随机推荐
01-26
Tomcat详解(二)
10-27
Shell 脚本判断上一个执行内容是否执行成功
12-08
Linux 使用环境变量曲向获取 root 权限
11-05
Linux 内普通用户家目录下的隐藏文件详解
09-15
Nginx 配置文件 Nginx.conf 详解
01-17
Python 之路之 Python 基础 (一)
站点统计
- 文章总数:241篇
- 分类总数:29个
- 评论总数:14条
- 本站总访问量 380742 次
@svmuvwpuqi 真棒!
@smdxydrauu 博主太厉害了!
@xiaozi 最后的分享的镜像下载地址打不开 服务器没有开机吗?
@yuanyuan 为什么我的4b安装centos7.9 插上tf卡 显示不兼...
@Wong arrhenius 牛比
@MakerFace 厉害了!
@TongSir 老哥 更新下我的友链链接 https://blog.ton...