0

Possible Duplicate:
Whats the simplest way to edit and add files to “/var/www”?

I can't seem to move folders or create new folders in the /var/www folder. This is the first time i have tried using Ubuntu and i can't seem to find a reason why i'm not able to move folders, i only have one account so should have all the priviliges.

Jon
  • 585

2 Answers2

1

You need to set the proper filesystem privileges:

sudo chown <youruser>:www-data /var/www
sudo chmod 0775 /var/www
sudo chmod g+s /var/www

Replace <youruser> with your own username. No logout/login required.

Axel
  • 316
0

The /var/www/ folder is normally owned by root.

Try this

sudo chmod 0775 /var/www 
sudo chown root.www-data /var/www 
sudo usermod -a -G www-data your-username

logoff then login, then try writing back to the /var/www folder

  • Just tried that, didn't seem to make any difference. The main thing i am trying to do is set up localhost. Is there a way to give all root priviliges to my account ? – Jon Apr 03 '12 at 20:02
  • No this is not possible. You can only gain root privileges via sudo or su for a normal user account. Generally it is not a good idea working with root privileges all the time. – Axel Apr 03 '12 at 21:44