1

I'm currently running the Apache webserver on Fedora 29 and am facing directory access issues.

I can run php and HTML files located in …/www/html/applications/views just fine, but encounter the 403 Forbidden Error when I try running scripts located in …/www/html/applications/controllers.

I tried matching the permissions of the latter directory and its contents to those of the former, but to no avail. I tried switching ownership over to the current user and modifying the permissions yet again, but I still encounter this error.

Also, I've checked the apache server error logs and there seems to be nothing related to this (concluded from the fact that the last error it shows is dated May 22 while the last rerun of the php scripts was on May 25, correct me if I'm wrong). The following are the 3 latest error messages :

[Wed May 22 22:40:07.338339 2019] [lbmethod_heartbeat:notice] [pid 17890:tid 139756349729024] AH02282: No slotmem from mod_heartmonitor

[Wed May 22 22:40:07.350863 2019] [mpm_event:notice] [pid 17890:tid 139756349729024] AH00489: Apache/2.4.39 (Fedora) OpenSSL/1.1.1b mod_perl/2.0.10 Perl/v5.28.2 configured -- resuming normal operations

[Wed May 22 22:40:07.350906 2019] [core:notice] [pid 17890:tid 139756349729024] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Also, given below is the content of the .htaccess file:

<IfModule authz_core_module>
    Require all denied
</IfModule>
<IfModule !authz_core_module>
    Deny from all
</IfModule>

Any idea about what is going on and how I can fix it?

  • FIle permissions on the host file system, SELinux or similar ACLs in play beyond the normal UGO/RWX permissions model, something in a .htaccess file, something in the actual application blocking access and replying to your request with the 403 .... – ivanivan May 25 at 17:08
  • Edit your post and include the actual error message from the Apache logs. – Jim L. May 26 at 2:30
  • @ivanivan I've edited the post to include the content of the .htaccess file located in /var/www/html/applications. Please have a look and let me know if anything's wrong. – S P Kausthubh May 26 at 14:30
  • @JimL. I've included the last 3 error messages from the error logs. Please let me know if you want me to include older errors too. – S P Kausthubh May 26 at 14:31
1

The Deny from all is Apache 2.2 syntax and Require all denied is Apache 2.4 syntax.

https://httpd.apache.org/docs/2.4/upgrading.html#access

In this example, there is no authentication and all requests are denied.

2.2 configuration:
Order deny,allow
Deny from all

2.4 configuration:
Require all denied

https://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#deny

Syntax: Deny from all|host|env=[!]env-variable [host|env=[!]env-variable] ...

This directive allows access to the server to be restricted based on hostname, IP address, or environment variables. The arguments for the Deny directive are identical to the arguments for the Allow directive.

https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require

Require all denied
       Access is denied unconditionally.

As you didn't say where the .htaccess is located I can't tell why …/www/html/applications/views is working and …/www/html/applications/controllers is not. But the content of your .htaccess says that all access is denied for Apache 2.2/2.4.

  • Thanks for the answer. I have taken a look at the links you've included, and changed the content of the .htaccess file to allow all requests, but the problem still persists. The .htaccess file is located in .../www/html/applications. Also, is it safe to allow all access like this? – S P Kausthubh May 27 at 5:48
  • I don't think this has got to do with the .htaccess file, since I tried deleting the file altogether and reloading the scripts to get the same result. Also, as of now, there are no hidden files or files related to configuration in .../application or .../application/controllers or .../application/views and their subdirectories. @Freddy – S P Kausthubh May 28 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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