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?

4
  • 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
    Commented May 25, 2019 at 17:08
  • Edit your post and include the actual error message from the Apache logs.
    – Jim L.
    Commented May 26, 2019 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. Commented May 26, 2019 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. Commented May 26, 2019 at 14:31

1 Answer 1

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.

2
  • 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? Commented May 27, 2019 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 Commented May 28, 2019 at 5:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .