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.essentials [2019/03/25 13:39] – [LuCI] Title vgaeteradocs:guide-user:luci:luci.essentials [2023/04/03 01:00] – [Offline installation] vgaetera
Line 1: Line 1:
-====== LuCI Essentials ====== +====== LuCI essentials ====== 
- +{{section>meta:infobox:howto_links#basic_skills&noheader&nofooter&noeditbutton}}
-<WRAP info> +
-This article relies on the following skills: +
-  * [[docs:guide-user:base-system:user.beginner.cli|Use command-line interface]] +
-  * [[docs:guide-quick-start:sshadministration|Access OpenWrt via SSH]] +
-  * [[docs:guide-user:additional-software:opkg|Manage packages with Opkg]] +
-</WRAP>+
  
 ===== Introduction ===== ===== Introduction =====
 While OpenWrt can be managed completely using SSH and the terminal, the LuCI WebUI makes many administration tasks easier. While OpenWrt can be managed completely using SSH and the terminal, the LuCI WebUI makes many administration tasks easier.
-The OpenWrt full releases, such as the current 18.06.x series, ship with the LuCI WebUI installed.+The OpenWrt full releases, such as the current 21.02.x series, ship with the LuCI WebUI installed.
 But for lower-memory devices, such as those with 4MBytes Flash and/or 32MBytes of RAM, the full install may fail because of lacking sufficient Flash memory so you will have to [[docs:guide-user:additional-software:imagebuilder|build your own image]] with LuCI included. But for lower-memory devices, such as those with 4MBytes Flash and/or 32MBytes of RAM, the full install may fail because of lacking sufficient Flash memory so you will have to [[docs:guide-user:additional-software:imagebuilder|build your own image]] with LuCI included.
 More info on this can be obtained [[docs:guide-user:additional-software:saving_space|here]]. More info on this can be obtained [[docs:guide-user:additional-software:saving_space|here]].
  
-===== Online Installation ===== +===== Instructions ===== 
-==== Basic Installation ==== +==== 1. Basic installation ==== 
-Connect to your router via SSH and install the packages.+Install the required packages.
  
 <code bash> <code bash>
Line 23: Line 17:
 </code> </code>
  
-Now you can open //[[http://openwrt.lan/|LuCI]]// interface.+Now you can open LuCI interface.
  
-==== Providing Encryption ==== +==== 2. Providing encryption ==== 
-Connect to your router via SSH and install the packages.+Install the required packages.
  
 <code bash> <code bash>
 opkg update opkg update
-opkg install luci-ssl-openssl+opkg install luci-ssl 
 +/etc/init.d/uhttpd restart
 </code> </code>
  
-Reload //[[http://openwrt.lan/|LuCI]]// interface and verify that you are using HTTPS.+Reload LuCI interface and verify that you are using HTTPS.
  
-==== Native Language Support ====+==== 3. Native language support ====
 LuCI uses English by default. LuCI uses English by default.
 You can search and install additional packages for native language support. You can search and install additional packages for native language support.
Line 45: Line 40:
 </code> </code>
  
-You can also install multiple language packs and switch between them in the LuCI settings or by editing the file -> ''[[doc:uci:luci|/etc/config/luci]]''+You can also install multiple language packs and switch between them in the LuCI settings.
  
-LuCI is being actively translated into many languages by volunteers. +LuCI is being actively [[https://github.com/openwrt/luci/wiki/i18n|translated]] into many languages by volunteers.
-See [[https://github.com/openwrt/luci/wiki/i18n]] and get involved!+
  
-==== Additional WebApps ====+==== 4. Additional web applications ====
 Search and install ''luci-app-*'' packages if you want to configure services via LuCI. Search and install ''luci-app-*'' packages if you want to configure services via LuCI.
  
Line 58: Line 52:
 </code> </code>
  
-==== Details ==== +==== 5. Alternative ports ==== 
-LuCI is installed as a 'meta package' which installs several other packages by having these defined as a dependency. Notably, it installs the [[docs:guide-user:services:webserver:http.uhttpd|uHTTPd]] web server, configured for use with LuCI. The dependent packages are the following (see [[docs:techref:luci|the LuCI technical reference]] for more information):+Use alternative ports: 
 +  * HTTP 8080/TCP 
 +  * HTTPS - 8443/TCP
  
-  *         uhttpd +<code bash> 
-          uhttpd-mod-ubus +uci -q delete uhttpd.main.listen_http 
-          luci-mod-admin-full +uci add_list uhttpd.main.listen_http="0.0.0.0:8080" 
-          luci-theme-bootstrap +uci add_list uhttpd.main.listen_http="[::]:8080" 
-          luci-app-firewall +uci -q delete uhttpd.main.listen_https 
-          luci-proto-core +uci add_list uhttpd.main.listen_https="0.0.0.0:8443" 
-          luci-proto-ppp +uci add_list uhttpd.main.listen_https="[::]:8443" 
-          libiwinfo-lua+uci commit uhttpd 
 +/etc/init.d/uhttpd restart 
 +</code> 
 + 
 +===== Extras ===== 
 +==== Details ==== 
 +LuCI is installed as a 'meta package' which installs several other packages by having these defined as a dependency. 
 +Notably, it installs the [[docs:guide-user:services:webserver:http.uhttpd|uHTTPd]] web server, configured for use with LuCI.
  
-In case you want to use uHTTPd, there is little configuration necessary as uHTTPd is configured with CGI to make LuCI work with the Lua interpreter. By default this is organised as follows. By default ''/www'' is the standard document root. Thus, by requesting this docroot (by pointing your browser to the devices IP address) an index file such as ''index.html'' is searched for (per uHTTPd settings). The file ''/www/index.html'' (installed with LuCI) is prepared such that when requested, it redirects you to ''/cgi-bin/luci'', which is the default CGI gateway for LuCI. This is just a script, which basically calls Lua at ''/usr/bin/lua''. uhttpd is configured by default to load pages as CGI in the ''/cgi-bin'' path, and thus starts serving these pages with the ''/cgi-bin/luci'' script. +In case you want to use uHTTPd, there is little configuration necessary as uHTTPd is configured with CGI to make LuCI work with the Lua interpreter. 
 +By default this is organised as follows. 
 +By default ''/www'' is the standard document root. 
 +Thus, by requesting this docroot (by pointing your browser to the devices IP address) an index file such as ''index.html'' is searched for (per uHTTPd settings). 
 +The file ''/www/index.html'' (installed with LuCI) is prepared such that when requested, it redirects you to ''/cgi-bin/luci'', which is the default CGI gateway for LuCI. 
 +This is just a script, which basically calls Lua at ''/usr/bin/lua''. 
 +uhttpd is configured by default to load pages as CGI in the ''/cgi-bin'' path, and thus starts serving these pages with the ''/cgi-bin/luci'' script.
  
-It is also possible to run LuCI with Lua as an embedded process. uhttpd supports this; see the corresponding section of the [[docs:guide-user:services:webserver:uhttpd#embedded_lua|uHTTPd Web Server Configuration]] article on the UCI configuration of uhttpd.+It is also possible to run LuCI with Lua as an embedded process. 
 +uhttpd supports this; see the corresponding section of the [[docs:guide-user:services:webserver:uhttpd#embedded_lua|uHTTPd Web Server Configuration]] article on the UCI configuration of uhttpd.
  
 +LuCI by default comes with the bootstrap theme. There are additional themes available and you can create your own if you wish - [[:docs:guide-user:luci:luci.themes]]
 ==== Configuration ==== ==== Configuration ====
-The default web server software uhttpd is configured in the file ''[[docs:guide-user:services:webserver:uhttpd|/etc/config/uhttpd]]''.\\ +  * ''[[docs:guide-user:services:webserver:uhttpd|/etc/config/uhttpd]]'' 
-The LuCI WebUI is configured in the file ''[[doc:uci:luci|/etc/config/luci]]''.+  ''[[doc:uci:luci|/etc/config/luci]]''
  
-===== LuCI on other web servers ===== +==== LuCI on other web servers ==== 
-->[[docs:guide-user:services:http.overview]]+[[docs:guide-user:services:webserver:start]]
  
-==== LuCI on lighttpd ==== +=== LuCI on lighttpd === 
-->[[docs:guide-user:luci:luci.on.lighttpd]]+[[docs:guide-user:luci:luci.on.lighttpd]]
  
-==== LuCI on nginx ==== +=== LuCI on nginx === 
-LuCI on nginx is currently supported by using uwsgi as plain-cgi interpreter. +For routers without significant space constraints running on snapshots/master or v19 or later, it is possible to install using nginx. 
 +LuCI on nginx is currently supported by using uwsgi as plain-cgi interpreter.
 You need to install one of this 2 variants of the LuCI meta-package: You need to install one of this 2 variants of the LuCI meta-package:
-  * luci-nginx -- Autoinstall nginx, uwsgi-cgi and the default config file to make luci work on nginx +  * [[packages:pkgdata:luci-nginx]] - Autoinstall nginx, uwsgi-cgi and the default config file to make luci work on nginx. 
-  * luci-nginx-ssl -- Autoinstall nginx-ssl, uwsgi-cgi and the default config file to make luci wok on nginx. It does also create a self-signed certificate for nginx and redirect http traffic to https by default+  * [[packages:pkgdata:luci-ssl-nginx]] - Autoinstall nginx-ssl, uwsgi-cgi and the default config file to make luci wok on nginx. 
 +It does also create a self-signed certificate for nginx and redirect http traffic to https by default
 +Note that even when using nginx, exposing the LuCI interface to the Internet or guest networks is not recommended.
  
-Currently LuCI on nginx is fully supported (maybe only in master snapshots for now, as of 16-Feb-2019). If any problem is found, report them to the support forum. +Currently LuCI on nginx is fully supported (maybe only in master snapshots for now, as of 16-Feb-2019). 
 +If any problem is found, report them to the [[https://forum.openwrt.org/t/luci-on-nginx-compile/14580|support forum]].
  
-  * [[https://forum.openwrt.org/t/luci-on-nginx-compile/14580|Support forum for LuCI on Nginx]]+=== LuCI on BusyBox httpd === 
 +If you have a very limited space then you can compile OpenWRT image with [[docs:guide-user:services:webserver:http.httpd|BusyBox httpd]] instead of uhttpd. LUCI works fine but you'll need some manual configuration. Also this setup is not widely used and tested. 
 +If any problem is found, report them to the [[https://forum.openwrt.org/t/luci-on-busybox-httpd/84418|support forum]].
  
-===== Offline installation ===== +==== Offline installation ==== 
-  - Go to the package download page of the distribution in question: (for ar71xx - generic "18.06.2" packages use: https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/+Download the following packages from the [[https://downloads.openwrt.org/releases/18.06.2/targets/ar71xx/generic/packages/|package repository]] using your platform and release version:
-  - Download the following packages: **(The extension " * " will show package versions and targets (such as ar71xx) depending on the system page)** +
-    * luci_*.ipk +
-    * luci-app-firewall_*.ipk +
-    * luci-i18n-english_*.ipk +
-    * luci-lib-core_*.ipk +
-    * luci-lib-ipkg_*.ipk +
-    * luci-lib-nixio_*.ipk +
-    * luci-lib-sys_*.ipk +
-    * luci-lib-web_*.ipk +
-    * luci-mod-admin-core_*.ipk +
-    * luci-mod-admin-full_*.ipk +
-    * luci-proto-core_*.ipk +
-    * luci-proto-ppp_*.ipk +
-    * luci-sgi-cgi_*.ipk +
-    * luci-theme-base_*.ipk +
-    * luci-theme-openwrt_*.ipk +
-  - Connect the router to the computer and copy the packages to the router using file transfer. For example the following command can be used via the command prompt in windows 10:\\ <code> +
-scp luci_0.11.1-1_ar71xx.ipk luci-app-firewall_0.11.1-1_ar71xx.ipk luci-i18n-english_0.11.1-1_ar71xx.ipk luci-lib-core_0.11.1-1_ar71xx.ipk luci-lib-ipkg_0.11.1-1_ar71xx.ipk luci-lib-nixio_0.11.1-1_ar71xx.ipk luci-lib-sys_0.11.1-1_ar71xx.ipk luci-lib-web_0.11.1-1_ar71xx.ipk luci-mod-admin-core_0.11.1-1_ar71xx.ipk luci-mod-admin-full_0.11.1-1_ar71xx.ipk luci-proto-core_0.11.1-1_ar71xx.ipk luci-proto-ppp_0.11.1-1_ar71xx.ipk luci-sgi-cgi_0.11.1-1_ar71xx.ipk luci-theme-base_0.11.1-1_ar71xx.ipk luci-theme-openwrt_0.11.1-1_ar71xx.ipk +
-</code> +
-   - Log into the router. For example by entering the following command into command prompt in windows 10 \\ <code> +
-ssh root@openwrt.lan +
-</code> +
-   - Packages can be installed using the following command \\ <code> +
-opkg install PACKAGE_NAME +
-</code> +
-   - Install the packages in the following order +
-    * luci-proto-core_0.11.1-1_ar71xx.ipk +
-    * luci-lib-core_0.11.1-1_ar71xx.ipk +
-    * luci-lib-sys_0.11.1-1_ar71xx.ipk +
-    * luci-lib-nixio_0.11.1-1_ar71xx.ipk +
-    * luci-sgi-cgi_0.11.1-1_ar71xx.ipk +
-    * luci-lib-web_0.11.1-1_ar71xx.ipk +
-    * luci-i18n-english_0.11.1-1_ar71xx.ipk +
-    * luci-mod-admin-core_0.11.1-1_ar71xx.ipk +
-    * luci-lib-ipkg_0.11.1-1_ar71xx.ipk +
-    * luci-mod-admin-full_0.11.1-1_ar71xx.ipk +
-    * luci-theme-base_0.11.1-1_ar71xx.ipk +
-    * luci-theme-openwrt_0.11.1-1_ar71xx.ipk +
-    * luci-app-firewall_0.11.1-1_ar71xx.ipk +
-    * luci-proto-ppp_0.11.1-1_ar71xx.ipk +
-    * luci_0.11.1-1_ar71xx.ipk +
-  - The LuCI WebUI will be available at %%http://openwrt.lan/%% +
-  - To clean up, remove the packages with the following command \\ <code> +
-rm luci_0.11.1-1_ar71xx.ipk luci-app-firewall_0.11.1-1_ar71xx.ipk luci-i18n-english_0.11.1-1_ar71xx.ipk luci-lib-core_0.11.1-1_ar71xx.ipk luci-lib-ipkg_0.11.1-1_ar71xx.ipk luci-lib-nixio_0.11.1-1_ar71xx.ipk luci-lib-sys_0.11.1-1_ar71xx.ipk luci-lib-web_0.11.1-1_ar71xx.ipk luci-mod-admin-core_0.11.1-1_ar71xx.ipk luci-mod-admin-full_0.11.1-1_ar71xx.ipk luci-proto-core_0.11.1-1_ar71xx.ipk luci-proto-ppp_0.11.1-1_ar71xx.ipk luci-sgi-cgi_0.11.1-1_ar71xx.ipk luci-theme-base_0.11.1-1_ar71xx.ipk luci-theme-openwrt_0.11.1-1_ar71xx.ipk +
-</code>+
  
-==== Minimalistic offline installation ==== +=== Basic === 
-You can also install a minimal version of LuCI with following packages selected for installation+  * [[packages:pkgdata:liblua5.1.5|liblua]] 
-Download and transfer the packages to your OpenWrt router onto the RAM disk in ''/tmp/luci-offline-packages'' +  * [[packages:pkgdata:libubus20220601|libubus]] 
-<code>mkdir -p /tmp/luci-offline-packages; cd /tmp/luci-offline-packages</code>+  * [[packages:pkgdata:libubus-lua]] 
 +  * [[packages:pkgdata:libuci-lua]] 
 +  * [[packages:pkgdata:lua]] 
 +  * [[packages:pkgdata:luci-base]] 
 +  * [[packages:pkgdata:luci-lib-ip]] 
 +  * [[packages:pkgdata:luci-lib-jsonc]] 
 +  * [[packages:pkgdata:luci-lib-nixio]] 
 +  * [[packages:pkgdata:luci-mod-admin-full]] 
 +  * [[packages:pkgdata:luci-theme-bootstrap]] 
 +  * [[packages:pkgdata:rpcd]] 
 +  * [[packages:pkgdata:uhttpd]]
  
-  * liblua  +=== Extended === 
-  * lua  +  * [[packages:pkgdata:luci]] 
-  * libuci-lua +  * [[packages:pkgdata:luci-app-firewall]] 
-  * libubus  +  * [[packages:pkgdata:luci-app-opkg]] 
-  * libubus-lua +  * [[packages:pkgdata:luci-proto-ipv6]] 
-  * uhttpd +  * [[packages:pkgdata:luci-proto-ppp]]
-  * rpcd +
-  * luci-base +
-  * luci-lib-ip +
-  * luci-lib-nixio +
-  * luci-theme-bootstrap +
-  * luci-mod-admin-full +
-  * luci-lib-jsonc+
  
-and install them with:+Transfer the downloaded packages to your router onto the RAM disk and install them.
  
-<code bash>opkg install /tmp/luci-offline-packages/*.ipk; done</code>+<code bash> 
 +# Upload packages to the router 
 +ssh root@openwrt.lan mkdir -p /tmp/luci-offline 
 +scp *.ipk root@openwrt.lan:/tmp/luci-offline
  
-Or use this script bellow. Note, the script assumes you have internet access through the router where you are installing Luci. If you do not, then you will need to either manually download required .ipk packages, or run the script in two partsFirst part till the last Done statement to be executed when connected to Internet.: +# Install packages 
-<code bash>#!/bin/sh +ssh root@openwrt.lan opkg install /tmp/luci-offline/*.ipk
-#assumes the user has egrep, wget, ssh, and scp+
  
-set -e+# Clean up 
 +ssh root@openwrt.lan rm -f -R /tmp/luci-offline 
 +</code>
  
-# Change this to match your router +Or use this script bellow. 
-architecture="brcm63xx"+Note, the script assumes you have internet access through the router where you are installing LuCI. 
 +If you do not, then you will need to either manually download required ''.ipk'' packages, or run the script in two parts. 
 +First part till the last ''done'' statement to be executed when connected to the internet:
  
-These should be fine unless you've changed something +<code bash> 
-user="root" +#!/bin/sh
-ip_address="openwrt.lan"+
  
-url="https://downloads.openwrt.org/snapshots/packages/${architecture}/" +# Exit on error 
-tmpdir="/tmp/luci-offline" +set -e
-packages_base="liblua lua libuci-lua libubus libubus-lua uhttpd rpcd" +
-packages_luci="luci-base liblucihttp liblucihttp-lua luci-lib-ip luci-lib-nixio luci-theme-bootstrap luci-mod-admin-full luci-lib-jsonc luci-mod-status luci-mod-system luci-mod-network libiwinfo-lua libiwinfo-lua"+
  
-mkdir "$tmpdir+# Configuration parameters 
-cd "$tmpdir"+OWRT_USER="root" 
 +OWRT_HOST="openwrt.lan
 +OWRT_TEMP="/tmp/luci-offline"
  
-wget -N --quiet "${url}base/Packages" +# Fetch OpenWrt release 
-for pkg in $packages_base; do +eval $(ssh "${OWRT_HOST}" cat /etc/os-release)
-    pkgfile="$(egrep -oe " ${pkg}_.+Packages | tail -c +2)+
-    pkgurl="${url}base/${pkgfile}" +
-    wget -N --quiet "$pkgurl" +
-done+
  
-wget -N --quiet "${url}luci/Packages" +# LuCI packages and repos 
-for pkg in $packages_lucido +case "${VERSION_ID}" in 
-    pkgfile="$(egrep -oe " ${pkg}_.+Packages | tail -c +2)+(snapshot) OWRT_URL="https://downloads.${HOME_URL#*//}snapshots/" ;
-    pkgurl="${url}luci/${pkgfile}" +(*) OWRT_URL="https://downloads.${HOME_URL#*//}releases/${VERSION_ID}/" ;; 
-    wget ---quiet "$pkgurl" +esac 
-done+OWRT_CORE="libiwinfo libiwinfo-lua" 
 +OWRT_COREURL="${OWRT_URL}targets/${OPENWRT_BOARD}/packages" 
 +OWRT_BASE="libjson-c2 liblua lua libuci-lua libubus libubus-lua uhttpd rpcd
 +OWRT_BASEURL="${OWRT_URL}packages/${OPENWRT_ARCH}/base" 
 +OWRT_LUCI="luci-base liblucihttp liblucihttp-lua luci-lib-ip luci-lib-nixio \ 
 +    luci-theme-bootstrap luci-mod-admin-full luci-lib-jsonc luci-mod-status \ 
 +    luci-mod-system luci-mod-network" 
 +OWRT_LUCIURL="${OWRT_URL}packages/${OPENWRT_ARCH}/luci"
  
-wget -N --quiet "${url}luci+# Download packages from repos 
-for pkg in $packages_luci; do +mkdir -p "${OWRT_TEMP}" 
-    pkgfile="$(egrep -oe " ${pkg}_.+" Packages | tail -c +2)" +for OWRT_REPO in OWRT_CORE OWRT_BASE OWRT_LUCI 
-    pkgurl="${url}luci/${pkgfile}" +do 
-    wget -N --quiet "$pkgurl"+    OWRT_REPOURL=$(eval echo '${'${OWRT_REPO}'URL}'
 +    wget -N -"${OWRT_TEMP}/${OWRT_REPOURL##*/}" "${OWRT_REPOURL}/Packages
 +    for OWRT_PKG in $(eval echo '${'${OWRT_REPO}'}') 
 +    do 
 +        OWRT_PKGFILE="$(sed -n -r -e \ 
 +            "/^Filename:\s${OWRT_PKG}[.0-9]*_.+\.ipk/s/^.*\s//p
 +            "${OWRT_TEMP}/${OWRT_REPOURL##*/}/Packages")" 
 +        OWRT_PKGURL="${OWRT_REPOURL}/${OWRT_PKGFILE}" 
 +        wget -N -"${OWRT_TEMP}"${OWRT_PKGURL}" 
 +    done
 done done
  
-ssh "${user}@${ip_address}" mkdir -p /tmp/luci-offline-packages +# Upload packages to OpenWrt 
-scp *.ipk "${user}@${ip_address}":/tmp/luci-offline-packages +ssh "${OWRT_USER}@${OWRT_HOST}"mkdir -p ${OWRT_TEMP}" 
-ssh "${user}@${ip_address}" opkg install /tmp/luci-offline-packages/*.ipk +scp "${OWRT_TEMP}/"*.ipk "${OWRT_USER}@${OWRT_HOST}:${OWRT_TEMP}" 
-ssh "${user}@${ip_address}" rm -rf /tmp/luci-offline-packages/ +ssh "${OWRT_USER}@${OWRT_HOST}"opkg install ${OWRT_TEMP}/*.ipk" 
- +ssh "${OWRT_USER}@${OWRT_HOST}"rm --${OWRT_TEMP}" 
-ssh "${user}@${ip_address}" /etc/init.d/uhttpd start +rm -f -R "${OWRT_TEMP}" 
-ssh "${user}@${ip_address}" /etc/init.d/uhttpd enable +</code>
- +
-cd +
-rm -rf "$tmpdir"</code> +
- +
-===== Miscellaneous ===== +
-==== Secure acccess to luci webserver ==== +
-If you want to configure Luci webserver for secure access, [[docs:guide-user:luci:luci.secure|read the explanation here]]. +
- +
-===== Troubleshooting ===== +
-  * LuCI is developed at Github:  [[https://github.com/openwrt/luci]] +
-  * Please file LuCI specific bugs at the [[https://github.com/openwrt/luci/issues|LuCI issue tracker]] +
-  * LuCIs old web-presence at [[http://luci.subsignal.org|LuCI website]]+
  
-===== Notes ===== +==== References ==== 
-[[docs:techref:luci|LuCI Technical Reference]]+  * [[https://github.com/openwrt/luci|LuCI is developed at GitHub]] 
 +  * [[https://github.com/openwrt/luci/issues|LuCI issue tracker]] 
 +  * [[https://github.com/openwrt/luci/wiki|LuCI documentation wiki]] 
 +  * [[docs:guide-user:luci:luci.secure|Secure access to LuCI via SSH tunnel]] 
 +  * [[docs:techref:luci|LuCI technical reference]] 
 +  * [[docs:guide-user:luci:luci.themes|LuCI Themes and how to change them]]
  
  • Last modified: 2024/10/27 22:35
  • by palebloodsky