Solved AH01630: client denied by server configuration / Error 500

websterPL

Verified User
Joined
Oct 7, 2021
Messages
100
Hello, after update from custombuild to custombuild 2, I see Error 500 on the page. Also in Apache error logs I have:


Code:
AH01630: client denied by server configuration: /home/admin/domains/mydomain.com/public_html/.env


DirectAdmin 1.63.3

PHP Version 7.0.33

Debian 9

Apache 2.4.51

CakePHP 2.9.2


httpd.conf for domain mydomain.com is:


Code:
<Directory "/home/admin/public_html">

        <FilesMatch "\.(inc|php|phtml|phps|php70)$">

            AddHandler "proxy:unix:/usr/local/php70/sockets/admin.sock|fcgi://localhost" .inc .php .phtml .php70

        </FilesMatch>

    <IfModule mod_fcgid.c>

        SuexecUserGroup admin admin

    </IfModule>

</Directory>


<VirtualHost IP:80 >


    ServerName www.mydomain.com

    ServerAdmin [email protected]

    DocumentRoot /home/admin/domains/mydomain.com/public_html

    ScriptAlias /cgi-bin/ /home/admin/domains/mydomain.com/public_html/cgi-bin/

    UseCanonicalName OFF

    <IfModule !mod_ruid2.c>

        SuexecUserGroup admin admin

    </IfModule>

    CustomLog /var/log/httpd/domains/mydomain.com.bytes bytes

    CustomLog /var/log/httpd/domains/mydomain.com.log combined

    ErrorLog /var/log/httpd/domains/mydomain.com.error.log

    <Directory /home/admin/domains/mydomain.com/public_html>

        <FilesMatch "\.(inc|php|phtml|phps|php70)$">

            <If "-f %{REQUEST_FILENAME}">

                #ProxyErrorOverride on

                AddHandler "proxy:unix:/usr/local/php70/sockets/admin.sock|fcgi://localhost" .inc .php .phtml .php70

            </If>

        </FilesMatch>

    </Directory>

      RewriteEngine on

      RewriteOptions inherit

</VirtualHost>


<VirtualHost IP:443 >

    SSLEngine on

    SSLCertificateFile /usr/local/directadmin/data/users/admin/domains/mydomain.com.cert.combined

    SSLCertificateKeyFile /usr/local/directadmin/data/users/admin/domains/mydomain.com.key

    ServerName www.mydomain.com

    ServerAdmin [email protected]

    DocumentRoot /home/admin/domains/mydomain.com/private_html

    ScriptAlias /cgi-bin/ /home/admin/domains/mydomain.com/public_html/cgi-bin/

    UseCanonicalName OFF

    <IfModule !mod_ruid2.c>

        SuexecUserGroup admin admin

    </IfModule>

    CustomLog /var/log/httpd/domains/mydomain.com.bytes bytes

    CustomLog /var/log/httpd/domains/mydomain.com.log combined

    ErrorLog /var/log/httpd/domains/mydomain.com.error.log

    <Directory /home/admin/domains/mydomain.com/private_html>

        <FilesMatch "\.(inc|php|phtml|phps|php70)$">

            <If "-f %{REQUEST_FILENAME}">

                #ProxyErrorOverride on

                AddHandler "proxy:unix:/usr/local/php70/sockets/admin.sock|fcgi://localhost" .inc .php .phtml .php70

            </If>

        </FilesMatch>

    </Directory>

      RewriteEngine on

      RewriteOptions inherit

</VirtualHost>


Adding this below also dont work.


Code:
<Directory /home/admin/domains/mydomain.com/public_html>

Require all granted

</Directory>


All rebuild and nothing. If someone can help me, that will be great !
 
Last edited:
There is no such file like ".env" in public_html. When I removed .htaccess then the 404 Error appear.
 
Did you read the whole thread in the link I gave ? maybe you can find some kind of tips I hope

EDIT: If that doesn't help may helps resetting permissions on your server :
 
Last edited:
I dont have laravel here, just CakePHP. Sometimes I also have that errors:

Code:
[Mon Dec 13 22:33:02.412521 2021] [proxy:error] [pid 12582:tid 139749150869248] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /usr/local/php70/sockets/admin.sock (*) failed

[Mon Dec 13 22:33:02.412552 2021] [proxy_fcgi:error] [pid 12582:tid 139749150869248] [client 185.191.171.33:12090] AH01079: failed to make connection to backend: httpd-UDS

Ok, will try permission reset.
 
Try to rewrite conf:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs

Is it an option to upgrade your php ? 7.0 is EOL
 
Did you rewrite confs ?

Ok I'am almost out of ideas, maybe this then:
Forbidden You don’t have permission to access / on this server
You should check directory permissions: namei -l /var/www/html/, if permissions are fine you need check virtual host configuration if there are no such options like ‘Deny from all’, if virtual host fine, you need search for .htaccess like this: find / -type f -name .htaccess
 
Of course that I rewrite conf many times, also i did DirectAdmin perrmision fix but dont work. I tkink that this must be something in httpd.conf.
 
want to share the contents of the .htaccess file ?
 
Last edited:
On some systems the pre-install commands need to be done again. Did you do that?
For Debian 9 it's this:
Code:
apt-get update
apt-get install wget gcc g++ make flex bison openssl libssl-dev perl perl-base perl-modules libperl-dev libperl4-corelibs-perl libaio1 libaio-dev \
zlib1g zlib1g-dev libcap-dev cron bzip2 zip automake autoconf libtool cmake pkg-config python libdb-dev libsasl2-dev \
libncurses5-dev libsystemd-dev bind9 dnsutils quota patch libjemalloc-dev logrotate rsyslog libc6-dev libexpat1-dev \
libcrypt-openssl-rsa-perl libnuma-dev libnuma1 ipset
If anything new will be installed I would suggest to run a ./build update and ./build all d again.

However this looks more like cakephp related.

Maybe this helps to find a solution:
 
The problem is FIXED. Server config was OK but the application not. That's a little strange - recovery "Model" folder made a magic.
 
Find "Model" folder by name and replace it from backup. This is crash by app site, not server.
 
Back
Top