web apps in /var/www/html with 403 error

gate2vn

Verified User
Joined
Nov 9, 2004
Messages
483
Location
Oslo
All apps there returns 403 error. I tried ip/webmail, domain/webmail... all 403.
Try to update CB2, rewrite_confs, not solved.

In /etc/httpd/conf/extra/httpd-hostname.conf

Code:
<Directory /var/www/html>
	Options +SymLinksIfOwnerMatch +IncludesNoExec -Indexes
	AllowOverride AuthConfig FileInfo Indexes Limit Options=Includes,IncludesNOEXEC,Indexes,ExecCGI,MultiViews,SymLinksIfOwnerMatch,None

	Require all granted

# ls -l /var
dr-xr-x--x 10 webapps nginx 4096 Dec 20 2014 www

# ls -l /var/www
drwxr-xr-x 11 webapps webapps 4096 Jan 9 23:09 html

# ls -l /var/www/html
total 655836
-rw-r--r-- 1 webapps webapps 43 Jan 9 23:09 index.html
lrwxrwxrwx 1 webapps webapps 44 Jan 8 17:36 phpMyAdmin -> /var/www/html/phpMyAdmin-4.7.7-all-languages
drwxr-xr-x 13 webapps webapps 4096 Jan 8 17:36 phpMyAdmin-4.7.7-all-languages
-rwxr-xr-x 1 root root 68 May 31 2011 redirect.php
lrwxrwxrwx 1 webapps webapps 19 Jan 9 21:34 roundcube -> roundcubemail-1.3.3
drwxr-xr-x 12 webapps webapps 4096 Jan 9 23:27 roundcubemail-1.3.3
lrwxrwxrwx 1 webapps webapps 33 Jan 9 21:38 squirrelmail -> squirrelmail-1.4.23-20170731_0200
drwxr-xr-x 17 webapps webapps 4096 Jan 9 21:38 squirrelmail-1.4.23-20170731_0200

Tried chown webapps:webapps /var/www, it didn't solve the problem.

In /var/log/httpd/error_log, it shows
[access_compat:error] [pid 1047463:tid 140428351859008] [client xx.xxx.xxx.xxx:46081] AH01797: client denied by server configuration: /var/www/html/403.shtml

But then I have no idea any where else to check. Any help please?
 
It looks like something is broken in your Apache Configuration file which needs to be investigated thoroughly by a system administrator. If you have got a managed server then contact your hosting provider for further assistance. :)
 
@24x7server: Your comment is not helpful, and it seems to me you only make the comments to promote your forum signature.

@gate2vn: Probably not related, but could be: After I upgraded to PHP 7.1.13, on one of my servers I have already two times on two days after each other, experienced that Roundube give this error in browser (URL is on https://server.hostname.tld/roundcube):

Code:
Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Additionally, a 503 Service Unavailable error was encountered while trying to use an ErrorDocument to handle the request.

And in /var/log/httpd/error_log I get this:
Code:
[Wed Jan 10 11:07:10.167008 2018] [proxy_fcgi:error] [pid 26262:tid 139668105803520] (104)Connection reset by peer: [client 176.74.214.18:52064] AH01075: Error dispatching request to :

As soon as I do a reload of php-fpm, then Roundcube works correct again. However it seems to happen about one time each day. I have several servers, and it only happen on one of them so far. By the way I am running CentOS 7 and PHP-FPM with OPcache endabled.
 
@ditto: thanks for replying. I tried to rebuild PHP, even downgraded PHP, but it didn't fix. Now, I am checking every included file, hope that I can find out the reason somewhere.

And I agreed with your comment about that spam!
 
Hi,

Maybe Apache has no rights to var/www/ ?

You could try
Code:
chmod a+X /var/www

What is the content of /etc/httpd/conf/extra/httpd-directories.conf ?
 
Last edited:
Somehow, the "Require all granted" is not working as expected in extra/httpd-directories.conf. When I changed back to the old config
Code:
Order allow,deny
        Allow from all
Then it resolved the problem. I am using Apache/2.4.29, so I assumed the new config should work, but it didn't. Not sure why yet, but at least, it's the reason.
 
Back
Top