This tutorial provides systematic instructions on resolving the “No Matching DirectoryIndex Apache error.” This issue often arises when accessing applications with an index.php file (or another index file) but lacking an index.html file or any other specified “directory index” file. Ensure you have root access to address and rectify this problem effectively.
Let us identify the commands utilised to resolve the error:
- The below command is used to set Apache by default-
DirectoryIndex index.html - This implies that Apache exclusively looks for files named index.html within directories. Apache when attempting to access phpMyAdmin generates the subsequent error-
[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
Now, let us follow the steps to fix the error:
- Include “index.php” in the “DirectoryIndex” directive for this situation.
vim /etc/httpd/conf/httpd.conf
- Change the below line-
DirectoryIndex index.html ? DirectoryIndex index.html index.php - Exit and save the file by using the command “:wq”.
- Restart Apache using-
systemctl restart httpd
You can resolve the “No Matching DirectoryIndex Apache error” by following these steps. We trust you found our article helpful and understandable. If you encounter any challenges, feel free to reach out to our support team, available around the clock.
Looking to customize your Apache settings further? Check out our guide on How to Modify the Apache port in WHM.