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 10-18-2010, 01:10 PM   #1
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Rep: Reputation: 1
httpd.conf VirtualHosting


HI

I'm trying to understand feature of Apache called VirtualHosting.
There is :
- IP Based
- Name Based


When sys admins usually use each of this feature, in what purpose ?

thx for help.
 
Old 10-18-2010, 01:47 PM   #2
matt2kjones
LQ Newbie
 
Registered: May 2004
Location: Wales, UK
Distribution: Gentoo
Posts: 5

Rep: Reputation: 0
It is pretty simple. Name based virtual hosts is when you host multiple websites with different domains / sub domains on the same IP address. Apache can determine which site is being accessed by looking at the http header, even though all requests are coming to the same IP address.

IP based hosting, is when each website is hosted on its own IP address. This is becoming less and less common, especially with webhosts, as it is much cheaper and easy to manage with name based hosting.

There are protocols however, that can't do name based hosting because of the limited communication over the protocol. An example of this is FTP.
 
Old 10-18-2010, 03:52 PM   #3
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Original Poster
Rep: Reputation: 1
Quote:
There are protocols however, that can't do name based hosting because of the limited communication over the protocol. An example of this is FTP.
Does it mean, that ftp will be unable to access a page when is NAme BAsed hosting used ?
 
Old 10-18-2010, 05:13 PM   #4
matt2kjones
LQ Newbie
 
Registered: May 2004
Location: Wales, UK
Distribution: Gentoo
Posts: 5

Rep: Reputation: 0
Not sure I know what you mean. FTP is a completly seperate protocol. The only reason FTP would be a problem with a single IP address if if you wanted, for example, anonymous FTP and local user logins.

You can have a Linux Machine with a single IP address, hosting many different domains using name based hosting, and have an FTP server running on the same IP address.

Depending on which user logs into the FTP server, depends on which websites they have access too. Think of the FTP Server as User Based hosting.
 
Old 10-18-2010, 05:31 PM   #5
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Original Poster
Rep: Reputation: 1
I doesn't understand part below.

Quote:
The only reason FTP would be a problem with a single IP address if if you wanted, for example, anonymous FTP and local user logins.
PLease give some examples.
 
Old 10-19-2010, 11:19 AM   #6
matt2kjones
LQ Newbie
 
Registered: May 2004
Location: Wales, UK
Distribution: Gentoo
Posts: 5

Rep: Reputation: 0
Well, say you have the following:

client1.example.com - 10.0.0.1
client2.example.com - 10.0.0.1

When using apache Name Based vitual hosts, you could serve 2 different websites from the same ip (10.0.0.1):

/home/client1/public_html for client1.example.com
/home/client2/public_html for client2.example.com

Now say you wanted to host anonymous ftp for the two subdomains.... you couldn't setup the ftp servers to do something like this:

/home/client1/anon_ftp for client1.example.com
/home/client2/anon_ftp for client2.example.com

This is because the FTP Server is unaware which domain the user is connecting to, and only see's the IP address.

For that reason, you would have to do something like this:

client1.example.com 10.0.0.1
client2.example.com 10.0.0.2

You could setup FTP Server to then direct the users to the correct anonymous folder on the server because the server knows which ip the user is connecting to. This is the same as apache IP based virtual hosts.

However, when using FTP, if the users login with a username and password, then you can use that to direct users to the right folder.
 
  


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
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
Failed to start apache :Starting httpd: Syntax error on line 1027 of /etc/httpd/conf/ payjoe Linux - Newbie 3 09-21-2007 07:24 AM
Should I include srm.conf in httpd.conf in apache2? xpucto Linux - Software 3 02-16-2006 08:16 AM
saving changes to apache2/conf/httpd.conf file Zaius Linux - Newbie 6 01-09-2004 11:45 PM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM


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