I'm setting up a new website on a new Ubuntu droplet at Digital Ocean. I set this up previously on a different droplet and rsynced the website contents to it. I followed directions I found on the web, but didn't keep detailed-enough notes. I'm just trying to replicate this on the new Droplet. But I've messed up somehow. My knowledge of permissions, etc. is rudimentary :-(
My server has: /var/www/html
This is what I did:
• sudo usermod -a -G www-data [myusername] • sudo chown -R www-data:www-data /var/www • sudo chmod -R g+rw /var/www • sudo chmod -R g+rws /var/www
I then created “/var/www/howardmann.us/public_html” for my website.
(I didn't put the public_html directory in var/www/html. I didn't on my other Droplet. Perhaps I should.)
sudo ls -la /var/www
total 16 drwxrwsr-x 4 www-data www-data 4096 Feb 25 15:43 . drwxr-xr-x 14 root root 4096 Feb 24 14:27 .. drwxr-sr-x 3 root www-data 4096 Feb 25 15:43 howardmann.us drwxrwsr-x 2 www-data www-data 4096 Feb 25 15:42 html
sudo ls -la /var/www/howardmann.us/public_html total 8 drwxr-sr-x 2 root www-data 4096 Feb 25 15:43 . drwxr-sr-x 3 root www-data 4096 Feb 25 15:43 ..
Now, excerpts of rsync script (successful to my other Droplet) result from my laptop now:
1.
howardm$ ./deploy.sh sending incremental file list rsync: failed to set times on "/var/www/howardmann.us/public_html/.": Operation not permitted (1)
rsync: recv_generator: mkdir "/var/www/howardmann.us/public_html/css" failed: Permission denied (13) * Skipping any contents from this failed directory *
3.
rsync: mkstemp "/var/www/howardmann.us/public_html/.DS_Store.8zaaQg" failed: Permission denied (13)
Question: How do I fix ownership and permissions on the server directories for 1) proper permissions for a website and 2) permit a rsync deploy?
For comparison, here is the status of my current working web site on the other Droplet:
howardm@howardmann:~$ ls -la /var/www/ total 20 drwxrwxr-x 5 howardm www-data 4096 Mar 5 2016 . drwxr-xr-x 13 root root 4096 Mar 28 2015 .. drwxrwxr-x 4 howardm www-data 4096 Jun 8 2016 howardmann.us drwxrwxr-x 2 howardm www-data 4096 Mar 29 2015 html
Thanks!
Howard