Skip to content

Simple Linux webserver

Laurens Blanckenborg edited this page Apr 20, 2017 · 3 revisions

This instruction describes how to run a simple Linux webserver to serve well-known files for HTTP01 challenges in only three steps.

  1. Create a webserver directory and a well-known directory:

    mkdir -p /var/www/.well-known/acme-challenge
    
  2. Navigate to the server directory:

    cd /var/www/
    
  3. Run your server on port 80:

    $(command -v python2 || command -v python2.7 || command -v python2.6) -c
      "import BaseHTTPServer, SimpleHTTPServer;
      s = BaseHTTPServer.HTTPServer(('', 80),
      SimpleHTTPServer.SimpleHTTPRequestHandler); s.serve_forever()"
    

    Press Ctrl + C to stop the server.