Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

3 Answers 3

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
</Directory>

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

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

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
</Directory>

make sure you use Require all granted instead of

Order allow,deny
Allow from all

when using apache >2.4

share|improve this answer

Your Answer

 
discard

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.