Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

If we have a single physical box (single IP address), how could it support multiple domain names, for example, I want to support domains in two patterns,

  1. Pattern is ends with common suffix (b.com), a1.b.com, a2.b.com, a3.b.com, etc.
  2. Pattern is no common suffix (besides .com), b.com, c.com, d.com, etc.
share|improve this question

marked as duplicate by nhinkle Apr 3 '13 at 4:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You mean host multiple websites? What are you using, Apache or IIS? –  Havenard Apr 3 '13 at 2:18
    
Apache, any existing solutions? –  Lin Ma Apr 3 '13 at 2:38
    
Here: httpd.apache.org/docs/2.2/vhosts have fun. –  Havenard Apr 3 '13 at 2:41

2 Answers 2

Initially, all these domains and subdomains would need to pointed at the IP address through DNS.

For web pages, almost any web server can do this, the exact implementation/configuration depends on the web server you choose to run. For example, for Apache, you can find some excellent documentation on their website at http://httpd.apache.org/docs/2.2/vhosts/examples.html

Ultimately, they all work the same way, a client makes a connection to a server and requests "a.com" so the web server will pull files from directory "a". If they request "b.com" the web server will pull files from directory "b".

share|improve this answer
    
Thanks for answering my question, YLearn! –  Lin Ma Apr 3 '13 at 10:06

For pattern one you only need to register "b.com", this is your host domain.

a1.b.com, a2.b.com and a3.b.com are sub domains of b.com, you can create these from your host servers control panel. Doing so should create a new directory folder for each sub domain along side your world wide web (or www) folder. Each sub domain can have it's own content

for pattern 2 though, multiple domains can be registered to the same public IP address but across the board all the content would be the same as they would be accessing the same directories.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.