Warning: This page has beta status

Use case

Webservers are widely used to serve html pages with or without dynamic content. Start here for a quick introduction.

It is also a very good example service for minimal servers in a network system to illustrate connectivity and test port forwards.

This guide is for Debian (and ubuntu based systems) and we will install lighttpd, which is a lightweight webserver.

Installing

  1. Log in as root

    On Ubuntu, use sudo bash to get a command prompt as root. On Debian, use suand supply root password

  2. Run apt-get update

    Do this to update the repository list. It just solves a lot of issues before they arize.

  3. Run apt-get install lighttpd

  4. Run nano /var/www/html/index.htmland paste the following

     <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
     <HTML>
        <HEAD>
           <TITLE>
              A Small Hello
           </TITLE>
        </HEAD>
     <BODY>
        <H1>Hi</H1>
        <P>This is very minimal "hello world" HTML document.</P>
     </BODY>
     </HTML>
    

    This createsCreate your own start page,

  5. Feel awesome

Test

  1. On the server, run w3m http://localhost

    This gives you text mode version of the html page you installed

  2. On another machine, run wget http://<ip address>/index.html, where is the address of the server

    This will download index.html. To see it, use cat index.html

  3. Start your browser and go to http://<ip address>

Remarks

HTTP is bad for privacy, use the encrypted verison instead. Let’s encrypt may help you with that.

Further reading

(to come if they are added…)