apache

Serve .htm files when directory is requested on CentOS 6.4

You can set up your Apache so that it serves an index.htm file when a directory requested by editing the DirectoryIndex in the httpd.conf file.

First, open up /etc/htttpd/conf/httpd/httpd.conf and find the line that says

DirectoryIndex index.html index.html.var

and add index.htm to the end of it. It should now read like this

DirectoryIndex index.html index.html.var index.htm

Restart apache

$ service httpd restart

Now, if a directory is directly requested and contains an index.htm file, it will serve that.

more Apache posts

more CentOS posts