By Daniel Golub
Hello everyone.
I installed the lighttpd, MYSQL, ProFTPD services by the DigitalOcean guides,
I created a new user by this commands: useradd <username> passwd <username> groupadd <groupname> gpasswd -a <username> <groupname> chgrp -R <groupname> /home/<username> chmod -R g+rw /home/<username>
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/daniel-s.net/error.log” accesslog.filename = “/var/log/lighttpd/daniel-s.net/access.log” 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): http://daniel-s.net/daniel
It will show you an 403 forbidden error, even for random sub-folder (for example http://daniel-s.net/daniel/dajksdasdhjk231434)
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! http://daniel-s.net/test
Why is that?
The DigitalOcean support team referred me to this forum for an answer.
Its very important for me.
Thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Generally speaking, a user’s home directory is not public visible – hence, the 403 - Forbidden. <br> <br>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. <code>/srv/www/</code>
What’s the output of this command? <br> <br><pre>tail /var/log/lighttpd/daniel-s.net/error.log</pre>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.