How to add domain names to Apache?

Discussion in 'Site & Server Administration' started by thuankkk, Apr 3, 2009.

  1. #1
    Hi,

    I have an unmanaged VPS with Centos 5 and SSH, I installed Apache 2 using yum.
    I have only one dedicated IP.
    Now I can access my web located at /var/www/html through its IP, eg 1.2.3.4

    Now I wanna add 3 domain names to my server, like this
    domain1.com -> /var/www/domain1
    domain2.com -> /var/www/domain2
    domain3.com -> /var/www/domain3

    In my domain control panel, I can edit name server, cname, a.
    The sreen looks like this (same with A):
    Add CNAME record for domain1.com  [Cancel]
    1. Enter a subdomain:
    [                 ].domain1.com
    2. Enter the CNAME:
    [                  ]
    3. Click to add.               [Add]
    
    Code (markup):
    Please help me to set up domain names :)
     
    thuankkk, Apr 3, 2009 IP
  2. ClassHelper.org

    ClassHelper.org Guest

    Messages:
    273
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Unless you really want to do all the work manually (no problem there, it's just a pain), you should check out Falko's excellent Perfect Server with CentOS 5.2 tutorial. You can follow the instructions to get your system ready set up a free hosting control panel like ISPConfig, which will let you do all the Apache, mail, SSH, and server configuration from your web browser in a nice GUI. Good luck :).
     
    ClassHelper.org, Apr 4, 2009 IP
  3. Jafhost

    Jafhost Peon

    Messages:
    148
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Read up on VirtualHost entries. You can place them on the bottom of httpd.conf .

    Or, you can make sure of Webmin and Virtualmin - up to you.
     
    Jafhost, Apr 5, 2009 IP
    thuankkk likes this.
  4. tera

    tera Peon

    Messages:
    159
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think this is not what you want to do.Try to see apache configuration file httpd.conf and learn how to add virtual hosts.Good luck.
     
    tera, Apr 6, 2009 IP