I am trying to run Apache 2.4 on Ubuntu 21.10. However, I cannot get userdir to work. I did everything I can possibly google, except reinstalling apache. I am normally a Windows person, so this is driving me nuts.
What I did:
- Enable userdir.conf
- Set Permission of the folder public_html into 777, and change ownership to www-data
- Add Require all granted to literally everywhere I can think of:
apache2.conf
,userdir.conf
, and the config insites-available
to include
<Directory /home/*/public_html >
Require all granted
AllowOverride All
Options +Indexes
</Directory>
Yet, for some reason, all I have is ERROR 403: Forbidden
when trying to go to http://localhost/~myusername
What could I possibly be missing?
Thank you.
2
Answers
It turns out it is "because search permissions are missing on a component of the path". So just "chmod -R 755" my entire home folder. Probably not that good of a solution, but still, it works.
Check your home directory
Then give it
If you still receive this error, make sure that directories are set with
chmod 755
but don’t run it across all files and folder, just run:The
type -d
will result only directories, and change them to755
…