LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-04-2004, 06:08 AM   #1
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
A small question on apache


Hi...

I have a small question -

If I am to set up a Website, then do I have to compulsorily use the VIRTUALHOST directive ?

My assumption is that when there is only one website to be setup, then we need not use the virtualhost directive. Is that right ?

I have created a directory

/var/www/html/192.168.1.18

and in this directory I have the file 'index.html' file.

But when I type in my browser:

http://192.168.1.18
In this case I get the apache test page. However, I should in fact get the output of the file 'index.html' which is not the case.

Also, http://192.168.1.18/index.html
outputs an error page saying 'Object not found'

So I'd like to know If what I am doing is in the right direction or would I have to compulsorily use the 'virtualhost' directive for setting up even a single website ??

Thanx and Regards,

amit
 
Old 04-04-2004, 06:39 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Re: A small question on apache

Quote:

If I am to set up a Website, then do I have to compulsorily use the VIRTUALHOST directive ?

My assumption is that when there is only one website to be setup, then we need not use the virtualhost directive. Is that right ?
You do not need the VirtualHost directives. It's there for you if you want to maintain multiple domains/hostnames on your machine.

Quote:
I have created a directory

/var/www/html/192.168.1.18

and in this directory I have the file 'index.html' file.

But when I type in my browser:

http://192.168.1.18
In this case I get the apache test page. However, I should in fact get the output of the file 'index.html' which is not the case.
Your httpd.conf probably points to /var/www/html/ as being the DocumentRoot (take a look at your httpd.conf and check the DocumentRoot directive). This directory is where you end up when you enter the following url: http://192.168.1.18

If you create a directory in your DocumentRoot, you need to point your url to that, so in your case that would be something like:

http://192.168.1.18/192.168.1.18

If there is a index.htm or index.html, it should be shown. It also shows that 192.168.1.1 is not the best name for that dir

Quote:
Also, http://192.168.1.18/index.html
outputs an error page saying 'Object not found'

So I'd like to know If what I am doing is in the right direction or would I have to compulsorily use the 'virtualhost' directive for setting up even a single website ??
If there is no index.html in your DocumentRoot it will show that error.

Take a look at the following url(s) for more info:

http://httpd.apache.org/docs-2.0/mod...reference.html
http://httpd.apache.org/docs-2.0/mod...tive-dict.html

Hope this helps.
 
Old 04-04-2004, 06:58 AM   #3
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Original Poster
Rep: Reputation: 31
Cheers druuna!!!..

You are right, when I was typing

http://192.168.1.18

apache was searching http://192.168.1.18/192/192.168.1.18/index.html...

So, I deleted the directory and moved index.html to /var/www/html

Yes, now it works!!!

Thanx a ton once again..

Regards,

amit
 
  


Reply



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
Small problem with apache - Indexing ThorRune Linux - Software 5 07-03-2005 11:38 AM
Small phpBB and apache configuration problem. The_Messiah Linux - Software 1 03-29-2005 02:09 PM
Small Apache Question spank Linux - Newbie 7 09-01-2003 01:49 PM
Small question Ed-Slack Linux From Scratch 1 01-08-2003 08:03 AM
a small question ericn Linux - Security 3 01-07-2002 05:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:09 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
Open Source Consulting | Domain Registration