Lighttpd: Difference between revisions

From Alpine Linux
Line 32: Line 32:
If you want to stop the web server use ''stop''.
If you want to stop the web server use ''stop''.

{{Cmd|/etc/init.d/lighttpd stop}}
{{Cmd|rc-service lighttpd stop}}

=== Restart lighttpd ===
=== Restart lighttpd ===

Revision as of 13:20, 4 November 2013

lighttpd is a simple, standards-compliant, secure, and flexible web server.

General information

  • Configuration file: /etc/lighttpd/lighttpd.conf
  • Standard directory for files: /var/www/localhost/htdocs/


lighttpd is available in the Alpine Linux repositories. To install, simple launch the command below:

apk add lighttpd


If you just want to server simple HTML pages lighttpd can be used out-of-box. No further configuration needed.

Controlling Lighttpd

Start lighttpd

After the installation lighttpd is not running. To start lightttpd, use start.

/etc/init.d/lighttpd start

You will get a feedback about the status.

 * Caching service dependencies                                 [ ok ]
 * Starting lighttpd...                                         [ ok ]

Stop lighttpd

If you want to stop the web server use stop.

rc-service lighttpd stop

Restart lighttpd

After changing the configuration file lighttpd needs to be restarted.

rc-service lighttpd restart


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

rc-update add lighttpd default

Testing Lighttpd

This section is assuming that lighttpd is running. If you now launch a web browser from a remote system and point it to your web server, you will see a page that says "404 - Not Found". Well, at the moment there is no content available but the server is up and running.

Let's add a simple test page to get rid of the "404 - Not Found page".

echo "Lighttpd is running..." > /var/www/localhost/htdocs/index.html

Now you will get the new "test page" if you reload.

Advanced configurations