2

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?

  • I think you also have to update /etc/apache2/envvars but I am not sure. – Raza Jun 17 '13 at 20:38
3

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
0

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.

-1

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

and

chown -R www-data:abc /var/www/project
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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