Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    151
    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,742
    Likes Received:
    77
    Trophy Points:
    353
    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>
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cacathcart

    cacathcart Member

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

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice