问题:

  重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)

解决方法:

  (1)进入 cd /usr/local/nginx/conf/ 目录,编辑配置文件nginx.conf ;

  (2)在配置文件中有个注释的地方: #pid        logs/nginx.pid;

    

  (3)将注释放开,并修改为:pid    /usr/local/nginx/logs/nginx.pid;

    

  (4)在 /usr/local/nginx 目录下创建 logs 目录:mkdir /usr/local/nginx/logs

  (5)启动nginx服务:/usr/local/nginx/sbin/nginx

nginx 启动报错 “/var/run/nginx/nginx.pid" failed” 解决方法的更多相关文章

  1. nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory

    nginx 启动报错“var/run/nginx/nginx.pid" no such file or directory 今天刚搭建的nginx服务器启动时,报错“var/run/ngin ...

  2. Nginx 启动报错 “/var/run/nginx/nginx.pid" failed”

    问题: 重启虚拟机后,再次重启nginx会报错: open() "/var/run/nginx/nginx.pid" failed (2: No such file or dire ...

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

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

  4. nginx 启动报错找不到nginx.pid文件

    这个问题的出现应该是系统找不到nginx的配置文件nginx.conf,所以,我们要告诉系统配置文件的位置:' --- 使用nginx -c /usr/local/nginx/conf/nginx.c ...

  5. redis启动报错 var/run/redis_6379.pid exists, process is already running or crashed

    redis启动显示 /var/run/redis_6379.pid exists, process is already running or crashed 出现这个执行 rm -rf /var/r ...

  6. MyEclipse 启动报错:'Building workspace' has encountered a problem解决方法

    转载于:http://blog.csdn.net/v123411739/article/details/42645159 每次MyEclipse工作空间报错如下:'Building workspace ...

  7. nginx启动报错:/usr/local/nginx/sbin/nginx: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

    查看依赖库:

  8. apache启动报错:the requested operation has failed解决办法

    原因一:80端口占用 例如IIS,另外就是迅雷.我的apache服务器就是被迅雷害得无法启用! 原因二:软件冲突 装了某些软件会使apache无法启动如Dr.com 你打开网络连接->TcpIp ...

  9. ApacheHttpServer出现启动报错:the requested operation has failed解决办法

    转自:https://www.jb51.net/article/21004.htm 原因一:80端口占用 例如IIS,另外就是迅雷.我的apache服务器就是被迅雷害得无法启用! 原因二:软件冲突 装 ...

随机推荐

  1. 创建springboot项目步骤

    步骤:

  2. Android Monkey: “No activities found to run, monkey aborted”错误原因

    用monkey测试app时,输入命令adb shell monkey -p  com.example.test -v -500 发现报错, 错误输入: :Monkey: seed=13 count=5 ...

  3. tf.pad(one_hot_encoding, [[0, 0], [1, 0]], mode='CONSTANT')

    tf.pad(one_hot_encoding, [[0, 0], [1, 0]], mode='CONSTANT') tf.pad 是扩展的意思,其中[0, 0], [1, 0] 分别代表的是[上, ...

  4. python遇到的错误

    今天学习文件遇到这个错误. 这是在 text_files\vvvv.txt  之间加一个\ 就可以了,变成  text_files\\vvvv.txt,运行成功

  5. 关于小程序 scroll-view 左右横向滑动没有效果(无法滑动)问题

    https://www.cnblogs.com/miu-key/p/7606024.html

  6. python教程_1

    1.2 不同应用领域的主流操作系统 (1)桌面操作系统 (2)服务器操作系统 (3)嵌入式操作系统 (4)移动设备操作系统 1>.桌面操作系统: Windows系列(微软的.net开发) 用户群 ...

  7. ncat的使用

    由于netcat的缺陷,所以有了升级版ncat,弥补了netcat的一些不足. ncat是nmap工具包的一个工具. 服务器端 ncat -c bash --allow 192.168.1.119 - ...

  8. 在 MySQL 中创建一个中文数据库

    安装完 MySQL 后,要修改密码. step 1: SET PASSWORD = PASSWORD('your new password'); step 2: ALTER USER 'root'@' ...

  9. Leetcode:LRU Cache,LFU Cache

    在Leetcode上遇到了两个有趣的题目,分别是利用LRU和LFU算法实现两个缓存.缓存支持和字典一样的get和put操作,且要求两个操作的时间复杂度均为O(1). 首先说一下如何在O(1)时间复杂度 ...

  10. leecode 937 Reorder Log Files (模拟)

    传送门:点我 You have an array of logs.  Each log is a space delimited string of words. For each log, the ...