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

Edit Nginx Vhost - Add path to open_basedir

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
1 post • Page 1 of 1
alexgarciab
Posts: 1
Joined: Thu Dec 10, 2020 6:02 pm

Os: CentOS 7x
Web: nginx + php-fpm
Edit Nginx Vhost - Add path to open_basedir
  • Quote

Post by alexgarciab » Thu Dec 10, 2020 6:12 pm

Hi there, I work with VestaCP + nginx + php-fpm.

I want to be able to serve the content under "base-domain.com", when the user access to the "additional-domain.com" (on base-domain.com I have a PHP script that serves different content based on the domain from the request is coming from).

To do so, I have modified the %docroot% variable on the .stpl and .tpl vhosts files of "additional-domain.com" to the "base-domain.com" absolute path:

/home/user/web/base-domain.com/public_html/

However, when I try to access to "additional-domain.com" I get a 404 error.

Reviewing the error log, I see the following message:

Code: Select all

2020/12/10 17:42:12 [error] 1234567#1234567: *2263 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: open_basedir restriction in effect. File(/home/user/web/base-domain.com/public_html/index.php) is not within the allowed path(s): (/home/user/web/additional-domain.com/public_html:/home/user/tmp:/var/www/html:/etc/phpmyadmin:/etc/phpMyAdmin:/var/lib/phpmyadmin:/var/lib/phpMyAdmin:/etc/roundcube:/etc/roundcubemail:/var/lib/roundcube:/var/lib/roundcubemail:/tmp:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/share:/var/opt:/opt) in Unknown on line 0Unable to open primary script: /home/user/web/base-domain.com/public_html/index.php (Operation not permitted)" while reading response header from upstream, client: 123.123.123.123, server: additional-domain.com, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/php80-php-fpm-additional-domain.com.sock:", host: "additional-domain.com"
So apart from modifying the %docroot% path, I need to do something else, like allowing additional-domain.com to access the base-domain.com path. I guess this is done by adding a custom rule (open_basedir) to the vhosts (.stpl and .tpl) of the additional-domain.com, but I don't know how to do that.

Anyone can help? Thanks!
Top


Post Reply
  • Print view
1 post • Page 1 of 1

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