Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Granting user permissions using sudo chown -R $USER:$USER /dir/ectory/

I am following this tutorial: How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS.

I get an error on: Step Two — Grant Permissions which states the following:

Now we have the directory structure for our files, but they are owned by our root user. If we want our regular user to be able to modify files in our web directories, we can change the ownership by doing this:

sudo chown -R $USER:$USER /var/www/example.com/public_html
sudo chown -R $USER:$USER /var/www/test.com/public_html

The $USER variable will take the value of the user you are currently logged in as when you press "ENTER". By doing this, our regular user now owns the public_html subdirectories where we will be storing our content.

We should also modify our permissions a little bit to ensure that read access is permitted to the general web directory and all of the files and folders it contains so that pages can be served correctly:

sudo chmod -R 755 /var/www

Your web server should now have the permissions it needs to serve content, and your user should be able to create content within the necessary folders.

I typed in the line in Command Line: sudo chown -R $USER:$USER /dir/ectory/ and then I get an error which says: chown: invalid group: ‘developer:developer’

I have searched and found no working solutions to this problem. I am using Ubuntu 14.04. I'm both new to Ubuntu and Stackoverflow so I apologise for any stupid mistakes that I mightn't made while asking the question. Any help is grealy appreciated!

like image 892
shhasan Avatar asked Sep 03 '14 21:09

shhasan


1 Answers

This worked:

sudo chown -R username:usergroup /var/www/nameofdirectory
like image 76
shhasan Avatar answered Sep 23 '22 15:09

shhasan