2

Possible Duplicate:
What is the best way to add files to a website on a LAMP Server?

I have installed lamp on Ubuntu 12.04.

I try to access /var/www but it doesn't allow me to do anything as it says I don't have permissions.

I have tried:

1.
gksudo nautilus - which works but its very inconvenient way of doing things.

2.
sudo adduser ryan www-data
sudo chown -R www-data:www-data /var/www
sudo chmod g+rw /var/www

The above didn't work.

I have googled and searched this site for a solution, but all the existing possible solutions have not worked.

RSM
  • 1,595

2 Answers2

3

You need to use usermod.

usermod will modify your user.

You can then modify your user to be part of the www-data group.

$ sudo usermod -a -G www-data your-user

http://www.computerhope.com/unix/usermod.htm

dibs
  • 3,489
0

This is probably not the most secure or recommended solution, but sudo chmod 764 should give you what you need, assuming your user is an owner or group member. If not, 766 should work but that means any user on your system can write to that directory. Not secure, but if you need a quick fix it ought to work.

weberc2
  • 1,402