Ask Your Question

403 Forbidden (tried everything)

asked 2016-03-26 06:25:01 -0500

xxfedoraxx gravatar image

I'm having 403 forbidden using symlink, I tried every solutions I found on google.

Turned off selinux Add followsymlink on httpd.conf and also AllowOverride all chmod every files and folder add my user to the group apache.

I also don't forget restarting the apache every changes made. What should I do? This is frustrating. When I was on mint, just make a symlink... and you're good to go.

edit retag flag offensive close merge delete



You shouldn’t disable SELinux just because you don’t understand it. It will do you well to spend 40 minutes to learn about it.

Aeyoun gravatar imageAeyoun ( 2016-03-26 10:06:43 -0500 )edit

I only disabled to see if that causes it.

xxfedoraxx gravatar imagexxfedoraxx ( 2016-03-26 13:05:34 -0500 )edit

Please share your apache configs, we're just guessing otherwise.

randomuser gravatar imagerandomuser ( 2016-03-26 13:17:43 -0500 )edit

The latest edition of the Linux Bible book has a section on SELinux that I feel is very good about learning it.

ifohancroft gravatar imageifohancroft ( 2016-03-27 09:52:22 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2016-03-26 10:07:38 -0500

Aeyoun gravatar image

updated 2016-03-27 09:40:20 -0500

Your apache user doesn’t have permission to read the folder. Change permissions. Also, your server logs will tell you this in no uncertain terms. You can find logs in /var/log/httpd/.

Update: Based on the error code you provided in your latest comment, you could try adding an Alias in your Apache configuration instead of a symlink.

edit flag offensive delete link more


Log gives me "AH00037: Symbolic link not allowed or link target not accessible"

xxfedoraxx gravatar imagexxfedoraxx ( 2016-03-26 13:06:25 -0500 )edit

How do I change permission or I mean I tried 777 775 755, chown apache:apache but still the same.

xxfedoraxx gravatar imagexxfedoraxx ( 2016-03-26 13:07:21 -0500 )edit

Did you recheck the symlink? Can you ls -la the symlinked folder? (Im guessing the symlink points to some illegal location.)

imoj gravatar imageimoj ( 2016-03-26 14:51:52 -0500 )edit

drwxr-xr-x. 5 user user 4096 Feb 3 01:12 folder

xxfedoraxx gravatar imagexxfedoraxx ( 2016-03-26 22:27:51 -0500 )edit

You have to check if the user apache can read the all path not just the destination path.

example: the symbolic link points to /opt/example

the user apache must have access to /opt and /opt/example

paulojmlopes gravatar imagepaulojmlopes ( 2016-03-27 15:17:56 -0500 )edit

answered 2016-03-30 05:16:41 -0500

genodeftest gravatar image

For security reasons (defense against an attack called directory traversal) symlinks should not be allowed in any web server. It looks like apache is behaving correctly here. Don't use symlinks, they are way too hard to get right.

edit flag offensive delete link more

Question Tools


Asked: 2016-03-26 06:25:01 -0500

Seen: 759 times

Last updated: Mar 30 '16