Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 11-26-2006, 03:53 PM   #1
Registered: Aug 2005
Location: West Midlands, UK
Posts: 61

Rep: Reputation: 15
Apache2 - how to get rid of apache2-default

Ok, finally I've got my Apache2 up and runnning, and working with some cgi scripts i downloaded!

But... My problem is that if I type htttp:// all works well & I see my page...

However, if i type I get an error message that ' is not available on this server

As I didn't ask for it, I'm assuming that the apache2-default is specified (by default!) in some config file, but I cant find it in

How do I set the default to my index.html page ?

Sadly I found the Apache2 site pretty useless for help for real beginners like me.

P.s my httpd.conf is blank


Old 11-26-2006, 04:12 PM   #2
Registered: Aug 2005
Location: West Midlands, UK
Posts: 61

Original Poster
Rep: Reputation: 15
Sorry, should have said...

I have:

<IfModule dir_module>
DirectoryIndex index.html

already in my /etc/apache2/apache2.conf ...which I had thought should sort it out after restarting, but no.
Old 11-30-2006, 08:46 PM   #3
Registered: Jan 2003
Location: AU
Distribution: Whatever - mainly Red Hat
Posts: 32

Rep: Reputation: 15
Hmm not sure what you are running but on my centos distro the default page pointed to in:


It has this inside:

<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html

noindex.html is in :


Does this help you? Im not guru on apache, in fack im just about to ask how I make squirrelmail the default page.

Edit - After checking I dont have a apache2.conf after google I saw this. It might help you?

Last edited by friskydrifter; 12-01-2006 at 02:15 AM.
Old 12-01-2006, 04:42 AM   #4
Registered: Aug 2005
Location: West Midlands, UK
Posts: 61

Original Poster
Rep: Reputation: 15
Sorted it!

Thanks - In Apache2 I finally got it working by changing /etc/apache2/sites-available/default thusly:

lines 15-17

# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /index.html

Old 09-12-2008, 11:27 AM   #5
LQ Newbie
Registered: Mar 2006
Posts: 4

Rep: Reputation: 0
Another solution

My sites-available didn't have the redirectmatch line so this solution didn't work for me. Instead I got the solution from here

which recommends adding the following lines to httpd.conf (located in /etc/apache2)

once complete and everything is ok, there is only two last things to do before we test to see if PHP is working with apache.

change directory to /etc/apache2

next open the 'HTTPD.conf' file usong Nano or a similar editor locate the section were the 'AddType' mime types are added and add the following to the config file.

AddType application/x-httpd-php php

Then add the following to allow apache to now what file to open as its index to do this you need to add an index.php to the DirectoryIndex in the HTTP.conf file as shown below

DirectoryIndex index.html index.html.var index.php

all thats left to be done is to restart apache


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making Apache2 Load a different Default file! FearPasion710 Linux - General 3 12-16-2008 02:29 PM
Change default directory in Apache2 walterbyrd Linux - Software 2 07-19-2006 12:47 PM
SuSe Apache2 error: cannot adjust 'apache2' service sir_shunt SUSE / openSUSE 14 04-18-2006 12:36 PM
change the default dir fro apache2 dev_mohamed Linux - Software 5 06-22-2005 02:20 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 12:46 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:11 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration