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!

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:
    166
    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:
    166
    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:
    166
    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,608
    Likes Received:
    32
    Trophy Points:
    238
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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