Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running ubuntu 12.04 LTS . To be able to view my web project in the browser I did the following:

chown -R www-data:www-data /var/www/project

Now I wanted to open the project in netbeans but it has not the permissions to read or write. So I created another group called netbeans and added the current user and www-data user to that group.

chgrp -R netbeans /var/www/project

but netbeans still cannot write or even read. And it seams that apache only can read the project folder when its owner is www-data.

Any ideas how to solve this?

share|improve this question
I think you also have to update /etc/apache2/envvars but I am not sure. – Raza Jun 17 '13 at 20:38
up vote 1 down vote accepted

So, assuming you want to allow the users www-data and netbeans to access /var/www/project by adding both of them to the group netbeans:

# you might have done this already, but no harm will be done by
# executing these commands again:
groupadd netbeans
adduser www-data netbeans
adduser netbeans

# set the user 'www-data' and the group 'netbeans' as the owners
chown www-data:netbeans -R /var/www/project
# allow group members to read and write files
chmod g+rw -R /var/www/project
share|improve this answer

What user does netbeans run as? Most likely not www-data (as that is Apache, I think), but if you can find out you can add the user of netbeans to the group named www-data and that should do the trick.

share|improve this answer

Suppose you are logged as abc and launched netbean, then abc user should have the permission for read and write. This you can set as

chmod -R 775 /var/www/project


chown -R www-data:abc /var/www/project
share|improve this answer
Marking every file in /var/www/project as executable is really bad style, to say the least... – n.st Sep 14 '13 at 22:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.