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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to set up new virtual host records

Discussion in 'Bind / DNS / Nameserver Issues' started by PeterNolan, Mar 25, 2017.

  1. PeterNolan

    PeterNolan Registered

    Joined:
    Jan 2, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Reseller Owner
    Hi Guys,
    Ok.

    I am embarassed because I did this before, 18 months ago, and can't remember how I did it or find the documentation to do it again.

    I have a centos VPS server running WHM/Cpanel and I run about 20 sites on it.

    eg example.com and example2.com just as 2.

    I have created 2 more sites I want to get running but I can not for the life of me remember how I connected them to the virtual host file which is generated.

    When I go in to the virtual hosts file I get this sort of thing.

    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

    I can see the entry for example.com as below.

    Could any of you young whipper snappers help out a forgetful old man and tell me where the hell the option is to add new virtual directories so that I can get more sites set up on my VPS?

    And thanks for being tolerant of those of us who have poorer memories than you young guys... ;-)

    Best Regards

    Peter
    Code:
    # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
    
    <VirtualHost 66.84.x.xxx:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /home/example/public_html
    ServerAdmin webmaster@example.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/example.com combined
    <IfModule log_config_module>
    <IfModule logio_module>
    CustomLog /usr/local/apache/domlogs/example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    </IfModule>
    </IfModule>
    ## User example # Needed for Cpanel::ApacheConf
    <IfModule userdir_module>
    <IfModule !mpm_itk.c>
    <IfModule !ruid2_module>
    UserDir enabled example
    </IfModule>
    </IfModule>
    </IfModule>
    
    # Enable backwards compatible Server Side Include expression parser for Apache versions >= 2.4.
    # To selectively use the newer Apache 2.4 expression parser, disable SSILegacyExprParser in
    # the user's .htaccess file. For more information, please read:
    # mod_include - Apache HTTP Server Version 2.4
    <IfModule include_module>
    <Directory "/home/example/public_html">
    SSILegacyExprParser On
    </Directory>
    </IfModule>
    
    <IfModule suphp_module>
    suPHP_UserGroup example example
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    <IfModule !mod_ruid2.c>
    SuexecUserGroup example example
    </IfModule>
    </IfModule>
    <IfModule ruid2_module>
    RMode config
    RUidGid example example
    </IfModule>
    <IfModule mpm_itk.c>
    # For more information on MPM ITK, please read:
    # apache2-mpm-itk
    AssignUserID example example
    </IfModule>
    
    <IfModule alias_module>
    ScriptAlias /cgi-bin/ /home/example/public_html/cgi-bin/
    </IfModule>
    
    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2_4/example/example.com/*.conf"
    </VirtualHost>
    
     
    #1 PeterNolan, Mar 25, 2017
    Last edited by a moderator: Mar 25, 2017
  2. ronaldst

    ronaldst Active Member

    Joined:
    Feb 22, 2016
    Messages:
    28
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Norway
    cPanel Access Level:
    Root Administrator
    I would suggest logging in to WHM's configuration panel and add it from there.

    Normally a domain can be added to an already existing user account or to a new one.
     
  3. PeterNolan

    PeterNolan Registered

    Joined:
    Jan 2, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Reseller Owner
    Hi Ronaldst,
    that is my problem. I have gone through every option I can find from WHM menu panel and I can't find the spot to add the web sites to the virtual directory. I know it must be here somewhere because I did it 18 months ago. I don't know if the option has moved or been obscured somehow. But I can't find it again.

    I have tried going to the control panel of the two new accounts/sites I want to add and I can't find an option to add them through the menus there either.

    I am guessing that people who do this regularly will know where the option is. I can't even find it in the documentation because I have searched. I also asked my ISP with no luck...so this is why I am asking here. :)
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,428
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can add new domain names as new accounts from Web Host Manager using the create a new account feature:

    Create a New Account - Documentation - cPanel Documentation

    If you want to add a domain name as an Addon domain name to an existing account, you can use the Addon Domains feature in cPanel:

    Addon Domains - Documentation - cPanel Documentation

    If you do not see these options, then you may want to consult with your web hosting provider to inquiry why the features were removed from your reseller account.

    Thanks!
     
Loading...

Share This Page