[Solved] mod 'userdir' doesn#t work: need to change permissions ?
Added by vincentm77 over 2 years ago
Hi everyone,
I installed lighttpd on Linux Ubuntu Studio 22.04
I can see a web page when I go to http://localhost.
However, I cannot see the index.html page I put in /home/vincent/public_html/
Mod 'userdir' was loaded and activated.
Do I need to set special permissions for that directory/file ?
Do all data that I want to be broadcats by lighttpd need to be owned by www-data ?
Any help very appreciated !
Best,
Vincent
Replies (5)
RE: mod 'userdir' doesn#t work: need to change permissions ? - Added by gstrauss over 2 years ago
The user running the lighttpd daemon (e.g. www-data) needs permission to read the files that lighttpd servers, and needs to be able to traverse the directories to the files that lighttpd serves. If your home directory is mode 0700, then the www-data user will not be able to reach /home/vincent/public_html/index.html
RE: mod 'userdir' doesn#t work: need to change permissions ? - Added by vincentm77 over 2 years ago
gstrauss wrote in RE: mod 'userdir' doesn#t work: need to change permissions ?:
The user running the lighttpd daemon (e.g. www-data) needs permission to read the files that lighttpd servers, and needs to be able to traverse the directories to the files that lighttpd serves. If your home directory is mode 0700, then the www-data user will not be able to reach /home/vincent/public_html/index.html
Thanks GStrauss,
If I give write-permission to 'others' for /home/vincent/public_html/index.html, shouldn't lighttpd be able to show that file ???
Or should I simply
chown www-data -R /home/vincent/publich_html/
???
Thanks for your help
V
RE: mod 'userdir' doesn#t work: need to change permissions ? - Added by gstrauss over 2 years ago
Neither.
Why do you need to serve files from your userdir? You do not seem to have the basic knowledge required to serve files correctly from userdirs, so I recommend you simply serve files from the lighttpd document root, and give yourself permission to put files there.
RE: mod 'userdir' doesn#t work: need to change permissions ? - Added by vincentm77 over 2 years ago
you are probably right, thanks !
RE: mod 'userdir' doesn#t work: need to change permissions ? - Added by gstrauss over 2 years ago
good choice not to muck your your homedir permissions.
There are security implications to chmod o+x
, especially on a home directory.
Also, on some systems, SELinux protections require extra steps to allow the web server access to userdirs underneath the homedir.