0

I've just installed Ubuntu for the first time, and trying to set parameters for web server. As I've understand I have to place my website inside /var/www/html folder, but I can't even create a file in there. What's the catch? How do I get root permissions?

Cornelius
  • 103

3 Answers3

1

The accepted answer is not a proper way to do this.

You should read: Whats the simplest way to edit and add files to "/var/www"? and follow the suggestions there.

Duncubuntu
  • 11
  • 3
0

If you want to do this in Terminal or SSH, instead of using your graphical interface, you just need prefix your commands with sudo. Eg:

New folder:

sudo mkdir testsite

Edit a file:

sudo nano index.html

Also, a quick and dirty way of always giving yourself access:

sudo chown -R username /var/www/html
-1

gksu nautilus /var/www/html in terminal

ike
  • 1,210
  • 1
  • 14
  • 29
  • gksu is depreciaged and most servers are not running X – Panther Oct 30 '14 at 04:41
  • Don't know but it worked for me. I had to let it install 'gksu' program, and later it prompted me to create 'root/.config/nautilus folder' and now I'm looking at my webpage. Thank you very much Ike. – Cornelius Oct 30 '14 at 04:45