Pergunta

I've got a CentoOS 6 server with a directory mounted via sshfs from my Mac directory:

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

but when I try to start lighttpd server, I get an error:

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 user is lighttpd, BUT when I'm swithing to user lighttpd:

su lighttpd -s /bin/bash

I can read any files in mounted directory:

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"
...

I can't understand why it happens and how to make lighttpd work.

PS (mb it would be useful):

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
Foi útil?

Solução 2

The actual troublemaker was SELinux. All the troubles have been solved by disabling it.

Outras dicas

You need to give lighttpd permission to access the files. Unmount the file system, run the following command to give lighttpd ownership of your web directory, then mount the files system again.

Chown -R lighttpd:lighttpd /var/www/html
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top