I'm using plain Ubuntu Desktop 11.04 and installed my lamp stack using lamp-server. I am trying to use Netbeans as my IDE.
Currently, all virtual hosts are being run from
/var/www/vhostname -- but as I have not configured any groups or permissions, if I try to open any of the files through Netbeans it does not have write permission.
How can I properly set up permissions (or configure Apache or Netbeans) so that:
- Files created by a php script can be
- Files created by Netbeans can be
I attempted to
chown everything to my user/group which gave Netbeans write permission, but then Apache did not have write permission.
Note: This is purely for a development machine -- not used in production, and I am the only user on this box.
I used to use the method in the answer I marked as accepted, but nowadays I do something much simpler:
- I set Apache to run as my user and my group (this is done either in httpd.conf, apache2.conf, or envvars depending on your distro)
- I chown /var/www to my user and group
Voila, Apache has read/write access, and I have read/write access while working on projects.