怎么感觉Linux的nGinx比Win的事一个一个一个的多啊(半恼)

运行systemctl status nginx时提示:

① Process: 123456 ExecStartPre=/usr/local/nginx/sbin/nginx -t (code=exited, status=203/EXEC)

这是【nginx.service】里配置绝对路径不匹配的问题:

cp /usr/lib/systemd/system/nginx.service /usr/lib/systemd/system/nginx.service.bak

vim /usr/lib/systemd/system/nginx.service

源文件显示可能是

[Unit]

Description=The NGINX HTTP and reverse proxy server

After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]

Type=forking

PIDFile=/usr/local/nginx/logs/nginx.pid

ExecStartPre=/usr/local/nginx/sbin/nginx -t

ExecStart=/usr/local/nginx/sbin/nginx

ExecReload=/usr/local/nginx/sbin/nginx -s reload

ExecStop=/bin/kill -s QUIT $MAINPID

ExecStartPost=/bin/sleep 0.1

PrivateTmp=true

[Install]

WantedBy=multi-user.target

更改为nginx的正确路径即可,比如我的是/usr/local/nginx/nginx-1.22.0/,则:

② Process: 123456 ExecStart=/usr/local/nginx/nginx-1.22.0/sbin/nginx (code=exited, status=1/FAILURE)

nginx.conf 文件配置问题,在nginx文件里运行

./nginx -c /usr/local/nginx/nginx-1.22.0/conf/nginx.conf

然后根据报错位置修改即可

③ Process: nginx[123456]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

端口被进程占用,kill掉即可

先检测是什么进程占用该端口

lsof -i :80

然后根据【PID】执行kill命令即可,比如上图的kill是

kill 159911

再次运行systemctl start nginx&&systemctl status nginx看看状态提示即可

[Nginx]status:203 Failed to start The NGINX HTTP and reverse proxy server的更多相关文章

  1. nginx启动报错:Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' fo

    一.背景 这个错误在重启nginx或者启动nginx的时候,经常会出现.我之前也一直认为出现这个错误是因为有程序占用了nginx的进程.但是知其然不知其所以然.每次报错都有点懵逼,所以这边一步步排查错 ...

  2. Zabbix监控nginx status

    nginx开启status ./configure --with-http_stub_status_module nginx.conflocation /statusx35 { stub_status ...

  3. 启用nginx status状态详解

    nginx和php-fpm一样内建了一个状态页,对于想了解nginx的状态以及监控nginx非常有帮助.为了后续的zabbix监控,我们需要先了解nginx状态页是怎么回事. 1. 启用nginx s ...

  4. 解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误

    重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr ...

  5. 解决nginx [error] open() "usr/local/nginx/logs/nginx.pid" failed错误

    重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之 后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/us ...

  6. Nginx status详解

    1. 启用nginx status配置 server {        listen *:80 default_server;        server_name _;        locatio ...

  7. nginx入门与实战 安装 启动 配置nginx Nginx状态信息(status)配置 正向代理 反向代理 nginx语法之location详解

    nginx入门与实战 网站服务 想必我们大多数人都是通过访问网站而开始接触互联网的吧.我们平时访问的网站服务 就是 Web 网络服务,一般是指允许用户通过浏览器访问到互联网中各种资源的服务. Web ...

  8. 关于nginx报错/usr/share/nginx/html/jiankongshare" failed (2: No such file or directory)的问题解决

    nginx的location虚拟目录配置: monitor.conf server {       server_name   monitor.chinasoft.com;       server_ ...

  9. nginx权限问题failed(13:Permission denied)

    nginx权限问题failed(13:Permission denied) 环境配置  nginx Permission denied 问题: 使用nginx代理uwsgi,出现500错误,查看ngi ...

  10. nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

    nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) ...

随机推荐

  1. C#后缀表达式解析计算字符串公式

    当我们拿到一个字符串比如:20+31*(100+1)的时候用口算就能算出结果为3151,因为这是中缀表达式对于人类的思维很简单,但是对于计算机就比较复杂了.相对的后缀表达式适合计算机进行计算. 我们就 ...

  2. 【SDOI2015】星际战争

    #include<cstdio> #include<queue> using namespace std; const int M = 10000; const double ...

  3. honoka和格点三角形

    题目: honoka最近在研究三角形计数问题.她认为,满足以下三个条件的三角形是"好三角形".1.三角形的三个顶点均为格点,即横坐标和纵坐标均为整数.2.三角形的面积为 .3.三角 ...

  4. 任何人均可上手的数据库与API搭建平台

    编写API可能对于很多后端开发人员来说,并不是什么难事儿,但如果您主要从事前端功能,那么可能还是有一些门槛. 那么有没有工具可以帮助我们降低编写API的学习门槛和复杂度呢? 今天就来给大家推荐一个不错 ...

  5. K3S 系列文章-RHEL7.8 离线有代理条件下安装 K3S

    一 基础信息 1.1 前提 本次安装的为 k3s 1.21.7+k3s1 VM 版本为 RHEL 7.8, 7.9 或 8.2, 8.3, 8.4(K3s 官网要求) VM YUM 仓库:已配置对应版 ...

  6. Word 设置脚注和尾注

    描述 脚注一般位于页面的底部,作为文档某处内容的注释.尾注一般位于文档的末尾,列出引文的出处等. 设置脚注和尾注 将光标移动到要插入脚注或尾注的地方,然后点击"引用"选项卡. 左边 ...

  7. Postgresql 锁等待检测及处理

    背景 对于多数数据库,dba技能之一就是查找锁.锁的存在有效合理的在多并发场景下保证业务有序进行.下面我们看一下Postgresql中查找阻塞的方法. 1.找到"被阻塞者",获取被 ...

  8. Linux route命令修改默认路由优先级

    (自测可用)摘自:https://www.cnblogs.com/luoyang712/p/11953256.html 在多个网络连接的情况下,比如以太网和WIFI同时存在的时候,路由表中就会存在多个 ...

  9. HP DC7800 升级CPU出现:Missing or Invalid Processor Microcode Update —— 解决方案:更新主板BIOS

    1.所需文件在这个网盘里面:链接:https://pan.baidu.com/s/140DI2SyRmPf0Q-ikXcJMcQ 提取码:yjth 2.这个问题的解决参考了:https://h3043 ...

  10. calico 关闭SNAT

    calico 关闭SNAT 默认情况下,calico 访问集群外网络是通过 SNAT 成宿主机 ip 方式,在一些金融客户环境中为了能实现防火墙规则,需要直接针对 POD ip 进行进行规则配置,所以 ...