From Alpine Linux
Revision as of 11:39, 23 November 2016 by Slukin (talk | contribs) (Setup)
Jump to: navigation, search

mini_httpd is a small HTTP server. Its performance is not great, but for low or medium traffic sites it's quite adequate. It implements all the basic features of an HTTP server.


mini_httpd package is available in the Alpine Linux repositories. To install it run:

apk add mini_httpd

Preparing home directory

mkdir /www chown minihttpd /www

Before writing your configuration perhaps you may wish to backup original configuration file

mv /etc/mini_httpd/mini_httpd.conf /etc/mini_httpd/mini_httpd.conf.orig

Creating mini_httpd configuration file

vi /etc/mini_httpd/mini_httpd.conf

## do not leave empty lines in here!

Creating sample .html file

vi /www/index.html

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    Server is online

Starting mini_httpd

rc-service mini_httpd start

 * Starting mini_httpd ...                                               [ ok ]


This section is assuming that mini_httpd is running and sample html page "/www/index.html" is created. Launch a web browser and point it to your web server. You should get:

Server is online

You can also test web server with curl

apk add curl curl http://localhost


Normally you want to start the web server when the system is launching. This is done by adding mini_httpd to the needed runlevel.

rc-update add mini_httpd default

Now mini_httpd should start automatically when you launch your system next time. To test that run:


To make sure that mini_httpd is started run:

ps aux | grep mini_httpd

You should get something like this:

  580 minihttp   0:00 /usr/sbin/mini_httpd -i /var/run/mini_httpd/ -C /etc/mini_httpd/mini_httpd.conf -l /var/log/mini_httpd/mini_httpd.log

mini_httpd with Haserl

Haserl is a small program that uses shell or Lua script to create cgi web scripts. It is intended for environments where PHP or ruby are too big.

Setting Up mini_httpd with Haserl