怎么感觉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. Android  JetPack~ ViewModel (一)   介绍与使用

      Android数据绑定技术一,企业级开发 Android数据绑定技术二,企业级开发 Android  JetPack~ DataBinding(数据绑定)(一)    集成与使用 Android ...

  2. mysql怎么设计库、设计表

    一. 设计表/库 设计思想就是要分析表每个字段的具体参数,包括但不限于以下几点: 约束? NOT NULL, PRIMARY KEY, UNIQUE KEY, DEFAULT, FOREIGN KEY ...

  3. JavaSE学习笔记(一)----java基础

    本文来自博客园,作者:{张果},转载请注明原文链接:{JavaSE学习总结(一)--java基础} 一.Java是什么 Java 是由 Sun Microsystems 在 1995 年首先发布的编程 ...

  4. Git基础操作及协作流程

    一整套流程帮你实践整个 Git 操作基础流程. 来源:https://docs.microsoft.com/zh-cn/learn/paths/intro-to-vc-git/ Git 介绍 配置 G ...

  5. js根据某个字段进行分组

    分组前数据: [ {"f1":"q","f2":"w","f3":"e",&qu ...

  6. PostgreSQL大表count方法总结及优化探讨

    PostgreSQL的MVCC是直接在原表通过增加新tuple来实现的,决定了它在大结果集count的时候性能不会太理想,因为需要对大结果集做可见性判断将会是一项繁重的工作,比如下面这种SQL: se ...

  7. LeetCode-475 供暖器

    来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/heaters 题目描述 冬季已经来临. 你的任务是设计一个有固定加热半径的供暖器向所有房屋供暖. ...

  8. pat乙级 1021个位数统计

    #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> ...

  9. ROS1 Qt5 CMake基本配置

    ############################################################################## # CMake ############# ...

  10. mysql查询最近2天数据

    SELECT * FROM jk_dzbl_zybrbljlb where jlrq >= now()-interval 2 day