403 forbidden page on lighttpd

September 6, 2013 4.3k views
Hello everyone. I installed the lighttpd, MYSQL, ProFTPD services by the DigitalOcean guides, I created a new user by this commands: useradd passwd groupadd gpasswd -a chgrp -R /home/ chmod -R g+rw /home/ The FTP user is ok, and it can upload files. I edited the lighttpd config file and added: $HTTP["host"] =~ "(^|\.)daniel-s\.net$" { server.document-root = "/home" server.errorlog = "/var/log/lighttpd/" accesslog.filename = "/var/log/lighttpd/" server.error-handler-404 = "/e404.php" } Note that I made the /home document root for testing. Now try to access my website to the user directory (named daniel): It will show you an 403 forbidden error, even for random sub-folder (for example Now remember that the daniel folder has been created automatically by the useradd command. When I created a folder called test (without the useradd command, just by mkdir command) it does respond! Why is that? The DigitalOcean support team referred me to this forum for an answer. Its very important for me. Thanks in advance.
2 Answers
Generally speaking, a user's home directory is not public visible -- hence, the 403 - Forbidden.

Is there a specific reason why you chose a user's home directory as the web server's root? If not, try designating the root directory as something else, e.g. /srv/www/
What's the output of this command?

tail /var/log/lighttpd/
Have another answer? Share your knowledge.