LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 05-26-2005, 02:46 PM   #1
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Rep: Reputation: 30
Apache + where to place web pages??


Hey all, im trying to learn Apache so i can serve my own web page.
A) Does anyone have a good site for tutorials using apache

B) Right how i can only access the index.html file (which i cannot find on my system), from http://127.0.0.1. So i wrote a 2 line html file and place it in /var/www/html/example.html.
I restarted the httpd server, and yet the same index.html file is still there, not my 2 liner??

What im pretty much looking for, is a step by step tutorial to configuring and using apache.

THanks so much for the help.

Josh
 
Old 05-26-2005, 03:15 PM   #2
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Rename example.html to index.html.

Or you can modify httpd.conf to include example.html in the search list (just kidding). By default, Apache only searches for a limited list of .html files.

And be sure to look at http://httpd.apache.org/docs-2.0/
 
Old 05-26-2005, 03:21 PM   #3
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Original Poster
Rep: Reputation: 30
your saying that when i want to add a page it can only be named index.html???

And in the /etc/httpd/conf/httpd.conf file i have listed as document root "/var/www/html"
IN this file i have example.html, which i will rename index.html. Is this correct??

Thanks so much!!
josh
 
Old 05-26-2005, 03:59 PM   #4
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Look in httpd.conf for DirectoryIndex. It will be followed by a list of files that Apache will attempt to load.

It will typically look like this:

httpd.conf:
...
DirectoryIndex index.php index.html index.htm index.shtml
...

If your file is not on the list, then Apache will not attempt to load it.
 
Old 05-26-2005, 04:05 PM   #5
Tuvok
Member
 
Registered: Mar 2003
Distribution: FreeBSD 6.1, NetBSD 3.0.1
Posts: 170

Rep: Reputation: 30
I think it's placed in /home/httpd/html/index.html.
 
Old 05-26-2005, 07:30 PM   #6
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Original Poster
Rep: Reputation: 30
GREAT!, thanks so much
 
Old 06-01-2005, 03:27 PM   #7
tacticus
LQ Newbie
 
Registered: Jun 2005
Location: Oslo, Norway
Posts: 2

Rep: Reputation: 0
Quote:
Originally posted by blizunt7
your saying that when i want to add a page it can only be named index.html???

And in the /etc/httpd/conf/httpd.conf file i have listed as document root "/var/www/html"
IN this file i have example.html, which i will rename index.html. Is this correct??

Thanks so much!!
josh
Apache will display any *.html (and *.htm) and serve any file you care to name.
However, when you go to the url: http://127.0.0.1/ Apache (running on you local machine) will give you a default page for that folder (There was no mentioning of any file in that request, so apache will use the default. If (AND ONLY IF) that fails, Apache will list the contents of the folder, if it has parissions to read it.).

The list mentioned in the earlier post is part of the Apache configurtation file(/etc/httpd/conf/httpd.conf). This is the list of default names Apache will use. If Apache cant find a index.html in the dokument root (whitch is typically /var/www/html/ on a Fedora box), it will use the next in the list. (Next in that list, is probably index.htm. possibly followed by default.html...)
If you tried to look at http://127.0.0.1/example.html you would get your example.html.
And naturally, the same goes for any other file under the document root.

==
 
  


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
how to add web pages in apache webserver gajaykrishnan Linux - Networking 2 02-09-2005 12:55 AM
ADSL Router Web configuration pages appears instead of Personal Web Server Pages procyon Linux - Networking 4 12-20-2004 05:44 PM
I think apache is blocking web pages with forbidden error? need help unixmad Linux - Software 7 08-28-2004 04:53 PM
Question about Multiple web pages in apache SSBN Linux - Networking 10 05-01-2003 10:18 AM
View Apache web pages r4merlin Linux - Newbie 10 02-17-2003 07:13 PM


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

Main Menu
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