LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-27-2010, 10:22 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Question Understanding Server URL Structures


I guess I am trying to understand how webmaster's configure their servers on the Internet. I see servers that have the following:

http://mail.mydomain.tld
http://wiki.mydomain.tld
http://www.mydomain.tld

Now I find it very hard to believe that the webmaster above for 'mydomain.tld' has three separate unique servers for each hostname (mail, wiki, and www) above. Is it possible to get all the hostnames or aliases above running from one single piece of hardware? If so, how does that work? Obviously my single server will only have one unique hostname.

Thanks for any info!
 
Old 10-27-2010, 11:07 AM   #2
PehJota
Member
 
Registered: Aug 2010
Distribution: Desktop and netbook: Debian Squeeze; Router: DD-WRT
Posts: 43

Rep: Reputation: 5
In the days of HTTP 1.0, web resources at these different domain names would all have to be served by different physical servers. HTTP 1.1 made mandatory the "Host" header in requests, which tells the web server the domain name (or IP address) you are looking for (e.g. wiki.mydomain.tld vs. www.mydomain.tld). This made name-based virtual hosting possible (which is now used by all shared web hosting providers). The user's web browser sends a "Host" header with a request to tell the server which virtual host it wants to "connect to". The server checks its configuration, finds the document root for that virtual host, and returns the resource.

Here is some documentation on how to do this in Apache (according to which, this feature has been in Apache since version 1.3).
 
Old 10-27-2010, 11:28 AM   #3
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
First of all you start with the DNS settings.

have an A record for mydomain.tld pointing to
1.2.3.4

so when you enter mydomain.tld into a browser, it'll resolve to that IP.

The corresponding machine associated with that specific IP will have a webserver installed and configured to serve requests to that specific mydomain.tld.

See the virtual host docu linked by PehJota.

Of course you can also have multiple web servers installed.

DNS:
have an A record for mydomain.tld pointing to 1.2.3.4
have an A record for test.mydomain.tld pointing to 1.2.3.4

server:
have apache configured to serve incoming requests for mydomain.tld in the config settings (RH based: /etc/httpd/conf.d/mydomain.tld.conf Debian based: /etc/apache2/sites-enabled/mydomain.tld which is a symlink to /etc/apache2/sites-available/mydomain.tld )

have nginx configured to serve incoming requests for test.mydomain.tld in the config settings (similar location setting for Debian based, not sure right now for RHEL based).

Through both methods you have one physical machine serving incoming requests to different websites, either by one web server having multiple virtual hosts configured, or by having different web servers installed (for various reasons, e.g. using a light weight server such as lighttpd for serving static files, such as css,jpgs, etc.)

You do also get the situations where different sub domains point to different machines

DNS:
have an A record for mydomain.tld pointing to 1.2.3.4 (machine A)
have an A record for mail.mydomain.tld pointing to 10.20.30.40 (machine A)

machines:
machine A will serve only mydomain.tld
machine B will serve only mail.mydomain.tld probably a webmail interface such as squirrelmail, horde, roundcube

presumably having the mail on a different machine, you're probably also running the mail system there too, such as postfix/dovecot.

DNS:
have an MX record for mail.mydomain.tld pointing to 10.20.30.40 (machine B)

machine:
have postfix/dovecot configured to handle incoming mail to @mydomain.tld mail addresses
have the webmail software configured to access those mails upon successful login.

you can have as many subdomains on one machine as you want (or machine's capable of) as well as having as many subdomains resolving to as many machines you have (budget allows)

Having some subdomains pointing to different machines may depend on the services you're running, as well as the load taken by a site, etc. (many reasons for splitting up)

Then of course there are also wildcards, for where you don't have an A record set, such as for
thisdoesnotexist.mydomain.tld

In that case you can have your config set to point to a generic page, or redirect to a different existing site.

k, may have gone overboard here a little, but I think you get the jist(sp?) of it
 
1 members found this post helpful.
  


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
The requested URL /server-inifo not found on this server narsimha.v Linux - Software 1 01-18-2008 01:57 AM
URL Filtering Server ericunicast Linux - Server 2 01-12-2008 10:12 PM
problem in sending array of structures in client/server program soumya_b Programming 5 01-21-2007 03:53 AM
how do i know mysqld server url amolgupta Linux - Software 1 04-09-2006 02:46 PM
Redirecting URL to another server wilcoNL Linux - Software 3 04-05-2004 07:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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