LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-25-2003, 09:02 AM   #1
Samspeed
LQ Newbie
 
Registered: Jul 2003
Posts: 5

Rep: Reputation: 0
Virtual host and apache


hi there

i would like to host several websites on the same server (with only one ip) is it possible with the virtual host?How can I do that?

thx!
 
Old 07-25-2003, 09:06 AM   #2
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
Read the Vitual Hosts Section (#3) in httpd.conf. It's pretty self-explanitory. Basically you will define a hostname and associate it with a certain directory on the machine, which becomes the web root for that host. Wash Rinse and Repeat for each additional host and web root.
 
Old 07-25-2003, 09:15 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
yes, not a problem, just read through the virtualhost at apache.org
 
Old 07-25-2003, 09:17 AM   #4
Samspeed
LQ Newbie
 
Registered: Jul 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Smile

Hello


thx for ur help...i have an other question : i suppose that i need a valid dns name(i only have an ip)... it will work without it?


thank u very much
 
Old 07-25-2003, 09:18 AM   #5
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
Short answer: No
Long answer: No way.

Apache has no way to descriminate two different hostnames for different sites on the same machine if you don't even have a valid hostname.

How would expect that a web client could reach one web site via address '123.213.123.1' and another web client reach a different page via address '123.213.123.1'?

Last edited by bentz; 07-25-2003 at 09:20 AM.
 
Old 07-25-2003, 09:25 AM   #6
Samspeed
LQ Newbie
 
Registered: Jul 2003
Posts: 5

Original Poster
Rep: Reputation: 0
i see now Thank u Benz

bye!
 
Old 07-25-2003, 09:34 AM   #7
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
The following thread contains useful information concerning Apache and Virtual Hosts.
http://www.linuxquestions.org/questi...threadid=74985
 
Old 07-30-2003, 10:24 AM   #8
lenlutz
Member
 
Registered: May 2003
Location: philadelhpia pa
Posts: 92

Rep: Reputation: 15
virtual host

Quote:
Originally posted by bentz
Short answer: No
Long answer: No way.

Apache has no way to descriminate two different hostnames for different sites on the same machine if you don't even have a valid hostname.

How would expect that a web client could reach one web site via address '123.213.123.1' and another web client reach a different page via address '123.213.123.1'?
How would expect that a web client could reach one web site via address '123.213.123.1' and another web client reach a different page via address '123.213.123.1'?

Just WHAT is the answer to this ????
i have dsl, and a fixed ip.....
i would like to add a second web site, to my machine....
i assume i CAN NOT use virtual ip, and need to use virtual name....
, but, the question above, has me a bit confused......
 
Old 08-06-2003, 08:41 AM   #9
bentz
Member
 
Registered: Mar 2003
Distribution: Fedora, Mac OSX
Posts: 362

Rep: Reputation: 30
The answer is that you can't expect a server to server you two different pages when it is being referred to by a single name, such as an IP.

It's like saying that your company's website, http://123.213.123.1/ should show the 'Products' page, while http://123.213.123.1/ should show the 'Support' page. It is not going to work.

As far as your question goes, you NEED DNS to do virtual hosting. I don't know what you mean by 'virtual name' unless you mean a second DNS hostname for your second virtual web server.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache - Name virtual host tisource Linux - Networking 5 03-03-2006 03:52 AM
Apache 2.0 Virtual Host? w0lfeyes Linux - Networking 1 05-03-2004 04:09 PM
apache and virtual host diverge Linux - Networking 2 01-11-2004 03:45 AM
apache virtual host navinc Linux - Software 10 05-22-2003 01:16 PM
apache virtual host mimi Linux - General 1 04-06-2002 06:11 AM


All times are GMT -5. The time now is 03:12 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