Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-11-2006, 10:57 AM   #1
Registered: Aug 2005
Location: Europe
Posts: 63

Rep: Reputation: 15
Very newbie Apache question

I know its simple but I m stuck.
I m a bit confused about Locations, Virtual Servers and Directories in Apache 2.0

How do I make it so by opening

on my computer
/usr/azhrarn/stuff/page.htm opens?

I have apache working, I just need the link
Also, page.htm cannot be moved.
Thanks a million!
Old 04-11-2006, 11:33 AM   #2
Registered: Nov 2005
Posts: 123

Rep: Reputation: 15
To access /usr/azhrarn/stuff/page.htm, find your httpd.conf in /usr/local/apache2/conf/httpd.conf. Change your document root by editing the file.

First, you will want to change what says after "DocumentRoot." In my case, it's on line 104. It should be at least somewhere around there for yours. If not, try doing a pattern search. Anyway, substitute

DocumentRoot "<default_document_root>"

DocumentRoot "/usr/azhrarn/stuff"
You'll also have to change your <Directory>. Mine is on line 131. Change

<Directory "<default_document_root>">

<Directory "/usr/azhrarn/stuff">
If you want something other then index.html to be served by default (page.htm) in your case, find your DirectoryIndex. Mine is on line 166. Add a line that says

DirectoryIndex page.htm
if you wish.

Now, you should be ready. If you set you DirectoryIndex to page.htm, entering http://localhost/ in your browser should do the trick. If not, http://localhost/page.htm will do the same thing.

Also, make sure apache is running:

$ sudo apachectl start
Old 04-12-2006, 02:44 AM   #3
Registered: Aug 2005
Location: Europe
Posts: 63

Original Poster
Rep: Reputation: 15
Thanks a mil, works like a dream.
Just one more question however, how would I come about configuring it if I wanted it to be accessed using

http://server/page/page.html (subdirectory)

rather than

http://server/page.html (default)

Old 04-12-2006, 01:24 PM   #4
Senior Member
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Make another directory called "page" under your DocumentRoot and change that path in httpd.conf as well. You also would need to add "page.html" in your directory index.

I would suggest reading up on apache and how it works on google. You will gain tons of valuable information on one of the best webservers out there.



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
Newbie Apache question MontyPY Linux - Software 6 03-03-2005 03:59 AM
newbie apache question... jjd228 Linux - Networking 1 01-08-2004 12:57 PM
very newbie Apache question mla Linux - Software 6 10-10-2003 03:35 PM
very newbie Apache question mla Linux - Software 3 10-10-2003 03:20 PM
Apache newbie question.. (very newbie question) tarballed Linux - Newbie 1 02-07-2003 08:41 PM > Forums > Linux Forums > Linux - Newbie

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

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