Add permissions to /var/www in ubuntu

Add permissions to /var/www in ubuntu
Hey Folks,

You might be having troubles adding files and folders to the /var/www folder of Ubuntu installation. Sometimes various other folders also require root permission to perform some action on it. So in that case you can use the following command.

gksudo nautilus

This gives the root permissions and open Nautilus File manager in the GUI mode. The folder opened inside the browser is /root by default and you can browse to the desired folder and perform the administrative tasks. If you want to add something real quick in a folder with root permissions you can do so using the terminal. Browse to the folder and add using the Sudo command, as show below.

> cd /var/www

>sudo vi index.php

This will ask for password and will create a file index.php file. You can also use sudo with nautilus, but gksudo is safer for GUI applications and is used in combination with GUI apps.

Hope this helps.