
Let's say your Apache HTTP web server log has something like this.
Cannot serve directory /var/www/html/:
No matching DirectoryIndex (index.html,index.htm,index.shtml,index.jsp,index.php,index.phtml) found, and server-generated directory index forbidden by Options directive
As the error suggests, this means the /var/www/html directory does not contain one of the listed DirectoryIndex files (index.html,index.htm,index.shtml,index.jsp,index.php,index.phtml) in this example. So I would start by confirming that the directory in question does not contain one of the DirectoryIndex files. The solution here may be to simple put your index file in the directory.
~]$ ll /var/www/html
-rw-rw-r-- 1 nobody admins 6 Aug 29 2011 foo.html
-rw-rw-r-- 1 nobody admins 6 Aug 29 2011 bar.html
Your httpd.conf file should contain the DocumentRoot directive which should match the directory listed in the error message.
DocumentRoot /var/www/html
And your httpd.conf file should contain the DirectoryIndex directive with the list of index files that can be used. You may need to add or remove index files from the DirectoryIndex directive.
DirectoryIndex index.html index.htm index.shtml index.jsp index.php index.phtml
Did you find this article helpful?
If so, consider buying me a coffee over at