We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Edit Nginx Vhost - Add path to open_basedir
-
- Posts: 2
- Joined: Thu Dec 10, 2020 6:02 pm
- Os: CentOS 6x
- Web: nginx + php-fpm
Edit Nginx Vhost - Add path to open_basedir
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:
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!
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"
Anyone can help? Thanks!