Its name is a portmanteau of "light" and "httpd": lighttpd is a simple, standards-compliant, secure, and flexible web server.
lighttpd is a powerful server, made long ago to handle upwards of 10,000 connections in parallel on one server. It was used in wikipedia server a log time ago and also some google services.
|Main package name||lighttpd|
|Manpages and DOCs packages||lighttpd-doc|
|Configuration file||/etc/lighttpd/lighttpd.conf||A vanilla default configuration|
|Html place for system pages||/var/www/localhost/htdocs/||Each web server in alpine has own path for that|
|Dynamic files (cache, extra)||/var/lib/lighttpd/||Created dynamically, each server in alpine has own path for that|
|Log files (error, access, etc)||/var/log/lighttpd/||Each web server in alpine has own path for that|
|User running the webserver||lighttpd||Others Linux used "www-data" alpine has as a group|
|Group to common to webserver||www-data||Used to share things amont others daemons or services, like redis or apache files|
|Programed on||C and lua||Main engine code in C, modules and config in Lua variants|
Some common hosting panels do not handleconfiguration management.
No HTTP/3 support.
As we read previously.. main purpose was handle several request on one server, so are focused on high load.
As main front end web server are perfect and it's recommended as reverse proxy server foror .
The installation works just out of the box for only static pages, just with install you can see webserver in action by put any file inside the /var/www/localhost/htdocs/ directory.
Per user web files are supported by default in /home/<user>/public_html directory by default if we enable it (process are described below in further section "Lighttpd configuration".
is available in the Alpine Linux repositories. To install, simple launch the commands below:
apk add lighttpd rc-update add lighttpd default rc-service lighttpd restart
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".
For testing open a browser and go to
http://127.0.0.1/ and you will see "Lighttpd is running...". Note that we used "127.0.0.1" if you are using alpine as the only machine for all as your main desktop/pc/machine.
If you are using alpine remotelly as web server and just install it the package, open a browser in your desktop machine, and go to
http://<webserveripaddres>/. The "webserveripaddres" are the ip address of your setup/server machine.
If you just want to serve simple HTML pages lighttpd can be used out-of-box. No further configuration needed.
For production purposes the Production LAMP system: Lighttpd + PHP + MySQL wiki page will explain in details all the needs, there's the Production Lets Encrypt: dehydrated wiki page with futher information to use HTTPS and lets encrypt certificates.
Due to the minimalism of alpine linux, unfortunately the lighttpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance, see the Production LAMP system: Lighttpd + PHP + MySQL wiki page to goin in deep about configuring lighttpd web server.
Start lighttpd: After the installationis not running. As we made in first section was started already but if you want to start manually use:
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 in the same way of previous command:
Restart lighttpd: After changing the configuration file lighttpd needs to be restarted.
Proper Runlevel: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there's no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated
In production web, LAMP means Linux + Apache + Mysql + Php installed and integrated, but today the "A" of apache are more used as Nginx or Lighttpd, and the "M" of MySQL are more used as Mariadb, the LAMP focused documents are:
- Setting Up Lighttpd with PHP
- Lighttpd Advanced security
- Production Lets Encrypt: dehydrated
- LAMP deploy of the Web Server with PHP, user html_dir and MariaDB: Production LAMP system: Lighttpd + PHP + MySQL
- LAMP deploy of the Web Server with PHP 5.6 and MariaDB: Production LAMP system: Lighttpd + PHP5 + MySQL
- Alpine newbie developer
- Alpine newbie lammers