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 add vhost

Discussion in 'General Discussion' started by bryan.kewl, Feb 26, 2011.

  1. bryan.kewl

    bryan.kewl Member

    Joined:
    Feb 23, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    I want to add some vhosts, and want to make sure that when someone add a domain/account from WHM/cPanel it don't erase my settings.
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    The vhost configurations are stored in /var/cpanel/userdata for each user, in yaml format. However, if you're adding stuff manually I suppose the best way to do this is via include. Add:

    Include "/path/to/file"

    to point to the file that contains the additional configuration, and cpanel shouldn't mess with it.
     
  3. bryan.kewl

    bryan.kewl Member

    Joined:
    Feb 23, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    and where should I include this file? and how can I make sure cpanel will include the file always and won't overwrite it
     
  4. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    I usually put my includes in /usr/local/apache/conf/

    From there, add the include to httpd.conf above the first virtualhost entry (or within a vhost section if appropriate) and run:

    /usr/local/cpanel/bin/apache_conf_distiller --update

    To see if the changes would be overwritten by cPanel, run /scripts/rebuildhttpdconf . If the include does not belong to a specific vhost, cPanel will relocate the include to near the top of httpd.conf where the others are.
     
  5. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page