Tor*_*xO7 5 permissions nginx arch-linux nextcloud
目前,我已经设置了一个 nextcloud 服务器nginx并使用 启用了它sudo systemctl enable nginx.service。当我重新启动时,我收到一条错误消息,抱怨代理服务器,如果我查看一下sudo systemctl status nginx.service,我会收到以下消息:
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2020-11-14 12:20:55 CET; 16min ago
Nov 14 12:20:55 TORNAX-ARCH systemd[1]: Starting A high performance web server and a reverse proxy server...
Nov 14 12:20:55 TORNAX-ARCH nginx[473]: 2020/11/14 12:20:55 [warn] 473#473: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_si>
Nov 14 12:20:55 TORNAX-ARCH nginx[473]: 2020/11/14 12:20:55 [emerg] 473#473: bind() to 192.168.178.35:443 failed (99: Unknown error)
Nov 14 12:20:55 TORNAX-ARCH systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Nov 14 12:20:55 TORNAX-ARCH systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 14 12:20:55 TORNAX-ARCH systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Run Code Online (Sandbox Code Playgroud)
如果我跑步nginx -t,我会得到这个:
2020/11/14 12:37:40 [warn] 68391#68391: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2020/11/14 12:37:40 [emerg] 68391#68391: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed
Run Code Online (Sandbox Code Playgroud)
当我寻找有关此open() "/run/nginx.pid" failed (13: Permission denied)错误的解决方案时,我只获得 docker + nginx 的解决方案,如下所示:
手动重新启动服务后它可以工作,但当我运行时sudo systemctl restart nginx.service我仍然收到.open() "/run/nginx.pid" failed (13: Permission denied)nginx -t
我做错了什么或者我可以做什么来解决这个问题?
小智 11
sudo nginx -t
在我看来,这个评论应该是一个答案。
\nRun nginx -t as root. This is a red herring. \xe2\x80\x93 Michael Hampton Nov 15 at 0:27
小智 2
这可能是一个错误。“此行为是一个已知错误,由 nginx 和 systemd 之间的竞争条件引起。Systemd 期望在 nginx 有时间创建 PID 文件之前填充该文件。” https://www.cloudinsidr.com/content/heres-fix-nginx-error-failed-read-pid-file-linux/
无论如何,如果网站再次关闭,请按照以下步骤进行修复:
mkdir -p /etc/systemd/system/nginx.service.d
Run Code Online (Sandbox Code Playgroud)
/etc/systemd/system/nginx.service.d/override.conf:[Service]
ExecStartPost=/bin/sleep 0.1
Run Code Online (Sandbox Code Playgroud)
[Service]
ExecStartPost=/bin/sleep 0.1
Run Code Online (Sandbox Code Playgroud)
systemctl daemon-reload
Run Code Online (Sandbox Code Playgroud)
systemctl restart nginx
Run Code Online (Sandbox Code Playgroud)
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864
| 归档时间: |
|
| 查看次数: |
41268 次 |
| 最近记录: |