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.essentials [2019/07/03 03:39] – [Minimalistic offline installation] code syntax vgaetera | docs:guide-user:luci:luci.essentials [2023/04/03 01:00] – [Offline installation] vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== LuCI essentials ====== | ====== LuCI essentials ====== | ||
| - | {{section> | + | {{section> |
| ===== 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 | + | The OpenWrt full releases, such as the current |
| 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: | 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: | ||
| More info on this can be obtained [[docs: | More info on this can be obtained [[docs: | ||
| Line 10: | Line 10: | ||
| ===== Instructions ===== | ===== Instructions ===== | ||
| ==== 1. Basic installation ==== | ==== 1. Basic installation ==== | ||
| - | Connect to your router via SSH and install | + | Install |
| <code bash> | <code bash> | ||
| Line 17: | Line 17: | ||
| </ | </ | ||
| - | Now you can open **[[http:// | + | Now you can open LuCI interface. |
| ==== 2. Providing encryption ==== | ==== 2. Providing encryption ==== | ||
| - | Connect to your router via SSH and install | + | Install |
| <code bash> | <code bash> | ||
| opkg update | opkg update | ||
| - | opkg install luci-ssl-openssl | + | opkg install luci-ssl |
| + | / | ||
| </ | </ | ||
| Line 49: | Line 50: | ||
| opkg update | opkg update | ||
| opkg list luci-app-\* | opkg list luci-app-\* | ||
| + | </ | ||
| + | |||
| + | ==== 5. Alternative ports ==== | ||
| + | Use alternative ports: | ||
| + | * HTTP - 8080/TCP | ||
| + | * HTTPS - 8443/TCP | ||
| + | |||
| + | <code bash> | ||
| + | uci -q delete uhttpd.main.listen_http | ||
| + | uci add_list uhttpd.main.listen_http=" | ||
| + | uci add_list uhttpd.main.listen_http=" | ||
| + | uci -q delete uhttpd.main.listen_https | ||
| + | uci add_list uhttpd.main.listen_https=" | ||
| + | uci add_list uhttpd.main.listen_https=" | ||
| + | uci commit uhttpd | ||
| + | / | ||
| </ | </ | ||
| Line 67: | Line 84: | ||
| uhttpd supports this; see the corresponding section of the [[docs: | uhttpd supports this; see the corresponding section of the [[docs: | ||
| + | LuCI by default comes with the bootstrap theme. There are additional themes available and you can create your own if you wish - [[: | ||
| ==== Configuration ==== | ==== Configuration ==== | ||
| * '' | * '' | ||
| Line 78: | Line 96: | ||
| === LuCI on nginx === | === LuCI on nginx === | ||
| + | For routers without significant space constraints running on snapshots/ | ||
| LuCI on nginx is currently supported by using uwsgi as plain-cgi interpreter. | 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: |
| - | * luci-ssl-nginx - Autoinstall nginx-ssl, uwsgi-cgi and the default config file to make luci wok on nginx. | + | * [[packages: |
| It does also create a self-signed certificate for nginx and redirect http traffic to https by default. | 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). | 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. | + | If any problem is found, report them to the [[https:// |
| - | * [[https:// | + | === LuCI on BusyBox httpd === |
| + | If you have a very limited space then you can compile OpenWRT image with [[docs: | ||
| + | If any problem is found, report them to the [[https:// | ||
| ==== Offline installation ==== | ==== Offline installation ==== | ||
| Download the following packages from the [[https:// | Download the following packages from the [[https:// | ||
| - | * luci | ||
| - | * luci-app-firewall | ||
| - | * luci-i18n-english | ||
| - | * luci-lib-core | ||
| - | * luci-lib-ipkg | ||
| - | * luci-lib-nixio | ||
| - | * luci-lib-sys | ||
| - | * luci-lib-web | ||
| - | * luci-mod-admin-core | ||
| - | * luci-mod-admin-full | ||
| - | * luci-proto-core | ||
| - | * luci-proto-ppp | ||
| - | * luci-sgi-cgi | ||
| - | * luci-theme-base | ||
| - | * luci-theme-openwrt | ||
| - | <code bash> | + | === Basic === |
| - | # Upload the packages to the router | + | * [[packages: |
| - | scp *.ipk root@openwrt.lan:/tmp | + | * [[packages: |
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| - | # Log into the router | + | === Extended === |
| - | ssh root@openwrt.lan | + | * [[packages: |
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| + | * [[packages: | ||
| - | # Installed the packages | + | Transfer |
| - | opkg install / | + | |
| - | + | ||
| - | # Clean up | + | |
| - | rm -f / | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Minimalistic offline installation ==== | + | |
| - | You can also install a minimal version of LuCI with following packages selected for installation. | + | |
| - | Download and transfer | + | |
| <code bash> | <code bash> | ||
| - | mkdir -p / | + | # Upload packages to the router |
| - | </ | + | ssh root@openwrt.lan |
| + | scp *.ipk root@openwrt.lan: | ||
| - | * liblua | + | # Install packages |
| - | * lua | + | ssh root@openwrt.lan opkg install /tmp/luci-offline/*.ipk |
| - | * libuci-lua | + | |
| - | * libubus | + | |
| - | * libubus-lua | + | |
| - | * uhttpd | + | |
| - | * rpcd | + | |
| - | * luci-base | + | |
| - | | + | |
| - | * luci-lib-nixio | + | |
| - | * luci-theme-bootstrap | + | |
| - | * luci-mod-admin-full | + | |
| - | * luci-lib-jsonc | + | |
| - | and install them with: | + | # Clean up |
| - | + | ssh root@openwrt.lan rm -f -R / | |
| - | <code bash> | + | |
| - | opkg install | + | |
| </ | </ | ||
| Or use this script bellow. | Or use this script bellow. | ||
| - | Note, the script assumes you have internet access through the router where you are installing | + | Note, the script assumes you have internet access through the router where you are installing |
| - | If you do not, then you will need to either manually download required .ipk packages, or run the script in two parts. | + | If you do not, then you will need to either manually download required |
| - | First part till the last Done statement to be executed when connected to Internet.: | + | First part till the last '' |
| <code bash> | <code bash> | ||
| #!/bin/sh | #!/bin/sh | ||
| - | #assumes the user has egrep, wget, ssh, and scp | ||
| - | |||
| - | set -e | ||
| - | |||
| - | # Change this to match your router | ||
| - | architecture=" | ||
| - | target=" | ||
| - | # These should be fine unless you've changed something | + | # Exit on error |
| - | user=" | + | set -e |
| - | ip_address=" | + | |
| - | tmpdir="/ | + | # Configuration parameters |
| + | OWRT_USER=" | ||
| + | OWRT_HOST=" | ||
| + | OWRT_TEMP="/ | ||
| - | base=" | + | # Fetch OpenWrt release |
| - | baseurl="https:// | + | eval $(ssh "${OWRT_HOST}" cat /etc/ |
| - | luci=" | + | # LuCI packages and repos |
| - | luciurl="https:// | + | case " |
| + | (snapshot) OWRT_URL=" | ||
| + | (*) OWRT_URL=" | ||
| + | esac | ||
| + | OWRT_CORE=" | ||
| + | OWRT_COREURL=" | ||
| + | OWRT_BASE=" | ||
| + | OWRT_BASEURL=" | ||
| + | OWRT_LUCI=" | ||
| + | | ||
| + | | ||
| + | OWRT_LUCIURL="${OWRT_URL}packages/${OPENWRT_ARCH}/ | ||
| - | targets=" | + | # Download |
| - | targetsurl=" | + | mkdir -p "${OWRT_TEMP}" |
| - | mkdir -p "${tmpdir}" | + | for OWRT_REPO |
| - | + | do | |
| - | for pkgdir | + | |
| - | | + | wget -N -P "${OWRT_TEMP}/ |
| - | echo " | + | for OWRT_PKG |
| - | wget -N -P "${tmpdir}" "${url}/ | + | |
| - | for pkg in $(eval echo ' | + | |
| - | | + | |
| - | | + | |
| - | echo " | + | |
| - | wget -N -P "${tmpdir}" | + | wget -N -P "${OWRT_TEMP}" "${OWRT_PKGURL}" |
| done | done | ||
| done | done | ||
| - | ssh "${user}@${ip_address}" mkdir -p "${tmpdir}" | + | # Upload packages to OpenWrt |
| - | scp "${tmpdir}"/*.ipk "${user}@${ip_address}:${tmpdir}" | + | ssh "${OWRT_USER}@${OWRT_HOST}" |
| - | ssh "${user}@${ip_address}" opkg install | + | scp "${OWRT_TEMP}/"*.ipk "${OWRT_USER}@${OWRT_HOST}:${OWRT_TEMP}" |
| - | ssh "${user}@${ip_address}" rm -r -f "${tmpdir}" | + | ssh "${OWRT_USER}@${OWRT_HOST}" |
| - | + | ssh "${OWRT_USER}@${OWRT_HOST}" | |
| - | rm -r -f "${tmpdir}" | + | rm -f -R "${OWRT_TEMP}" |
| </ | </ | ||
| - | ==== Additional links ==== | + | ==== References |
| - | * [[https:// | + | * [[https:// |
| * [[https:// | * [[https:// | ||
| - | * [[http://luci.subsignal.org|LuCI legacy website]] | + | * [[https://github.com/ |
| - | * [[docs: | + | * [[docs: |
| - | * [[docs: | + | * [[docs: |
| + | * [[docs: | ||