DevHeads.net

403 Forbidden Error on Apache 2.4

Dear All,
Our Site is Public Site and there is no restriction @ any level. We are
using apache on top of Java based CMS (Tomcat Server).
Recently we upgraded Apache from 2.2.21 to 2.4.25. Where ever Order
allow,deny & Allow from all coming there we changed it to Require all
granted but root page only loading without any issue. We are getting 403
Forbidden Message on Rest of the Pages. Kindly please help how to enable
permission to all folder and its subfolders in 2.4.25.

For Example:
Working:
<a href="http://domain.com/sites" title="http://domain.com/sites">http://domain.com/sites</a>

Notworking:
<a href="http://domain.com/newsroom" title="http://domain.com/newsroom">http://domain.com/newsroom</a>
<a href="http://domain.com/events" title="http://domain.com/events">http://domain.com/events</a>
<a href="http://domain.com/about" title="http://domain.com/about">http://domain.com/about</a>
& Other pages

RewriteEngine on
RewriteRule ^/+$ /sites/ [R,L]
DocumentRoot "/apps/apache2.4"
<Directory />
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>

Comments

Re: 403 Forbidden Error on Apache 2.4

By Dan Ehrlich at 02/06/2019 - 00:03

I think it’s the L in your rewrite rule.

It stands for Last and means it won’t process any further rules. Remove it and it should (maybe) work.

Someone else feel free to correct me if I’m wrong.

Re: 403 Forbidden Error on Apache 2.4

By Daniel Ferradal at 02/06/2019 - 16:04

Directory / is the root of the filesystem, so it should always be set
in server config with Require all denied, it is not the documentroot,
chances are you have a Directory directive elsewhere denying, also
make 100% sure you don't mix Order/Allow/Deny with 2.4 directives.

So:

Server config
<Directory />
Require all denied
</Directry>

in virtualhost and for documentroot:

<Virtualhost *:port>
DocumentRoot /path/do/docroot

###
# Other directives here

<Directory /path/to/docroot>
Require all granted
</Directory>

<Virtualhost>

El mié., 6 feb. 2019 a las 6:03, Dan Ehrlich
(< ... at ehrlichserver dot com.invalid>) escribió: