Not working DirectoryIndex

Problem with mod_dir. It was working fine, but,, I don't know why now mod_dir is not working.
There is in apache.conf: Include /etc/apache2/mods-enabled/*.conf
There is in mods-enabled/dir.conf:

DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml

But when I'm trying to open site root it's only showing me the list of files. And there is index.html, but it does not open it automatically... Strange error...
I was trying to add DirectoryIndex directly in apache.conf - no success...

And I have restarted the server.

apply debug to your ehcp as described here: http://ehcp.net/?q=node/771
especially, try emptying your apache config.

maybe, you have more than one directoryindex statement in somewhere in your apache config, including custom http configs which you define inside ehcp.

make sure you did empty all custom apache configs..

what is apachehcp.conf file in your ehcp dir ?

I don't have any custom config. Only standard configs.
This is my apachehcp.conf:

#____________start of mydomainxxx__paneluser:mydomain_reseller:admin_id:72____________
# explanation {aciklama}

ServerName mydomainxxx
ServerAlias www.mydomainxxx
# buraya aliaslar yazilacak..

UseCanonicalName Off
DocumentRoot /var/www/vhosts/mydomain/mydomainxxx/httpdocs

# this combined log format is understandable by webalizer... some other formats are not recognised by webalizer.. thats why, specified here explicitly..

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog /var/www/vhosts/mydomain/mydomainxxx/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir /var/www/vhosts/mydomain/mydomainxxx
php_admin_value upload_tmp_dir /var/www/vhosts/mydomain/mydomainxxx/phptmpdir
php_admin_value session.save_path /var/www/vhosts/mydomain/mydomainxxx/phptmpdir

AccessFileName .htaccess

ServerName webmail.mydomainxxx
ServerAlias mail.mydomainxxx
ServerAlias email.mydomainxxx

DocumentRoot /var/www/vhosts/ehcp/webmail

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog /var/www/vhosts/mydomain/mydomainxxx/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir /var/www/vhosts/ehcp/webmail
php_admin_value upload_tmp_dir /var/www/vhosts/ehcp/webmail/data
php_admin_value session.save_path /var/www/vhosts/ehcp/webmail/data

ServerName cpanel.mydomainxxx
ServerAlias panel.mydomainxxx
ServerAlias ehcp.mydomainxxx
ServerAlias cp.mydomainxxx

DocumentRoot /var/www/vhosts/ehcp/

LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir /var/www/vhosts/ehcp/

#____________end of mydomainxxx__paneluser:mydomain_reseller:admin_id:72____________
#____________start of mydomainxxx2__paneluser:admin_reseller:admin_id:73____________
# explanation {aciklama}

ServerName mydomainxxx2
ServerAlias www.mydomainxxx2
# buraya aliaslar yazilacak..

UseCanonicalName Off
DocumentRoot /var/www/vhosts/myuser/mydomainxxx2/httpdocs

# this combined log format is understandable by webalizer... some other formats are not recognised by webalizer.. thats why, specified here explicitly..

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog /var/www/vhosts/myuser/mydomainxxx2/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir /var/www/vhosts/myuser/mydomainxxx2
php_admin_value upload_tmp_dir /var/www/vhosts/myuser/mydomainxxx2/phptmpdir
php_admin_value session.save_path /var/www/vhosts/myuser/mydomainxxx2/phptmpdir

AccessFileName .htaccess

ServerName webmail.mydomainxxx2
ServerAlias mail.mydomainxxx2
ServerAlias email.mydomainxxx2

DocumentRoot /var/www/vhosts/ehcp/webmail

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog /var/www/vhosts/myuser/mydomainxxx2/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir /var/www/vhosts/ehcp/webmail
php_admin_value upload_tmp_dir /var/www/vhosts/ehcp/webmail/data
php_admin_value session.save_path /var/www/vhosts/ehcp/webmail/data

ServerName cpanel.mydomainxxx2
ServerAlias panel.mydomainxxx2
ServerAlias ehcp.mydomainxxx2
ServerAlias cp.mydomainxxx2

DocumentRoot /var/www/vhosts/ehcp/

LogFormat "%v:%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir /var/www/vhosts/ehcp/

#____________end of mydomainxxx2__paneluser:admin_reseller:admin_id:73____________

i suggest one of:

  • if you dont have many domains, just re-install your server&ehcp
  • otherwise, search for DirectoryIndex statements in your apache configs, then fix them, if something strange is seen there..
    your directoryindex shoul be like, index.php, index.html and so on.
  • Assalamu alaikum.
    The problem was with htaccess...
    It was in in xxx.com domain. And there was:
    DirectoryIndex aboutus.html
    (because there is not index.html)
    But this htaccess was working for subdomains too. That's why my sub.xxx.com was not working.
    I think that it will be better (in future versions) to move subdomains to main directory. So, for example: xxx.com, sub1.xxx.com, sub2.xxx.com, yyy.com - all of them will be in one dir.