Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Aug 03, 2011 2:54 pm 
Offline
Newbie

Joined: Wed Jul 27, 2011 12:03 pm
Posts: 3
When creating virtual hosts,

Is "ServerName" what distinguishes requests from each other?

Say I had three domains, domain1.com, domain2.com, and domain3.com. They are all set up with DNS to point to my node's IP address.

I should then, create three VirtualHost entries, with ServerName corresponding respectively to each, and specifying separate directories.

But just to make sure, "ServerName" is what determines where each domain goes, even if they're all pointing to the same ip?

For example, I go to example1.com in my browser. Apache loads the VirtualHost who's servername is "www.example1.com" and shows that corresponding directory in the browser?

_________________
Up and coming Debian Linux server admin :)


Top
   
PostPosted: Wed Aug 03, 2011 3:02 pm 
Offline
Senior Member

Joined: Fri Dec 10, 2010 6:21 am
Posts: 144
sam-the-man wrote:
When creating virtual hosts,

Is "ServerName" what distinguishes requests from each other?

Say I had three domains, domain1.com, domain2.com, and domain3.com. They are all set up with DNS to point to my node's IP address.

I should then, create three VirtualHost entries, with ServerName corresponding respectively to each, and specifying separate directories.

But just to make sure, "ServerName" is what determines where each domain goes, even if they're all pointing to the same ip?

For example, I go to example1.com in my browser. Apache loads the VirtualHost who's servername is "www.example1.com" and shows that corresponding directory in the browser?


Yes, ServerName (as well as ServerAlias) are used for matching the client's Host-header when using name-based virtual hosts.

See http://httpd.apache.org/docs/2.2/vhosts/name-based.html for an overview of name-based virtual hosts and http://httpd.apache.org/docs/2.2/mod/core.html#servernamefor specifics regarding ServerName.


Top
   
 Post subject:
PostPosted: Wed Aug 03, 2011 3:02 pm 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
Basically, yes.

Here are some other guides and documentation:
http://library.linode.com/web-servers/a ... ion-basics

http://httpd.apache.org/docs/2.2/vhosts/


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group