Table of Contents

uHTTPd

uHTTPd is a web server written from scratch by OpenWrt/LuCI developers. It is aimed towards being an efficient and stable server, suitable for lightweight tasks commonly used with embedded devices and proper integration with OpenWrt's configuration framework (UCI). In particular, it is configured by default for the LuCI web interface to administer OpenWrt. In addition, it provides all the functionality expected of present day web servers.

Features

Built as a general purpose HTTP daemon, uHTTPd is not merely intended for running the OpenWrt's web interface but has functionality up to par with any other modern web server. Included is support for TLS (SSL), CGI and Lua. It is single threaded but supports multiple instances (i.e. multiple listen ports, each with its own document root and other features).

To use TLS (HTTPS support), the package uhttpd-mod-tls is required.

In contrast to many other web servers, it also supports running Lua in-process, which can speed up Lua CGI scripts. Note that LuCI, which depends on Lua, is not configured in this manner by default.

Installation

uHTTPd is the standard HTTP server for OpenWrt, but it is not included by default in the system image for the main OpenWrt releases. The package name is uhttpd. Installation can be done with:

opkg -update
opkg install uhttpd

However, it is usually installed automatically as a dependency for the web interface LuCI. Installing a web interface for administering an OpenWrt device therefore only consists of installing the web interface, in this case LuCI. See the LuCI on uHTTPd configuration page to get started. Of course, you can use a web interface with any other web server.

Configuration

Configuration of uHTTPd integrates nicely with OpenWrt's user interface system, through standard UCI, provided since OpenWrt 10.03 (Backfire). The UCI configuration file is /etc/config/uhttpd. Since uHTTPd depends on this file directly, there is no second configuration file that gets written by UCI when settings are committed (like is the case with many other applications, such as Samba). Since uHTTPd is configured as part of the UCI system, refer to the uHTTPd UCI configuration page.

uHTTPd also properly provides an init script /etc/init.d/uhttpd to start or stop the service and enable it at boot time.

Back to top

doc/howto/http.uhttpd.txt · Last modified: 2013/08/11 16:15 by grabbel