I am a software developer so I am not so into operating system configuration details and I have the following problem.
I have installed a LAMP environment of an Ubuntu Linux system dedicated to the develop (it is on my PC and it is not a production server).
So I am trying to set the /var/www as the workspace of Aptana (the IDE that I use for PHP develop) but I can't do it because I have not the permission to write in this directory (I think that it is my logged user that have not this permission).
So I know that probably I can solve this issue simply changing this permission by:
sudo chmod -R 777 /var/www/
I think that it makes readable, writable and executable anything that it is into the /var/www/ directory, is it right? But for who? For every user that can be registered on my system or only for the logged user?
Reading online it seems to me that (maybe, I am absolutly not sure) I can obtain the same result (write into the /var/www/ directory) by doing something like:
sudo chown -R myUserName:www-data /var/www/
sudo chmod -R g+s /var/www/
Is these 2 commands true for my pourpose? What exactly does? I am trying to read the official documentation and it seems to me that works in this way:
First I set my user as the owner of the /var/www/ directory (so it means that it can write into this directory and in all subdirectories because use the -R parm?) and assigns the www-data group. But what is this www-data group? Is it a standard Linux group or is a new group that simply can group member?
I really have no idea about what exactly does the second statment. What it does?
What solution are better?
www
withchmod 777
. You can read many other reason to avoid it e.g. from here.