Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

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.

share|improve this question

marked as duplicate by Jorge Castro, James Apr 7 '12 at 21:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 1 down vote accepted

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.

share|improve this answer
That worked, thank you very much – Jon Apr 4 '12 at 4:53

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

share|improve this answer
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 3 '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 3 '12 at 21:44

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