LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 11-26-2006, 03:53 PM   #1
ozymandias
Member
 
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://192.168.0.1/index.html all works well & I see my page...

However, if i type http://192.168.0.1 I get an error message that 'http://192.168.0.1/apache2-default 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
/etc/apache2/apache2.conf

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

Regards,

Oz.
 
Old 11-26-2006, 04:12 PM   #2
ozymandias
Member
 
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
</IfModule>

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
friskydrifter
Member
 
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:

/etc/httpd/conf.d/welcome.conf.


It has this inside:

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


noindex.html is in :

/var/www/error


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?
http://gentoo-wiki.com/HOWTO_Apache2

Last edited by friskydrifter; 12-01-2006 at 02:15 AM.
 
Old 12-01-2006, 04:42 AM   #4
ozymandias
Member
 
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

Oz
 
Old 09-12-2008, 11:27 AM   #5
rwreed
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
http://www.aequitas-systems.co.uk/jo...acheandphp.php

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

Quote:
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
 
  


Reply


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/Novell 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


All times are GMT -5. The time now is 08:14 PM.

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