Question
403 You don't have permission to access xxxx on this server. (sudo chown www-data:www-data -R /var/www)
Hello,
I'm new using DigitalOcean
I created a Droplets with Ubuntu 14.04, I followed the instructions in the Initial Server Setup, create a new user, change the SSH port, etc., I followed the tutorial for LAMP Stack on Ubuntu 14.04, I have installed Apache2, MySQL, PHP, Secure phpMyAdmin installation, configure the host to run through a domain (Setup Host Name), install WordPress; Postfix, ProFTPd for file transfer over SSH (sftp).
When I was installing a Wordpress theme, I requested for details SSH keys, searching Google I found that assigning changing the public_html owner from my user to www-data, wordpress works fine! sudo chown www-data:www-data -R /var/www/html, the theme was installed without problems, I work several days without errors, until I tried the sftp via ssh.
Using the sftp I had access to my user's folder but when I went to /var/www/html, there is not files or cannot see them, I realized that changing the permissions to www -data, my user did not have access to them, so I change the owner of the files to my new user, not root, I assign the chown to the new user created in the initial server setup. The page began to launch a 403 Forbidden.
I put back chown to www-data on folder /var/www/ and now I see the index.php (Default page) but can’t navigate or see any post or subfolder, the server say: 403 " You do not have permission to access on this server xxxx."
Any help?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
You should try this
For apache2 below 2.4.7
$ sudo chmod -R 777 /var/www/
For apache2 2.4.7 onwards use following command
$sudo chmod -R 777 /var/www/html/
Never ever set a folder to 777, especially using recursive flag. It will expose to security threats. Golden rule: