Directoryindex not working
Hello,
I have a brand new VPS server with WHM, CentOS, EA4, latest stable versions of Apache, php etc..., left exactly as provided by the hosting company. Added an account but opening a simple website with just a index.html in /public_html/ does not show the content of the file but lists the directory content.
It works adding in .htaccess:
DirectoryIndex index.html
... but I will be moving a lot of websites and I need to be enabled server wide.
The only setting found regarding this is on WHM:
Service Configuration "Apache Configuration "DirectoryIndex Priority
but the server ignores all the index files listed here.
This is the first time I have this problem in 15 years of using WHM.
Thank you!
-
Hi @myamarix Can you tell me the output of the following: grep '\ dir_module' /etc/apache2/conf/httpd.conf -A20 -
grep '\ dir_module' /etc/apache2/conf/httpd.conf -A2
DirectoryIndex index.htm index.html index.php index.php5 index.php4 index.php3 index.perl index.pl index.plx index.ppl index.cgi index.jsp index.jp index.phtml index.shtml index.xhtml index.wml index.js0 -
That's exactly what I would anticipate seeing. Do you get any errors when performing the following? mv /etc/apache2/conf/httpd.conf{,.bk} /scripts/rebuildhttpdconf /scripts/restartsrv_httpd0 -
I do not have much experience with the command prompt, this is what I got after pasting your code in the terminal from WHM: [root@vmi273473 ~]# mv /etc/apache2/conf/httpd.conf{,.bk} [root@vmi273473 ~]# /scripts/rebuildhttpdconf Built /etc/apache2/conf/httpd.conf OK [root@vmi273473 ~]# /scripts/restartsrv_httpd Waiting for "httpd" to restart gracefully "waiting for "httpd" to initialize "finished. Service Status httpd (/usr/sbin/httpd -k start) is running as root with PID 21880 (systemd+/proc check method). httpd (/usr/local/cpanel/bin/splitlogs --dir=/etc/apache2/logs/domlogs --main=some.webhost.net --suffix=-bytes_log) is running as root with PID 23410 (systemd+/proc check method). httpd (/usr/local/cpanel/bin/splitlogs --dir=/etc/apache2/logs/domlogs --main=some.webhost.net --mainout=/etc/apache2/logs/access_log) is running as root with PID 23412 (systemd+/proc check method). Startup Log Jun 13 11:38:15 some.webhost.net systemd[1]: Starting Apache web server managed by cPanel EasyApache... Jun 13 11:38:15 some.webhost.net systemd[1]: PID file /run/apache2/httpd.pid not readable (yet?) after start. Jun 13 11:38:15 some.webhost.net systemd[1]: Started Apache web server managed by cPanel EasyApache. Log Messages [Thu Jun 13 11:59:35.466820 2019] [mpm_worker:notice] [pid 21880:tid 47447696938048] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:59:26.170874 2019] [mpm_worker:notice] [pid 21880:tid 47447696938048] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:59:16.850980 2019] [mpm_worker:notice] [pid 21880:tid 47447696938048] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:38:15.799774 2019] [mpm_worker:notice] [pid 21880:tid 47447696938048] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:38:15.740862 2019] [:notice] [pid 21877:tid 47447696938048] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall. [Thu Jun 13 11:37:14.902201 2019] [mpm_worker:notice] [pid 21518:tid 47023008207936] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:37:14.842767 2019] [:notice] [pid 21462:tid 47023008207936] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall. [Thu Jun 13 11:15:55.463400 2019] [mpm_worker:notice] [pid 20697:tid 47377880822848] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:15:55.405856 2019] [:notice] [pid 20694:tid 47377880822848] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall. [Thu Jun 13 11:14:53.833900 2019] [mpm_worker:notice] [pid 20456:tid 47506976166976] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:14:53.768833 2019] [:notice] [pid 20453:tid 47506976166976] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall. [Thu Jun 13 11:11:27.013054 2019] [mpm_worker:notice] [pid 20222:tid 47430868005952] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 11:11:26.949750 2019] [:notice] [pid 20219:tid 47430868005952] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall. [Thu Jun 13 04:03:15.537721 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Thu Jun 13 00:03:31.824893 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:58:12.566865 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:54:42.238588 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:52:45.637728 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:50:51.803161 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:50:32.640177 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:44:15.450366 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:41:42.503056 2019] [mpm_worker:notice] [pid 4258:tid 47267674948672] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:41:42.422229 2019] [:notice] [pid 4195:tid 47267674948672] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall) configured. [Wed Jun 12 23:40:51.876917 2019] [mpm_worker:notice] [pid 13745:tid 47997304841280] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 23:40:51.810418 2019] [:notice] [pid 13738:tid 47997304841280] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall. [Wed Jun 12 20:39:35.899976 2019] [mpm_worker:notice] [pid 4397:tid 46925323752512] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 20:39:35.821873 2019] [:notice] [pid 4243:tid 46925323752512] ModSecurity for Apache/2.9.3 (ModSecurity: Open Source Web Application Firewall) configured. [Wed Jun 12 15:23:26.278383 2019] [mpm_worker:notice] [pid 31247:tid 47512460170304] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations [Wed Jun 12 15:23:21.578112 2019] [mpm_worker:notice] [pid 31247:tid 47512460170304] AH00292: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4 configured -- resuming normal operations httpd restarted successfully. 0 -
The problem has been SOLVED. Just curios, was there a problem with httpd.conf, resolved by rewriting it with a backup copy? 0 -
My assumption/hope was that for some reason your modifications through WHM>>Service Configuration "Apache Configuration "DirectoryIndex Priority weren't in effect, especially since the output you provided of the apache conf looked correct. So manually rebuilding this and restarting apache would resolve this issue. I'm glad to hear that the issue is now resolved though. 0 -
Thank you! 0
Please sign in to leave a comment.
Comments
7 comments