Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Incorrect open_basedir Topic is solved

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Locked
  • Print view
Advanced search
25 posts
  • 1
  • 2
  • 3
  • Next
sim
Posts: 101
Joined: Sat Nov 22, 2014 7:47 pm

Incorrect open_basedir

Post by sim » Mon Jan 05, 2015 10:52 pm

When using basedir template, you won't be able to manage uploaded files, because open_basedir restriction is set only to the public_html.

Is this a bug?
Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/user/web/domain.com/public_html) in Unknown on line 0, referer: http://domain.lt/ordo/wp-admin/post.php ... ction=edit
PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Incorrect open_basedir

Post by skurudo » Wed Jan 07, 2015 6:04 am

sim wrote:When using basedir template, you won't be able to manage uploaded files, because open_basedir restriction is set only to the public_html.

Is this a bug?
Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/user/web/domain.com/public_html) in Unknown on line 0, referer: http://domain.lt/ordo/wp-admin/post.php ... ction=edit
PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0
You can disble open_basedir (not good idea)

Code: Select all

 <Directory /home/%user%/web/%domain%/public_html>
        php_admin_value open_basedir none
    </Directory>
Or you can add to /usr/local/vesta/data/templates/web/apache2/basedir.tpl / basedir.stpl (or which you use for domain) a little fix:

Code: Select all

php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
Rebuild web for domain from control panel and restart apache2 from Services.

PS: Yeah, it's a bug. I read about it from this forum, but can't find where. Sorry.;)
Top

sim
Posts: 101
Joined: Sat Nov 22, 2014 7:47 pm

Re: Incorrect open_basedir

Post by sim » Wed Jan 07, 2015 12:22 pm

Thanks your your answer, i fixed it myself, just can't believe they missed it.
Top

patstan
Posts: 117
Joined: Wed Jul 30, 2014 10:53 am

Re: Incorrect open_basedir

Post by patstan » Sun Feb 08, 2015 11:41 am

Code: Select all

php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
Do i add this directly to the bottom of this template?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Incorrect open_basedir

Post by skurudo » Mon Feb 09, 2015 6:23 am

No, no, no - in directory

Let's show full template /usr/local/vesta/data/templates/web/apache2/basedir.stpl:

Code: Select all

<VirtualHost %ip%:%web_ssl_port%>

    ServerName %domain_idn%
    %alias_string%
    ServerAdmin %email%
    DocumentRoot %sdocroot%
    ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
    Alias /vstats/ %home%/%user%/web/%domain%/stats/
    Alias /error/ %home%/%user%/web/%domain%/document_errors/
    #SuexecUserGroup %user% %group%
    CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
    CustomLog /var/log/%web_system%/domains/%domain%.log combined
    ErrorLog /var/log/%web_system%/domains/%domain%.error.log
    <Directory %sdocroot%>
        AllowOverride All
        SSLRequireSSL
        Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f info@%domain%"
    </Directory>
    <Directory %home%/%user%/web/%domain%/stats>
        AllowOverride All
    </Directory>
    SSLEngine on
    SSLVerifyClient none
    SSLCertificateFile %ssl_crt%
    SSLCertificateKeyFile %ssl_key%
    %ssl_ca_str%SSLCertificateChainFile %ssl_ca%

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid %user% %group%
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID %user% %group%
    </IfModule>

    Include %home%/%user%/conf/web/s%web_system%.%domain%.conf*

</VirtualHost>
Top

zaqueon
Posts: 11
Joined: Thu Nov 06, 2014 9:24 am
Contact:
Contact zaqueon
Website

Re: Incorrect open_basedir

Post by zaqueon » Wed Nov 16, 2016 11:45 am

Hi,

There is no such folder in my centos7.
Can you tell me the correct folder in centos7?

Thank you.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Incorrect open_basedir

Post by skurudo » Tue Dec 06, 2016 2:14 pm

zaqueon wrote: There is no such folder in my centos7.
Can you tell me the correct folder in centos7?
apache2 in centos has name httpd

/usr/local/vesta/data/templates/web/httpd/basedir.stpl
Top

Daimko
Posts: 27
Joined: Sun Mar 26, 2017 9:43 pm

Os: Debian 7x
Web: apache + nginx
Re: Incorrect open_basedir

Post by Daimko » Wed Apr 19, 2017 2:07 pm

Hello,

I'm having the same problem on: http://refugio-pineta.es.
The 3 lines are already present in the 2 files so how do ?

Code: Select all

php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
Thanks in advance for your help !
Top

ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: Incorrect open_basedir

Post by ScIT » Fri Apr 21, 2017 12:43 pm

Daimko wrote:Hello,

I'm having the same problem on: http://refugio-pineta.es.
The 3 lines are already present in the 2 files so how do ?

Code: Select all

php_admin_value open_basedir %docroot%:%home%/%user%/tmp
php_admin_value upload_tmp_dir %home%/%user%/tmp
php_admin_value session.save_path %home%/%user%/tmp
Thanks in advance for your help !
Just add /tmp to the open_basedir list:

Code: Select all

php_admin_value open_basedir %docroot%:%home%/%user%/tmp:/tmp
But it's better to create a new, own template in /usr/local/vesta/data/web/apache2/ (just copy default.tpl and default.stpl to a new name (forexample test.tpl/test.stpl) and change the files).
Top

Daimko
Posts: 27
Joined: Sun Mar 26, 2017 9:43 pm

Os: Debian 7x
Web: apache + nginx
Re: Incorrect open_basedir

Post by Daimko » Sat Apr 22, 2017 8:41 am

The problem is still present :

Code: Select all

Warning: file_exists (): open_basedir restriction in effect. File (/ home / u941222742 / public_html / wp-content / uploads / 2017/04) (/home/admin/web/refugio-pineta.es/public_html:/home/admin/ Tmp) in /home/admin/web/refugio-pineta.es/public_html/wp-includes/functions.php on line 1611
An idea ?
Thank you in advance for your help.
Top


Locked
  • Print view

25 posts
  • 1
  • 2
  • 3
  • Next

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password