`

解决nginx重启“var/run/nginx/nginx.pid" no such file or directory问题

 
阅读更多
进入nginx的安装目录:
cd  /usr/local/nginx/conf/
vi  nginx.conf 

看到被注释掉的地方:
#pid logs/nginx.pid;

去掉注释,在conf同级目录下建立logs目录并创建nginx.pid

执行
chmod 755 logs 
chmod 755 nginx.pid

重启后即可发现启动nginx一切正常

 

分享到:
评论

相关推荐

    重启或杀掉Nginx进程后丢失nginx.pid的解决办法

    Restarting nginx daemon: nginxcat: /usr/local/nginx/logs/nginx.pid: No such file or directorykill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]nginx not ...

    Nginx常见错误及解决方法.doc

    sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory 这种错误是由于环境中缺少 libpcre.so.1 文件所致。解决方法是创建一个软链接: ...

    Nginx通过/etc/init.d/nginx方式启停【nginx配置文件】

    vi /etc/init.d/nginx 修改nginx后 chmod +x /etc/init.d/nginx /sbin/chkconfig nginx on sudo /sbin/chkconfig --list nginx /etc/init.d/nginx start

    Nginx启动常见错误及解决方法

    登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx....

    nginx connect() to unix:/var/run/php-fpm.sock failed (11: Resource temporarily unavailable)

    通过以上步骤,通常可以解决“nginx connect() to unix:/var/run/php-fpm.sock failed (11: Resource temporarily unavailable)”的问题,确保Nginx和PHP-FPM的稳定运行,为用户提供流畅的网站体验。

    Nginx RPM 包定制制作

    /application/nginx-1.6.3/logs/nginx.pid /application/nginx-1.6.3/proxy_temp /application/nginx-1.6.3/sbin/nginx /application/nginx-1.6.3/scgi_temp /application/nginx-1.6.3/uwsgi_temp [root@nginx tools...

    开机自起nginx

    PIDFile=/usr/local/nginx/logs/nginx.pid ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf #...

    nginx安装教程

    --pid-path=/usr/local/nginx/nginx.pid \ --with-http_ssl_module \ --with-pcre=/usr/local/src/pcre-8.41 \ --with-zlib=/usr/local/src/zlib-1.2.11 \ --with-openssl=/usr/local/src/openssl-1.0.1t sudo make...

    带rtmp模块的nginx安装脚本

    5. **配置Nginx**:进入Nginx源代码目录,运行`./configure`命令,添加RTMP模块的支持。配置参数可能包括`--add-module=rtmp_module_path`,指定RTMP模块的路径。 6. **编译和安装Nginx**:使用`make`命令编译源...

    nginx安装配置全攻略

    nginx pid file: "/var/run/nginx/nginx.pid" nginx error log file: "/var/log/nginx/error.log" nginx http access log file: "/var/log/nginx/access.log" nginx ...

    Nginx常见错误

    #### 一、启动错误:`sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory` **问题描述**: 在尝试启动Nginx时,可能会遇到如下的错误...

    nginx详细安装手册.doc

    --pid-path=/var/run/nginx/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --with-http_gzip_static_module \ --...

    centos8 nginx1.20.1 与nginx配置文件

    PIDFile=/var/run/nginx.pid Type=forking [Install] WantedBy=multi-user.target ``` 保存并关闭文件,然后启动Nginx服务并设置开机启动: ```bash sudo systemctl start nginx sudo systemctl enable nginx ``` ...

    Nginx配置TCP/UDP调度器.doc

    1. 修改Nginx配置文件 `/usr/local/nginx/conf/nginx.conf`。添加`stream`块来处理TCP/UDP流量,以及一个名为`sshserver`的上游服务器池,包含后端SSH服务器的IP和端口: ``` stream { upstream sshserver { ...

    Nginx1.8.0安装简述

    error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory 五、启动 Nginx 安装完成后,需要启动 Nginx 服务器: /usr/local/webserver/nginx/sbin/...

    阿里云服务器配置nginx+https

    --pid-path=/usr/local/nginx/conf/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --with-http_gzip_static_module \...

Global site tag (gtag.js) - Google Analytics