Menú de contenidos
Problema
El sitio web arrojaba un error 403., unable to check htaccess file, en un servidor linux (centos) con cpanel/WHM
Solución
Al revisar el archivo error_log
tail -f /usr/local/apache/log/error_log
[Thu Jul 26 11:55:16.232033 2018] [core:crit] [pid 2341699:tid 139636808574720] (13)Permission denied: [client 190.100.00.00:49806] AH00529: /home/usuario/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/usuario/' is executable [Thu Jul 26 11:55:16.879528 2018] [core:crit] [pid 2341699:tid 139636808574720] (13)Permission denied: [client 190.100.00.00:49806] AH00529: /home/usuario/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/usuario/' is executable, referer: http://www.dominio.cl
Luego, revisamos los permisos del archivo .htaccess y del public_html, comprobando que tengan 644 y 755 respectivamente.
ls -lashit /home/usuario/public_html/.htaccess 35784379 4.0K -rw-r--r-- 1 original original 1.2K Jul 26 11:55 .htaccess
stat /home/usuario/public_html/.htaccess
File: `.htaccess' Size: 1197 Blocks: 8 IO Block: 4096 regular file Device: 904h/2308d Inode: 35784379 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1064/original) Gid: ( 1063/original) Access: 2018-07-26 12:00:12.138974876 -0400 Modify: 2018-07-26 11:55:13.479975080 -0400 Change: 2018-07-26 11:57:31.657974986 -0400
stat /home/usuario/public_html/ File: `public_html/' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 904h/2308d Inode: 35784117 Links: 13 Access: (0750/drwxr-x---) Uid: ( 1064/original) Gid: ( 99/ nobody) Access: 2018-07-26 12:09:00.543974512 -0400 Modify: 2018-07-26 11:55:13.686975080 -0400 Change: 2018-07-26 12:00:08.199974877 -0400
Todo se encuentra bien con los permisos.
Entonces, fuimos al WHM >> Tweak Settings >> Security, y revisamos si estaba habilitada la casilla de “Enable File Protect”. Todo estaba ok.
Luego, probamos por consola:
/usr/local/cpanel/scripts/enablefileprotect
Y esto solucionó el problema.