Skip to content

Simple Linux webserver

Oleksandr Porunov edited this page Apr 19, 2017 · 3 revisions

This instraction describes how to run a simple Linux webserver to serve well-known files (HTTP01 challenges) in several steps.

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

    mkdir -p /var/www/.well-known/acme-challenge
    
  2. Copy your well-known files into the /var/www/.well-known/acme-challenge directory.

  3. Enter your server directory

    cd /var/www
    
  4. 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.