The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Creating a new virtual host

Discussion in 'General Discussion' started by cacathcart, Oct 24, 2006.

  1. cacathcart

    cacathcart Member

    Joined:
    Sep 8, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I recently migrated my client accounts to a new server. When you go to the IP address using a web browser, instead of showing my server site or a cPanel default page, one of my clients accounts is showing up. I was told I needed to create a new virtual host, but I am not sure how to do this. Help!
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    SSH into your server

    nano /usr/local/apache/conf/httpd.conf

    do a search for the domain thats showing up (using ctrl w)

    and add the text in red adding your ip to it should look closley to below then restart apache and it will show the default page


    NameVirtualHost yourip:80


    <VirtualHost yourip>
    BytesLog domlogs/your.hostname.com-bytes_log
    ServerName your.hostname.com
    DocumentRoot /usr/local/apache/htdocs
    </VirtualHost>


    <VirtualHost yourip>
    ServerAlias domain.com
    ServerAdmin webmaster@domain.com
    DocumentRoot /home/username/public_html
    BytesLog domlogs/domain.com-bytes_log
    User username
    Group username
    ServerName www.domain.com

    User username
    Group username
    CustomLog /usr/local/apache/domlogs/domain.com combined
    ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
    </VirtualHost>
     
  3. cacathcart

    cacathcart Member

    Joined:
    Sep 8, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Thank you!

    That worked perfectly. Thank you so much!
    :D
     
Loading...

Share This Page