Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
docs:user-guide:services:webserver:http.uhttpd [2018/03/03 19:10] bobafetthotmaildocs:guide-user:services:webserver:http.uhttpd [2023/10/14 06:02] – update vgaetera
Line 1: Line 1:
 ====== uHTTPd webserver ====== ====== uHTTPd webserver ======
-**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 [[docs:techref:luci|LuCI]] web interface to administer OpenWrt. In addition, it provides all the functionality expected of present day web servers.+**uHTTPd is configured to be the default [[docs:techref:luci|LuCI]] web interface for OpenWrt.** 
 +It is a web server written to be an efficient and stable server,  
 +suitable for lightweight tasks commonly used with embedded devices and  
 +proper integration with OpenWrt's configuration framework (UCI). 
 +In addition, it provides all the functionality expected of present day web servers. 
 + 
 +Its source code is available in the following git repository: 
 + 
 +  * https://git.openwrt.org/project/uhttpd.git
  
 ===== Features ===== ===== 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). +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).
  
-uHTTPd is built by default (since r35295 in Jan2013) to support the usage of TLS (HTTPS) via a libustream-* SSL library (on top of an actual SSL library: polarssl, mbedtls, cyalssl, openssl). Previously the package ''uhttpd-mod-tls'' was required, but it is not needed any more as long as you have installed a libustream library variant. Since Dec2016 luci-ssl installs by default libustream-mbedtls.+uHTTPd is built by default (since r35295 in Jan2013) to support the usage of TLS (HTTPS) via a libustream-* SSL library (on top of an actual SSL library: mbedtls (formerly polarssl), openssl, wolfssl (formerly cyassl)). 
 +Previously the package ''uhttpd-mod-tls'' was required, but it is not needed any more as long as you have installed a libustream library variant. 
 +In Dec 2016 luci-ssl installed by default libustream-mbedtls
 +In Aug 2020 luci-ssl installed by default WolfSSL. 
 +Since Feb 2023 luci-ssl switched back to mbedtls installing libustream-mbedtls by default.
  
-In contrast to many other web servers, it also supports [[docs:user-guide:services:uhttpd#luci.with.embedded.lua.interpreter|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. +In contrast to many other web servers, it also supports [[docs:guide-user:services:webserver:uhttpd#luci_with_embedded_lua_interpreter|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 ===== ===== 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: +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''. 
-  opkg update +Installation can be done with:
-  opkg install uhttpd+
  
-However, it is usually installed automatically as a dependency for the [[docs:user-guide:services:webinterface.overview|web interface]] LuCI. Installing a web interface for administering an OpenWrt device therefore only consists of installing the web interface, in this case [[docs:techref:luci|LuCI]]. See the [[docs:user-guide:services:luci.essentials-tomerge|LuCI on uHTTPd configuration page]] to get started. Of course, you can use a web interface with [[..:http.overview|any other web server]]. +<code bash> 
 +opkg update 
 +opkg install uhttpd 
 +</code> 
 + 
 +However, it is usually installed automatically as a dependency for the [[docs:guide-user:luci:webinterface.overview|web interface]] LuCI. 
 +Installing a web interface for administering an OpenWrt device therefore only consists of installing the web interface, in this case [[docs:techref:luci|LuCI]]. 
 +See the [[docs:guide-user:luci:luci.essentials|LuCI on uHTTPd configuration page]] to get started. 
 +Of course, you can use a web interface with [[docs:guide-user:services:webserver:start|any other web server]].
  
 ===== Configuration ===== ===== Configuration =====
-Configuration of uHTTPd integrates nicely with OpenWrt's user interface system, through standard [[docs:user-guide:base-system: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 [[docs:user-guide:services:uhttpd|the uHTTPd UCI configuration page]]. +Configuration of uHTTPd integrates nicely with OpenWrt's user interface system, through standard [[docs:guide-user:base-system:uci]]. 
 +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 [[docs:guide-user:services:webserver:uhttpd|the uHTTPd UCI configuration page]]
 +uHTTPd can be managed by the uhttpd service.
  
-uHTTPd also properly provides an init script /etc/init.d/uhttpd to start or stop the service and enable it at boot time.+==== Using the default installation for publishing files ==== 
 +One could use the default installation for publishing files. 
 +A quick example is to disable the redirect to luci scripts.
  
-==== Using the default installation for publishing files. ==== +<code bash>
-One could use the default installation for publishing files. A quick example is to disable the redirect to luci scripts. +
-<file>+
 mv /www/index.html /www/index.html.orig mv /www/index.html /www/index.html.orig
-</file>+</code>
  
 Done this anything is shown as list of file and even symbolic links works. Done this anything is shown as list of file and even symbolic links works.
 +
  • Last modified: 2023/10/14 06:02
  • by vgaetera