Ask Your Question

403 Forbidden (tried everything)

asked 2016-03-26 11:25:01 +0000

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 ( 2016-03-26 15:06:43 +0000 )edit

I only disabled to see if that causes it.

xxfedoraxx ( 2016-03-26 18:05:34 +0000 )edit

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

randomuser ( 2016-03-26 18:17:43 +0000 )edit

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

ifohancroft ( 2016-03-27 14:52:22 +0000 )edit

2 answers

Sort by » oldest newest most voted

answered 2016-03-26 15:07:38 +0000

updated 2016-03-27 14:40:20 +0000

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 ( 2016-03-26 18:06:25 +0000 )edit

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

xxfedoraxx ( 2016-03-26 18:07:21 +0000 )edit

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

imoj ( 2016-03-26 19:51:52 +0000 )edit

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

xxfedoraxx ( 2016-03-27 03:27:51 +0000 )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 ( 2016-03-27 20:17:56 +0000 )edit

answered 2016-03-30 10:16:41 +0000

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.


Asked: 2016-03-26 11:25:01 +0000

Seen: 378 times

Last updated: Mar 30 '16