Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:luci:luci.on.lighttpd [2018/07/29 20:10] – Documented problem with server's UID/GID and enhanced SSL setup oldium | docs: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: | + | LuCI is the main web administration utility for OpenWrt. |
| - | LuCI is the main web administration utility for OpenWrt. By default | + | |
| - | This is the howto for lighttpd. | + | You can use other web servers |
| See also: | See also: | ||
| * [[docs: | * [[docs: | ||
| - | * [[docs: | + | * [[docs: |
| + | |||
| + | :!: From the lighttpd server **version 1.4.56**, the HTTP/2 is enabled by configuration, | ||
| ===== Installation ===== | ===== Installation ===== | ||
| Line 18: | Line 20: | ||
| </ | </ | ||
| **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: | ||
| + | < | ||
| + | # 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, | ||
| + | opkg install lighttpd-mod-openssl | ||
| + | </ | ||
| Then choose a LuCI theme | Then choose a LuCI theme | ||
| Line 28: | Line 38: | ||
| </ | </ | ||
| - | Afterwards check that ''/ | + | ===== Configuration ===== |
| - | |'' | + | Either go on with default configuration and make few changes, or add a file, which does the same. In order to understand the changes, lets start with default configuration |
| - | Now we need to tell lighttpd to process requests for the web interface using Lua. The LuCI administation package installs a file ''/ | + | ==== Using default |
| - | |''" | + | |
| - | to the cgi configuration | + | |
| - | |'' | + | Check that '' |
| - | " | + | |
| - | " | + | < |
| - | " | + | server.modules += ( " |
| - | " | + | </ |
| - | " | + | |
| - | '' | + | Now we need to tell lighttpd to process requests for the web interface using CGI. The LuCI administation package installs files in ''/ |
| + | < | ||
| + | "/ | ||
| + | "/ | ||
| + | "/ | ||
| + | "/ | ||
| + | "/ | ||
| + | </ | ||
| + | to the cgi configuration file (''/ | ||
| + | |||
| + | < | ||
| + | cgi.assign | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | "/ | ||
| + | "/ | ||
| + | "/ | ||
| + | "/ | ||
| + | | ||
| + | </ | ||
| This makes LuCI work as a CGI process. See http:// | This makes LuCI work as a CGI process. See http:// | ||
| - | Note that the index.html file in the document root ''/ | + | Note that the '' |
| LuCI needs root privileges to access configuration, | LuCI needs root privileges to access configuration, | ||
| Line 54: | Line 84: | ||
| </ | </ | ||
| - | If you want lighttpd' | + | ==== Using easy configuration ==== |
| - | |'' | + | The same effect as the previous changes could be made, if you create file '' |
| - | server.errorlog-use-syslog = " | + | |
| - | '' | + | |
| - | Enable lighttpd (so that it will be started at every boot) and start it: | ||
| < | < | ||
| - | /etc/init.d/ | + | ## Necessary LUCI configuration |
| - | /etc/init.d/ | + | cgi.assign += ( "/cgi-bin/luci" => "", |
| + | "/ | ||
| + | "/ | ||
| + | "/ | ||
| + | "/ | ||
| + | |||
| + | server.username := "" | ||
| + | server.groupname := "" | ||
| + | </code> | ||
| + | |||
| + | Or specify CGI execution as a default for a whole ''/ | ||
| + | |||
| + | < | ||
| + | ## Necessary LUCI configuration | ||
| + | $HTTP[" | ||
| + | cgi.assign += ( "" | ||
| + | } | ||
| + | |||
| + | server.username := "" | ||
| + | server.groupname := "" | ||
| + | </ | ||
| + | |||
| + | ☝ The key to understand it is that '' | ||
| + | |||
| + | ==== HTTP/2 Issue Workaround ==== | ||
| + | |||
| + | OpenWrt enabled HTTP/2 in version 1.4.56 in the configuration, | ||
| + | |||
| + | < | ||
| + | server.feature-flags += (" | ||
| + | server.feature-flags += (" | ||
| + | </code> | ||
| + | |||
| + | |||
| + | ==== Finalizing the configuration ==== | ||
| + | |||
| + | If you want lighttpd's logs in the output of " | ||
| + | |||
| + | < | ||
| + | ## enable syslog | ||
| + | server.errorlog-use-syslog = " | ||
| </ | </ | ||
| - | Add the following for the server to listen on ipv4 and ipv6 | + | Add the following for the server to listen on ipv4 and ipv6 (create for example ''/ |
| < | < | ||
| #Listen on ipv4 | #Listen on ipv4 | ||
| Line 76: | Line 143: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | Enable lighttpd (so that it will be started at every boot) and start it: | ||
| + | < | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| ===== SSL Redirect ===== | ===== SSL Redirect ===== | ||
| Line 129: | Line 203: | ||
| Now we simply need to use lighttpd' | Now we simply need to use lighttpd' | ||
| - | | '' | + | < |
| - | server.document-root = "/ | + | $SERVER[" |
| - | }'' | + | server.document-root = "/ |
| + | } | ||
| + | </ | ||
| After restarting lighttpd your website is on port 81 and LuCI is still on port 80 using lighttpd. Naturally, you can interchange these two ports such that the website is on the default HTTP port 80 and set the web interface on port 81. | After restarting lighttpd your website is on port 81 and LuCI is still on port 80 using lighttpd. Naturally, you can interchange these two ports such that the website is on the default HTTP port 80 and set the web interface on port 81. | ||