A
A
Alexander Grishin2016-06-02 18:38:05
linux
Alexander Grishin, 2016-06-02 18:38:05

Protect neighboring sites from the site. How?

There is nginx+phpfpm
There is a directory /var/www
In it:
site1.ru
site2.ru
site3.ru
All three sites are mine and no one except me works with them.
A friend asked me to host his site:
site4.ru
on my server, but
this script works with a bang site4.ru/index.php:

<?php
$fp = fopen("../../site1.ru/htdocs/test.txt", "w");
fwrite($fp, $text);
fclose($fp);
?>

In the end, I'm worried)
How to be? So that he can execute and read files no further than his root directory.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Алексей Черемисин, 2016-06-02
@beerdy

отchrootи его - https://gir.me.uk/nginx-php-fpm-with-chroot/

Сергей, 2016-06-02
@gangstarcj

Надо каждому сайту своего пользователя делать и свою папку

Влад Животнев, 2016-06-02
@inkvizitor68sl

chroot + basedir

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question