How to Host Multiple domain under a single IP

Discussion in 'Site & Server Administration' started by sruthin, Nov 28, 2010.

  1. #1
    How to Host Multiple domain under a single IP, iam using cent os, webmin?
     
    sruthin, Nov 28, 2010 IP
  2. vrsho

    vrsho Member

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    If u have apache installed. U need to set up virtual hosting for your server.
    editing /etc/httpd/conf/httpd.conf

    and u add domains like this:

    <VirtualHost *:80>
    DocumentRoot /home/domain1.com/htdocs
    ServerName domain1.com
    ServerAlias *.domain1.com
    </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot /home/domain2.com/htdocs
    ServerName domain2.com
    ServerAlias *.domain2.com
    </VirtualHost>
     
    vrsho, Nov 28, 2010 IP
  3. sruthin

    sruthin Peon

    Messages:
    130
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for your replay..
    i have some doubts, If i have a domain say www.domain.com which is using one public ip 10.20.10.10,and The DNS is pointed in www.name.com(Domain registrar)
    Now i want to host another website say www.domain2.com,In the DNS(domain registrars DNS).I should use the same DNS configuration for the second and third domain ( 10.20.10.10)? OR I shold maintain my own DNS server to find the other website?
    and i have some requirement
    if i type 10.20.10.10 it should display the www.domain.com instead of blank page
    can you tell me the steps to do that?
    Thank You
     
    Last edited: Nov 29, 2010
    sruthin, Nov 29, 2010 IP
  4. atxsurf

    atxsurf Peon

    Messages:
    2,394
    Likes Received:
    21
    Best Answers:
    1
    Trophy Points:
    0
    #4
    you can host your dns with your domain registrar and put the same ip (ip of your server) in A record for both domains
    and why you need anything to show by ip instead of domain name?
     
    atxsurf, Nov 29, 2010 IP
  5. sruthin

    sruthin Peon

    Messages:
    130
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thank you i want to access my website by typing both ip and name.will it work ?
     
    sruthin, Dec 1, 2010 IP
  6. atxsurf

    atxsurf Peon

    Messages:
    2,394
    Likes Received:
    21
    Best Answers:
    1
    Trophy Points:
    0
    #6
    i think there is either a "default server" entry or you put * in ServerName to access by ip.
    but i strongly advise AGAINST it. Do you want google to index your site by ip?
     
    atxsurf, Dec 1, 2010 IP
  7. akabou

    akabou Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    your web server identfies which virtual domain you want to acces, depending
    on the http header
    if you type the ip address which domain would you like to access
     
    akabou, Dec 4, 2010 IP
  8. VINEETYADAV

    VINEETYADAV Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    if you want multiple sites on single ip it will be port based

    in other case, it will be hostname (domain.com) based....

    but its definitely possible
     
    VINEETYADAV, Dec 9, 2010 IP
  9. webtalk

    webtalk Well-Known Member

    Messages:
    283
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    135
    #9
    you have to define virtual host and the same can be done via cpanel using add-on domains, check host name details here hostname
     
    webtalk, Dec 11, 2010 IP