I'd like to have per-user web directories on my Linux Mint workstation in the same general way I have had on OS X. In order to do this, I created a public_html directory in ~/. and chmod'd it to 755 and installed the userdir mod:
sudo a2enmod userdir
sudo /etc/init.d/apache2 restart
From what I understand of how usermod works, there should be no need to create vhost configs by hand, but even so I get this when I try to access http://127.0.0.1/~myusername:
Forbidden
You don't have permission to access /~dxh on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80
Am I missing some mysterious extra step?
Best Answer
I'd check a few things.
Directory permissions: If your home directory is /home/dxh/ and you just created /home/dxh/public_html/ to hold your web content, make sure the parent level directories are allowing access:
The permissions need to be at least '711' for each of these directories. That means the output of the 'ls' command above should look like this:
or
Index Pages/Indexes
Next, Apache might throw a 403 forbidden error if you don't have an 'index' file in your public_html folder AND don't have Indexes enabled.
solution 1: create an index.html file
solution 2: enabled Indexes in your .htaccess file
Note: Enabling Indexes will show the entire contents of your public_html folder. If you have sensitive stuff in there, don't enable it.
Otherwise, check your apache logs. Run
and then hit the page a few times to see what error pops up.