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
Next revisionBoth sides next revision
docs:guide-user:luci:luci.on.lighttpd [2019/11/30 23:04] – Updated cgi-bin handling to work with latest LUCI oldiumdocs:guide-user:luci:luci.on.lighttpd [2021/04/23 14:01] oldium
Line 1: Line 1:
 ====== LuCI on lighttpd ====== ====== LuCI on lighttpd ======
-This article explains how to run the [[docs:techref:luci]] web interface on the [[docs:guide-user:services:webserver:lighttpd|lighttpd]] web server.  +LuCI is the main web administration utility for OpenWrt. **By default LuCI uses [[docs:guide-user:services:webserver:http.uhttpd|uHTTPd]]** 
-LuCI is the main web administration utility for OpenWrt. By default it is installed with [[docs:guide-user:services:webserver:http.uhttpd|uHTTPd]]. You can of course use any other web server for LuCI. There are a couple available in the OpenWrt archives: [[docs:guide-user:services:webserver:start]] + 
-This is the howto for lighttpd.+You can use other web servers for LuCI. There are a couple available in the OpenWrt archives: [[docs:guide-user:services:webserver:start]] This article explains how to run the [[docs:techref:LuCI]] web interface on the [[docs:guide-user:services:webserver:lighttpd|lighttpd]] web server
  
 See also: See also:
Line 8: Line 8:
   * [[docs:guide-user:services:webserver:lighttpd]]   * [[docs:guide-user:services:webserver:lighttpd]]
   * [[docs:guide-user:luci:luci.essentials]]    * [[docs:guide-user:luci:luci.essentials]] 
 +
 +:!: From the lighttpd server **version 1.4.56**, the HTTP/2 is enabled by configuration, **version 1.4.59** has it enabled by default, so if you have a modern browser, it will use the new protocol. There is a [[https://redmine.lighttpd.net/issues/3078|problem]] with HTTP/2 implementation, which might influence loading of LuCI page and might prevent its usage. Pressing F5 (**reload**) makes the page working again (once for login page, once after logging in), or there is a possibility to work-around the issue and disable HTTP/2 in the [[docs:guide-user:luci:luci.on.lighttpd#http2_issue_workaround|configuration]].
  
 ===== Installation ===== ===== Installation =====
Line 18: Line 20:
 </code> </code>
 **NOTE**: The **libiwinfo** package is only needed if your router has wireless.  **NOTE**: The **libiwinfo** package is only needed if your router has wireless. 
 +
 +Since lighttpd package version 1.4.56 the **SSL** module is not installed by default and you need to install one:
 +<code>
 +# Check the up-to-date list of lighttpd modules
 +opkg list lighttpd*
 +# Choose one and install it, version 1.4.56 offers lighttpd-mod-gnutls, lighttpd-mod-mbedtls, lighttpd-mod-nss, lighttpd-mod-openssl, lighttpd-mod-wolfssl
 +opkg install lighttpd-mod-openssl
 +</code>
  
 Then choose a LuCI theme Then choose a LuCI theme
Line 45: Line 55:
 "/cgi-bin/cgi-backup" => "", "/cgi-bin/cgi-backup" => "",
 "/cgi-bin/cgi-download" => "", "/cgi-bin/cgi-download" => "",
 +"/cgi-bin/cgi-exec" => "",
 "/cgi-bin/cgi-upload" => "" "/cgi-bin/cgi-upload" => ""
 </code> </code>
Line 58: Line 69:
                                "/cgi-bin/cgi-backup" => "",                                "/cgi-bin/cgi-backup" => "",
                                "/cgi-bin/cgi-download" => "",                                "/cgi-bin/cgi-download" => "",
 +                               "/cgi-bin/cgi-exec" => "",
                                "/cgi-bin/cgi-upload" => "",                                "/cgi-bin/cgi-upload" => "",
                                 )                                 )
Line 78: Line 90:
 <code> <code>
 ## Necessary LUCI configuration ## Necessary LUCI configuration
-cgi.assign += ( "cgi-bin/luci" => "", +cgi.assign += ( "/cgi-bin/luci" => "", 
-                "cgi-bin/cgi-backup" => "", +                "/cgi-bin/cgi-backup" => "", 
-                "cgi-bin/cgi-download" => "", +                "/cgi-bin/cgi-download" => "", 
-                "cgi-bin/cgi-upload" => "" )+                "/cgi-bin/cgi-exec" => "", 
 +                "/cgi-bin/cgi-upload" => "" )
  
 server.username := "" server.username := ""
Line 87: Line 100:
 </code> </code>
  
-Or use a catch-all-CGI syntax: +Or specify CGI execution as a default for a whole ''/cgi-bin'' URL:
- +
-<code> +
-## Necessary LUCI configuration +
-cgi.assign += ( "" => ""+
- +
-server.username := "" +
-server.groupname := "" +
-</code> +
- +
-Or do this just for ''/cgi-bin'' URL:+
  
 <code> <code>
Line 110: Line 113:
  
 ☝ The key to understand it is that ''+='' merges the values, '':='' replaces/overwrites previously assigned value and ''='' simply assigns a value if not set already (see [[https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_Configuration|lighttpd configuration documentation]]). ☝ The key to understand it is that ''+='' merges the values, '':='' replaces/overwrites previously assigned value and ''='' simply assigns a value if not set already (see [[https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_Configuration|lighttpd configuration documentation]]).
 +
 +==== HTTP/2 Issue Workaround ====
 +
 +OpenWrt enabled HTTP/2 in version 1.4.56 in the configuration, version 1.4.59 has it enabled by default. Usage of HTTP/2 exposed a [[https://redmine.lighttpd.net/issues/3078|problem]] in HTTP/2 implementation, which might influence loading of LuCI page and might prevent its normal usage. Pressing F5 (**reload**) makes the page working again (once for login page, once after logging in), or there is a possibility to work-around the issue and disable HTTP/2 in ''/etc/lighttpd/lighttpd.conf'':
 +
 +<code>
 +server.feature-flags += ("server.h2proto" => "disable")
 +server.feature-flags += ("server.h2c"     => "disable"                                                           s
 +</code>
 +
  
 ==== Finalizing the configuration ==== ==== Finalizing the configuration ====
  • Last modified: 2021/04/25 05:51
  • by oldium