Page 1 of 1

disable openbase_dir - Fixed

Posted: Sat Jan 12, 2019 10:16 pm
by clu55ter

Code: Select all

[code]
[/code]Hi All, i'm a novice Ubuntu user and I've installed Ubuntu 18.04 on my vps and then installed vestacp to manage my websites, one of my apps (elgg) needs a data directory outside of the public_html folder to store the sites media files. I've been trying to find out how i can disable and set openbase_dir to none. Although I set the openbase_dir = none in php.ini this hasn't worked.

Can anyone please point me in the right direction.

Thanks

Re: disable openbase_dir

Posted: Sun Jan 13, 2019 12:19 am
by skamasle
HI

You can disable it directly from httpd templates or modify your templates to add new path in open_basedir and then you need rebuild vhosts

Edit for exmple

Code: Select all

/usr/local/vesta/data/templates/web/httpd/phpfcgid.stpl
/usr/local/vesta/data/templates/web/httpd/phpfcgid.tpl
Or any orther templates you use

The run v-rebuild-web-domains

Re: disable openbase_dir

Posted: Sun Jan 13, 2019 12:20 pm
by clu55ter
skamasle wrote:
Sun Jan 13, 2019 12:19 am
HI

You can disable it directly from httpd templates or modify your templates to add new path in open_basedir and then you need rebuild vhosts

Edit for exmple

Code: Select all

/usr/local/vesta/data/templates/web/httpd/phpfcgid.stpl
/usr/local/vesta/data/templates/web/httpd/phpfcgid.tpl
Or any orther templates you use

The run v-rebuild-web-domains
Thank you for your response!

When I nano into the files you mentioned above they are empty, is this correct or should I be using a different method to edit them?
When I try to cd into the directories through ssh it just says No such file or directory exists?

Thanks again for your help!

Re: disable openbase_dir

Posted: Sun Jan 13, 2019 6:17 pm
by skamasle
Try access to dirs, dirs may change if you use ubuntu ( httpd / apache), I not know what system you use so, names may vary, try access to /usr/local/vesta and then find files into dirs

Re: disable openbase_dir

Posted: Sun Jan 13, 2019 6:43 pm
by skamasle
Sorry not see in first post than you use ubuntu

Re: disable openbase_dir

Posted: Sun Jan 27, 2019 11:11 am
by clu55ter
Thanks a lot for your help @skamasle.

I finally managed to get some time yesterday to look into this and manage to sort it out with your help.
I will just put the steps I took below in case someone else gets stuck with this.

vestacp set up open_basedir Ubuntu 18.04 server.

File locations
To setup invidual website open_basedir find the individual website configuration file in:
/home/username_here/conf/web/sub.domain.com.apache2.conf

To setup the template file so that each new site created vestacp will be configured open_basedir:
/usr/local/vesta/data/templates/web/apache2/default.tpl

Changes required.
To set a base to a directory of you choice find the line below and make sure your change the_username/sub.domain.com and change the basedir directory location of your choice to this end of the line where I've put /directory_name_here***
php_admin_value open_basedir /home/the_username/web/sub.domain.com/public_html:/home/the_username/directory_name_here***

Hope others will find this useful.
Thanks