Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Arch Linux and I decided to use XAMPP so I can create and test web pages. Anyway, I followed the instructions given in the site and extracted it to /opt/lampp and I also uncommented the line in /opt/lampp/etc/httpd.conf so mod_userdir will be enabled.

Now, when I try to access my user public_html (via http://localhost/~user), I get this error:

Access forbidden!

    You don't have permission to access the requested object. It is either 
    read-protected or not readable by the server.

    If you think this is a server error, please contact the webmaster.

Error 403

How do I get this to work?

share|improve this question

You need to make the public_html and the files there readable by the web server.

One way is to run chmod o+x /home/user (allow everyone to switch to the home directory) and chmod -R o+rX /home/user/public_html (make public_html and files there readable by everyone).

If you need better access controls, use ACLs.

share|improve this answer

The default httpd.conf file makes all directories unavailable:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

You need to configure Apache to allow access to your directory(s):

<Directory "/srv/httpd/htdocs">
    Order allow,deny
    Allow from all

That's at a minimum. You might have to do some other things. Get the 403 response, then look in /var/log/httpd/error_log (or wherever XAMPP puts it) to see what went on.

share|improve this answer

You need to use this

<Directory "/Users/*/Sites">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

make sure you use Require all granted instead of

Order allow,deny
Allow from all

when using apache >2.4

share|improve this answer
This did the trick. But I wonder why this is not in any of the tutorials I found. And what does "Require all granted" even mean? – donquixote Jan 13 '15 at 1:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.