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.

Customize apache's default VirtualHost

Discussion in 'EasyApache' started by prohostvn, May 8, 2012.

  1. prohostvn

    prohostvn Registered

    Joined:
    May 7, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I also can not change my default virtualhost

    <VirtualHost 221.132.35.203:80>
    ServerName vdc035203.prohost.vn
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin notifysystem@prohost.vn
    <IfModule mod_suphp.c>
    suPHP_UserGroup nobody nobody
    </IfModule>
    UserDir disable
    </VirtualHost>


    I tried to add this directly to httpd.conf, ex:
    I want to change "DocumentRoot /usr/local/apache/htdocs" ==> "DocumentRoot /home/default/public_html".
    Then rebuild, and the change is lost.

    Thanks!
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,451
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    After making changes you'll need to distill to protect those changes:
    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    That should do it.
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Modifying /usr/local/apache/conf/httpd.conf directly for the VirtualHost sections will not be maintained at all. This is indicated above each one, including the default VHost for the server's hostname:

    If you wish to modify that default entry, you'd do so in /var/cpanel/userdata/nobody/host.domain.com where host.domain.com is the server's hostname. Here's what it looks like:

    Code:
    root@host [~]# cat /var/cpanel/userdata/nobody/host.domain.com
    ---
    documentroot: /usr/local/apache/htdocs
    group: nobody
    hascgi: 1
    ifmodulemodsuphpc:
      group: nobody
    ip: "*"
    phpopenbasedirprotect: 1
    port: 80
    serveradmin: user@email.com
    serveralias: ''
    servername: host.domain.com
    usecanonicalname: 'Off'
    user: nobody
    userdirprotect: ''
    If you revise the path in this file, please run the following commands afterward:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak120508
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    Thanks!
     
Loading...
Similar Threads - Customize apache's default
  1. clusters
    Replies:
    3
    Views:
    296

Share This Page