linux - Apache 2 : Failed to set up mount namespacing: Permission denied

标签 linux apache debian vps permission-denied

我有 Debian 10 的 VPS 服务器。我想用选项 PrivateTmp=true 启动 Apache2。 但在开始时它失败并出现错误:apache2.service:在步骤 NAMESPACE 生成/usr/sbin/apachectl 时失败:权限被拒绝

    ● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-11-27 17:17:43 CET; 5s ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 523 ExecStart=/usr/sbin/apachectl start (code=exited, status=226/NAMESPACE)

Nov 27 17:17:43 5091-server systemd[1]: Starting The Apache HTTP Server...
Nov 27 17:17:43 5091-server systemd[523]: apache2.service: Failed to set up mount namespacing: Permission denied
Nov 27 17:17:43 5091-server systemd[523]: apache2.service: Failed at step NAMESPACE spawning /usr/sbin/apachectl: Permission denied
Nov 27 17:17:43 5091-server systemd[1]: apache2.service: Control process exited, code=exited, status=226/NAMESPACE
Nov 27 17:17:43 5091-server systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 27 17:17:43 5091-server systemd[1]: Failed to start The Apache HTTP Server.

我检查了 tmp 的权限:

root@5091-server:~# ls -ld /tmp
drwxrwxrwt 8 root root 4096 Nov 27 17:17 /tmp
root@5091-server:~# ls -ld /var/tmp
drwxrwxrwt 2 root root 4096 Nov 27 17:17 /var/tmp

知道哪些权限是错误的吗?

最佳答案

这可以工作...

sudo sed -i -e 's,PrivateTmp=true,PrivateTmp=false\nNoNewPrivileges=yes,g' /lib/systemd/system/apache2.service
sudo systemctl daemon-reload
sudo systemctl start apache2.service
sudo systemctl status apache2.service

关于linux - Apache 2 : Failed to set up mount namespacing: Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65040703/

相关文章:

c++ - 如何在没有 root 权限的情况下更改 Linux 系统时间?

apache - 如何确定 HTTP 响应中的内容类型

Linux:解压缩包含同名文件的存档

linux - Picom 内核模糊

apache - Apache 网络服务器后面的 NodeJS 中的 JSON-API : Best practices to handle caching and compression?

r - 在 Apache Zeppelin 上安装 R

linux - Azure Web应用程序: 'docker: command not found' after I installed docker

linux - debian 安装程序上的 Bash 脚本在预置时不接受用户输入

php - gettext 没有翻译显示

linux - 什么时候 clone() 和 fork 比 pthreads 更好?