I had the exact same problem after installing apache in a hurry on an old PC after my “Power Edge” was fried by a power surge. Be warned that I am still a total newbie after all these years when it comes to knowledgeability about these things, but that hasn’t stopped me so far.
Here goes…
As you have probably noticed the current Apache version seems to be Apache2 and configuration works differently so when you search the web for tips you get a lot of bad advice (that probably works fine for Apache 1.3). httpd.conf is not used anymore so it’s supposed to be empty, I think they keep it around for compatibility.
I’m running Debian on my machine but Apache2 is probably quite similar on all distros. In Debian the place for web pages is
/var/www, in CentOS it maybe a different folder, but you should make sure to have at least an index.html file in this folder. In this www-folder there is another folder called
apache2-default. I let that folder be just in case it’s needed for future reference but I deleted everything inside it, especially the index.html that I don’t want the browser to display anymore.
Next step; in the
apache2 folder, mine is located at
/etc/apache2, there is a folder called
sites-available, and in that folder there is a file called
default. The content of this file looks like a typical configuration file with so called “directives” that look a bit like html-tags. Now we are interested in one of the
<Directory> directives.
Open the
default file in your favourite text editor and search for
RedirectMatch, in my file the whole line looks like this:
RedirectMatch ^/$ /apache2-default/
I warn you once again, I’m a newbie and have no idea what this line is for, I suspect it might have something to do with “virtual servers” which is also an unfamiliar term for me. If you are serving up pages for several domains like,
www.mydomain.com and also
www.anotherdomain.com from the same apache then this might be a bad idea. I’m running only one domain and this worked for me.
Comment out that line like so:
#RedirectMatch ^/$ /apache2-default/
and save the file and then restart apache. On Debian that’s:
/etc/init.d/apache2 restart but it might be different for CentOS.
Good luck!