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.

open_basedir including public_html but not home directory of user

Discussion in 'General Discussion' started by aww, Sep 4, 2011.

  1. aww

    aww Well-Known Member

    Joined:
    Feb 10, 2005
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    On a relatively new cpanel install but I noticed only /home/username/public_html is included in open_basedir, not /home/username

    Is there an easy way to add /home/username this and regenerate open_basedir for all users?

    Or is it still like it was years ago where you have to completely rebuild apache via easy apache to fix?
     
  2. aww

    aww Well-Known Member

    Joined:
    Feb 10, 2005
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    in /var/cpanel/templates/apache2/vhost.default
    I see the vhost.homedir included - is that not /home/username ? it's actually /home/username/public_html ?

    Code:
     <IfModule concurrent_php.c>
            php4_admin_value open_basedir "[% vhost.homedir %]:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/ph$
            php5_admin_value open_basedir "[% vhost.homedir %]:/usr/lib/php:/usr/local/lib/php:/tmp"
        </IfModule>
        <IfModule !concurrent_php.c>
            <IfModule mod_php4.c>
                php_admin_value open_basedir "[% vhost.homedir %]:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib$
            </IfModule>
            <IfModule mod_php5.c>
                php_admin_value open_basedir "[% vhost.homedir %]:/usr/lib/php:/usr/local/lib/php:/tmp"
            </IfModule>
            <IfModule sapi_apache2.c>
                php_admin_value open_basedir "[% vhost.homedir %]:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib$
            </IfModule>
     
  3. aww

    aww Well-Known Member

    Joined:
    Feb 10, 2005
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    aha! I found it

    it's actually in /var/cpanel/templates/apache2/vhost.local

    it's set to

    php_admin_value open_basedir "[% vhost.documentroot %]

    instead of

    php_admin_value open_basedir "[% vhost.homedir %]

    so I guess search/replace all that and run

    /usr/local/cpanel/bin/apache_conf_distiller --update
    /usr/local/cpanel/bin/build_apache_conf
    service httpd restart
     
    #3 aww, Sep 4, 2011
    Last edited: Sep 4, 2011
  4. 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
    /var/cpanel/templates/apache2/vhost.local would be a revised copy that is user created rather than the default one. The default one we provide is vhost.default rather than vhost.local
     
Loading...
Similar Threads - open_basedir including public_html
  1. dorac
    Replies:
    13
    Views:
    939
  2. likudio
    Replies:
    7
    Views:
    496

Share This Page