For simple static sites is it enough to put an index.html in var/www/html?

Posted October 24, 2016 6.9k views
Linux BasicsUbuntu

Hi there, I’m trying to reacg my webserver from the browser. For this reason I created a very simple index.html in my #/var/www/html directoryjust to show if the server is reachable from a normal browser. Unfortunately it didn’t work.
I’m running on Ubuntu 16.04.1 and the directory www/html have not been set up with the installation so I created them o my own.

Any ideas how to find my “web-root”?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

To reach your static content via browser, you must have installed Web Server.
You have two choices - Apache or Nginx. For your static needs, chose whatever you want. Both will come to same, maybe Nginx uses less memory if that matters to you.

DigitalOcean has tutorial for both:
How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04.
How To Install Linux, Nginx, MySQL, PHP (LEMP stack) in Ubuntu 16.04.

Chose one, set up it and you are ready to go!

Note that these tutorials covers PHP and MySQL too. If you don’t need them, feel free to skip it

In case you don’t want to set up it manually, DigitalOcean covered you with One-Click Apps which can set up LAMP or LEMP for you. Just to note, for this method you will have to rebuild droplet, and after it completes, put your files under /var/www/html again.

by Brennen Bearnes
A "LAMP" stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is...