首页 > 系统相关 >CentOS启动nginx出现nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or

CentOS启动nginx出现nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or

时间:2024-01-30 12:11:31浏览次数:28  
标签:sbin run failed No pid nginx var

问题:
1.进入sbin:cd /usr/local/nginx/sbin/
2.启动nginx:./nginx
3.出现问题: nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)

 

原因:

没有nginx文件夹,且其下没有nginx.pid文件。

 

解决办法:

创建文件
1.进入run下:cd /var/run

2.创建nginx文件夹:mkdir nginx

3.创建nginx.pid文件:touch nginx.pid

4.进入sbin文件夹:cd /usr/local/nginx/sbin/

5.启动nginx:./nginx

6.测试是否成功:打开浏览器,地址输入localhost,出现欢迎页面

 

标签:sbin,run,failed,No,pid,nginx,var
From: https://www.cnblogs.com/xiangxiushu/p/17996829

相关文章