2
June
2025
Why in the web server APache возникает ошибка AH01630: client denied by server configuraTion
16:46

Why in the web server APache возникает ошибка AH01630: client denied by server configuraTion

2 June 2025 16:46

Solving a problem with the AH01630 APACH server error.

Symptoms

При открытии веб страницы при неправильной настройке прав возникает ошибка веб сервера AH01630.

In the journal of access of the error of the species.

[Mon Jun 02 13: 04: 22.143071 2025] [authz_core:error] [pid 46931] [client 127.0.0.1:52900] AH01630: client denied by server configuration: /home/user/site/ [Mon Jun 02 13: 05: 49.982705 2025] [authz_core:error] [pid 47024] [client 127.0.0.1:44616] AH01630: client denied by server configuration: /home/user/site/index.php The reason lies in the configuration of the Apache configuration. ### How to reproduce an error? sudo nano /etc/apache2/apaChe2.conf

        Options FollowSymLinkS.
        AllowOverrIDE NONE
        Require aLL Denied
![apaChe2](apache2.png?lightbox&class=img-zoomable "apache2") CTrl+O, "Enter", CtrL-X systemctl restart apache2.serVice Now, with any attempt to open the website, the AH01630 error will be issued. ### How to solve the problem? #### 1. File editingapaChe2.conf In the file ` /etc/apache2/apache2.conf` **должно быть** _Require all Granted_

        Options FollowSymLinkS.
        AllowOverrIDE All
        Require all GraNTED
Directive Allowoverride All - по желанию. Если None, то файлы .htaCCess does not work. #### 2. The inclusion of the modulea2enmod vhost_alias_mOdule for virtual hosts sudo a2enmod vhost_aliaS. sudo a2enmod mod_authz_host sudo systemctl restart apaChe2 This command is needed for the next paragraph. #### 3. Editing .Conf files in the sitesavailaBle - Virtual hosts configuration files The rights of access to sites and virtual catalogs are limited in files sudo nano /etc/apache2/sites-available/File.conf In the descriptions of the virtual host, we are looking for section Directory - он описывает папку, где лежат документы PHP и права доступа со стороны ApaChe:

    Options Indexes MultiViews
    AllowOverrIDE All
    Require aLL Denied
    Allow from 127.0.0.1
Here I _ bordered access to the test server only from the current computer_ - web server (LOCalhost) 127.0.0.1. To resolve full access from any IP addresses, you need to remove the directive "** allow from 127.0.0.1**" и разрешить доступ отовсюду **Require all Granted **. ! Starting with APache 2.4 изменился формат файла conf: удалены директивы "**Order deny,allow ** ". See Official [List of changes between versions 2.2 and 2.4](https://httpd.apache.org/docs/2.4/upgrading.html#access). !!! Enterly turn on the module `authz_host` командой `sudo a2enmod authz_host` не требуется, т.к. модули authz_host и authz_corE included by default. ~~ restart the service ~~ recalculating the file configuration files Apache after editing .Conf files sudo systemctl reload apache2.serVice or sudo apachectl -k graCEFUL #### 4. Проверка на скрытый файл .htaccess в домашнем каталоге сайта Files .htaccess действуют на каждый запрос документа веб сервера. Файл должен размещаться в домашнем каталоге документов сайта и также может содержать устаревшие директивы Order deny,aLlow. According to [official documentation for the transition from APache 2.2 на ApaChe 2.4](https://httpd.apache.org/docs/2.4/upgrading.html#access), mixing new directives [AllowoverrIDE](https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride) и старых "Order deny,aLlow " can lead to unpredictable consequences. ! It is better to indicate a host for debugging the web site in the virtual host file (**. Conf **), ! Using the directive "Allow From " в разделе , for example: ! Allow from 127.0.0.1 #### 5. Rights for accessing a web server to files Installing the correct access rights to the catalog ./Site_DIR and all files in it. CD ~ sudo chown -R www-data:www-data ./site_dir sudo find site_dir/ -type d -exec chmOD 755 {} \; sudo find site_dir/ -type f -exec chmOD 644 {} \; #### 6. Hosts file cat /etc/Hosts | Less In it earlier I previously added a line of the species 127.0.0.1 MySite Wheremysite - имя псевдонима сайта для виртуального хоста (соответствует директиве ServerName mYSITE In the file /etc /apache2/sites-available/File.conf ### Examination Checking the opening of a web page in a browser with a prefix http: // MySite - a website opens without errors.


Related publications