LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 15
Very newbie Apache question


Heya!
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
http://mycomputer/page/

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!
Cheers
Azhrarn
 
Old 04-11-2006, 12:33 PM   #2
vmlinuz.gz
Member
 
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

Code:
DocumentRoot "<default_document_root>"
for

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

Code:
<Directory "<default_document_root>">
to

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

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

Code:
$ sudo apachectl start
 
Old 04-12-2006, 03:44 AM   #3
Azhrarn
Member
 
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)

Thanks!!
Azh
 
Old 04-12-2006, 02:24 PM   #4
twantrd
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.

-twantrd
 
  


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


All times are GMT -5. The time now is 06:43 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration