怎么感觉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. 使用java.util.Timer实现定时任务,详解Thread.sleep() in a loop, probably busy-waiting问题

    很多时候,我们需要定时任务实现一些诸如刷新,心跳,保活等功能.这些定时任务往往逻辑很简单,使用定时任务的框架(例如springboot @Scheduled)往往大材小用. 下面是一个定时任务的典型写 ...

  2. 钓鱼攻击之:OFFICE 宏后门文件钓鱼

    钓鱼攻击之:OFFICE 宏后门文件钓鱼 目录 钓鱼攻击之:OFFICE 宏后门文件钓鱼 1 宏病毒介绍 1.1 Word 宏 1.2 Excel 4.0宏 2 生成 Word 宏后门 3 利用DOC ...

  3. .Net 调用 sqlserver 存储过程实例

    1.输出datatable 存储过程: create proc inparamS @inpar varchar(20) as begin select top 1 * from Address whe ...

  4. 从 B 站出发,用 Chrome devTools performance 分析页面如何渲染

    页面是如何渲染的?通常会得到"解析 HTML.css 合成 Render Tree,就可以渲染了"的回答.但是具体都做了些什么,却很少有人细说,我们今天就从 Chrome 的性能工 ...

  5. Switchquery:移动端秒级配置触达平台

    作者:京东零售 胡本奎 一 背景 随着移动互联网的快速发展,为满足各类用户及人群的体验需求,移动端的开发者们开发了丰富多彩的体验与功能.同时对于快速控制各类功能的切换.灰度,降级等能力的要求也越来越高 ...

  6. ESXi 安装 Truenas Core 解决企业共享存储免费方案

    服务器配置 创建虚拟机内存最少8+,建议选择32,CPU没啥用,我给了2,硬盘我选择了50G+8T,因为一个虚拟机无法使用两个存储池,所以全部使用非SSD硬盘,自带网卡删除,单独给一个直通网卡,建议上 ...

  7. mysql数据库新建用户,并赋予权限

    新建用户: CREATE USER 'testuser'@'LOCALHOST' IDENTIFIED BY '123456'; 赋予权限: grant select on *.* to 'testu ...

  8. python实现两张图片拼接

    纵向拼接 from PIL import Image def image_splicing(pic01, pic02): """ 图片拼接 :param pic01: 图 ...

  9. 2022-05-19内部群每日三题-清辉PMP

    1.项目经理与项目相关方开会,获得关于如何最好地向施工现场输送用品的信息和知识.这使用的是哪种沟通方法类型? A.交互式沟通 B.内部沟通 C.拉式沟通 D.推式沟通 2.一个国际团队被分配到一个项目 ...

  10. 086_Service Cloud

    最近一个Call Center的项目刚刚开始,使用的是Sales Cloud + Service Cloud 首先在sfdc上配置一个 call center等一些电话服务的url 安装一个CTI , ...