client denied by server configuration

Sudah lama gak mengadministrasi sebuah web server,┬ápagi ini perlu membuat web server untuk sebuah aplikasi baru dan kebingungan karena error “client denied by server configuration” pada virtual host yang akan dipakai.

Setelah membuat virtualhost seperti biasa:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName test.noorazam.my.id
        DocumentRoot /home/noorazam/klas/
        <Directory /home/noorazam/klas>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

 

Ternyata setelah dicoba virtualhost web itu forbidden untuk akses ke root:
Screen Shot 2015-12-12 at 8.37.15 AM

 

Di dalam error.log pun dinyatakan “client denied by server configuration”:

noorazam@debian:~$ sudo tail /var/log/apache2/error.log
[Fri Dec 11 15:58:33.931864 2015] [core:notice] [pid 10229] AH00094: Command line: '/usr/sbin/apache2'
[Fri Dec 11 15:58:43.087392 2015] [authz_core:error] [pid 10234] [client 10.10.10.1:53527] AH01630: client denied by server configuration: /home/noorazam/klas/
[Fri Dec 11 15:59:47.168294 2015] [mpm_prefork:notice] [pid 10229] AH00169: caught SIGTERM, shutting down
[Fri Dec 11 15:59:48.229614 2015] [mpm_prefork:notice] [pid 10286] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
[Fri Dec 11 15:59:48.229674 2015] [core:notice] [pid 10286] AH00094: Command line: '/usr/sbin/apache2'
[Fri Dec 11 15:59:54.308103 2015] [authz_core:error] [pid 10292] [client 10.10.10.1:53538] AH01630: client denied by server configuration: /home/noorazam/klas/
[Fri Dec 11 15:59:54.574502 2015] [authz_core:error] [pid 10292] [client 10.10.10.1:53538] AH01630: client denied by server configuration: /home/noorazam/klas/favicon.ico, referer: http://test.noorazam.my.id/

 

Cukup bingung juga, kenapa ada konfigurasi yang tidak memperbolehkan virtual host itu diakses??

Setelah cukup lama, aksi terakhir ada tanya si mBah Google. Dan benar ada info bahwa server yang aku pakai ternyata versi yang baru:

noorazam@debian:~$ sudo apache2 -v
Server version: Apache/2.4.10 (Debian)
Server built: Aug 28 2015 16:28:08

Untuk server versi ini perlu ada tambahan setting “Require all granted” di virtual host, sehingga menjadi:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName test.noorazam.my.id
        DocumentRoot /home/noorazam/klas/
        <Directory /home/noorazam/klas>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
                Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Semoga bermanfaat.


Leave a Reply