How do I create a subdomain in Apache running on CentOS

Discussion in 'Apache' started by Just need it, Sep 1, 2011.

  1. #1
    Title says it all, How to create a subdomain ?
     
    Just need it, Sep 1, 2011 IP
  2. MayurGondaliya

    MayurGondaliya Well-Known Member

    Messages:
    1,233
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    170
    #2
    
    <VirtualHost ip.address.of.host.some_domain.com>
        ServerAdmin webmaster@host.some_domain.com
        DocumentRoot /www/docs/host.some_domain.com
        ServerName host.some_domain.com
        ErrorLog logs/host.some_domain.com-error_log
        CustomLog logs/host.some_domain.com-access_log common
    </VirtualHost>
    
    Code (markup):
    Create a new file at /etc/httpd/conf.d/somename.conf and add above text in it and restart your apache.
     
    MayurGondaliya, Sep 5, 2011 IP
  3. chtdatweb

    chtdatweb Well-Known Member

    Messages:
    1,473
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    160
    #3
    And of course dont forget to point the sub domain to the server.
     
    chtdatweb, Sep 8, 2011 IP
  4. Just need it

    Just need it Active Member

    Messages:
    146
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Thanks Guys.
     
    Just need it, Sep 8, 2011 IP