Are you trying to find a solution for the error Apache Error: No matching DirectoryIndex? We can help you fix it.
Here at Bobcares, we have seen several such Apache errors as part of our Server Management Services for web hosts, Linux users, and online service providers.
Today we’ll take a look at the cause for this error and see how to fix it.
What is Apache Error: No matching DirectoryIndex?
This error arises when trying to access applications that have an index.php file (or other index file), but not an index.html or other specified ‘directory index’ file.
By default, index.html will be specified in the configuration file. For instant, while installing PhpMyAdmin, it includes an index.php file. However not an index.html file.
So the Apache configuration entry looks like the following:
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
This means Apache will only look for directory index files that are named index.html.
So, when trying to access phpMyAdmin, Apache gives the following 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
The following are the main reasons to occur this error,
- Apache misconfiguration. That is the Index page not mentioned in the list of DirectoryIndex.
- PHP-FPM hits exceed the limit of max allowed processes.
- In Plesk servers, the dir module is not enabled.
How to fix Apache Error: No matching DirectoryIndex
Here are the different solutions provided by our Support Engineers to fix this error.
1. Apache misconfiguration
Specify the corresponding index file to DirectoryIndex. For an example of phpMyAdmin, add index.php to the DirectoryIndex directive.
Hence, it can be done by adding index.php to the DirectoryIndex directive in the apache configuration file /etc/httpd/conf/httpd.conf.
At last, restart Apache by using the following command,
systemctl restart httpd
2. Max allowed processes
Also, set a higher value for max allowed processes. In DirectAdmin servers, the following commands use to increase the value for max allowed processes.
/usr/local/directadmin/directadmin set php_fpm_max_children_default 30
cd /usr/local/directadmin/custombuild/
./build rewrite_confs
That’s it.
[Need any further assistance in Linux related errors? – We’re available to help you]
Conclusion
In short, this Apache Error: No matching DirectoryIndex occurs due to Apache misconfiguration and when exceed the limit of max allowed processes. Today, we saw how our Support Engineers provide a work-around for this error.
0 Comments