How to Resolve the Apache Error: No matching DirectoryIndex?
You might face this error while attempting to access applications that have an index.php file (or different index file), however not an index.html or different such as ‘directory index’ file.
For example, phpMyAdmin contains of index.php file when installation, however not an index.html file.
With the below command Apache is by default get configured:
DirectoryIndex index.html
The directory files that are named index.html Apache will only check for that .
Apache gives the below error, While trying to access phpMyAdmin:
[autoindex:error] [pid 20115] [client 10.30.6.80:50800] AH01276: Cannot serve directory /usr/share/phpMyAdmin/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
In this case, add index.php to the DirectoryIndex directive.
vim /etc/httpd/conf/httpd.conf
DirectoryIndex index.html
to:
DirectoryIndex index.html index.php
Now exit and save the file using the command :wq .
Ensure to restart Apache:
systemctl restart httpd