View Full Version : [SOLVED] How to make /var/www/ writable?

June 15th, 2011, 12:56 PM

I just installed a lamp server on my 10.04 desktop. Server files should be in /var/www/ but I have no normal rights to put any file in there, which is quite annoying when I simply want to put file in and out of that folder to test things out.

Any help how I can do that? Would that be dangerous for the safety of my basic Ubuntu installation? I just need the server for testing purposes and I will not use it as an actual server to run a live website on..

June 15th, 2011, 01:07 PM

Use these commands:

$sudo chmod 765 -R /var/www/
$sudo chown <username> /var/www/
$sudo chgrp <usergroup> /var/www/
Replace <username> with your user name and <usergroup> with your group (this will probably be the same as your username).

June 15th, 2011, 01:09 PM
you can list permissions with a command such as:

ls -l /var/www

If you want (for testing purposes) to change ownership or permissions, then consider using chown or chmod. For example, the following command would allow full access for everyone:

sudo chmod -R 777 /var/www

The -R makes the command recursive. Obviously the above would never be used in a production environment; you could also simply move the file as root:

sudo mv xxx /var/www/

June 15th, 2011, 01:20 PM
great! Thanks to you both!