0

我有一个CentoOS 6服务器,其目录通过我的 Mac 目录中的sshfs挂载:

sshfs -o allow_other dmitri@10.211.55.2:/Users/dmitri/Sites /var/www/html

但是当我尝试启动 lig​​httpd 服务器时,出现错误:

Starting lighttpd: 2013-11-20 10:34:43: (configfile.c.989) opening configfile  /var/www/html/www.example.ru/public/_engine/lighttpd.conf failed: Permission denied

Lighttpd 用户是lighttpd,但是当我切换到用户 lighttpd 时:

su lighttpd -s /bin/bash

我可以读取挂载目录中的任何文件:

bash-4.1$ whoami
lighttpd
bash-4.1$ cat /var/www/html/www.example.ru/public/_engine/lighttpd.conf
server.error-handler-404 = "/zf2.php/404"
...

我不明白为什么会发生这种情况以及如何使 lighttpd 工作。

PS(mb它会很有用):

bash-4.1$ whoami
lighttpd
bash-4.1$ pwd
/var/www/html/www.example.ru/public/_engine
bash-4.1$ ls -lh
-rw-r--r--. 1 501 games 2,3K Ноя 15 09:48 account-pages.php
-rw-r--r--. 1 501 games  23K Ноя 15 09:48 admin-pages.php
4

2 回答 2

0

您需要授予 lighttpd 访问文件的权限。卸载文件系统,运行以下命令以授予 lighttpd 对您的 Web 目录的所有权,然后再次安装文件系统。

Chown -R lighttpd:lighttpd /var/www/html
于 2013-11-23T22:26:01.723 回答
0

真正的麻烦制造者是SELinux。通过禁用它,所有的麻烦都得到了解决。

于 2013-11-26T10:09:39.417 回答