Answer the question
In order to leave comments, you need to log in
Nginx and website in home/username - how to set permissions correctly?
Ubuntu + nginx + php-fpm.
Standard setting according to the guide from the issuance of Google (like this one ). Root is not allowed to login, all configuration is done by username via sudo.
FTP access from this user to his directory using vsftpd.
There is a directory: /home/username/example.com/public_html
In nginx, a host with root is configured for this directory, but when I enter, I get a 403 Forbidden error.
The set of commands that I achieved:
1. Correct work on ftp (add, delete, etc.) under this user
2. index.html opens
3. Wordpress is installed (with the creation of a config file), plugins are installed, files are uploaded
sudo usermod -aG www-data username
sudo chown -R www-data:www-data /home/username/example.com/public_html
sudo chmod -R 0775 /home/username/example.com/public_html
Answer the question
In order to leave comments, you need to log in
give rights only to the user and his group
in nginx set up work only from this user in php-fpm too
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question