Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local Development, Apache vs Developer - file permissions

I am interested in setting up a local php testing / development environment using the lamp stack.
I would like to use the php plugin for eclipse (I typically work with java and am very familiar with eclipse).

  • First of all, is it proper practice to develop my site locally directly within the apache /var/www directory?
  • If this is ok, can somebody describe how to properly set the permissions of the www directory so that eclipse (not being run as root) has access to read/modify php files within that directory?

This is strictly for local development so I assume security isn't as high of an issue.


1 Answers

It doesn't matter, I personally placed it in /var/www/ and put it under the www-data group, and placed my username into the www-data group.

You add yourself into the group with:

sudo usermod -a -G www-data <username>

Change the group to www-data just in case you haven't:

sudo chgrp -R www-data /var/www

Get new files to inherit the permissions (750)

sudo chmod -R 2750 www-data /var/www

Some people prefer to put it in /home/username/www/ which would be easier.

like image 189
KahWee Teng Avatar answered Jul 21 '26 02:07

KahWee Teng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!