Answer the question
In order to leave comments, you need to log in
How to properly organize the server so that each site has its own user?
Hello, please tell me, there is a server (VDS) on nginx, there is one site, several more sites are planned on this server (VDS) in the future, I would like to make sure that each site has its own user, and with the help of this user already execute various actions with the site, for example, do git pull via ssh, etc. And for security purposes, too, so that, for example, a user of one site cannot access another site.
I'm currently trying to do something like this:
useradd user1
well, and accordingly I set a password for this user and a base directory was created in/home/user1
/var/www/user1/data/www/example.ru
, and starting from the user1 folder, the owner and group user1 are set on folders and files/etc/passwd
I overwrite the base directory for the user user1, I get the following entry: /var/www/user1/data
, and I set the primary group for this user to user1. And I disable ssh access for ftpuser1, it's just possible that someone else will need to provide ftp access, and so that this ftp user cannot connect via ssh.example.ru
to the laravel project folder, I made all the settings with the site.The stream or file "/var/www/user1/data/www/example.ru/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied
file_put_contents(/var/www/user1/data/www/example.ru/storage/framework/sessions/ckX60GiELzZh2hvPSOviGoPhHV7eu2w6jxTGL5Sa): failed to open stream: Permission denied
/storage/framework/views
when I cache view files using the command php artisan view:cache
, files with permissions 664 are created in this folder [- rw-rw-r--], sometimes laravel adds changes to these files, and accordingly, with such rights, it cannot add anything, an error occurs:file_put_contents(/var/www/user1/data/www/example.ru/storage/framework/views/3a754a39b6fbbfc12ae706bdbb58d5d83ed2c712.php): failed to open stream: Permission denied
php artisan view:cache
, new files with permissions 664 [-rw-rw-r--] will appear and the error will repeat. user1
, for example, maybe this will solve the problem? But what if I didn't have Nginx on the server, but Apache? Answer the question
In order to leave comments, you need to log in
https://www.dmosk.ru/instruktions.php?object=hosting Keep the instructions. However, kvm or ovz may suit you.
proftpd can map owners and permissions according to the users and permissions available on the system.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question