User Tools

Site Tools



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
doc:howto:luci.essentials [2013/05/04 14:17]
doc:howto:luci.essentials [2015/10/24 22:07] (current)
RunningDroid [Minimalistic offline installation]
Line 1: Line 1:
 ====== LuCI Essentials ====== ====== LuCI Essentials ======
 +===== Installing LuCI on uHTTPd =====
 This installs the essentials of the Web User Interface LuCI. See "​**''​opkg update && opkg list luci-*''​**"​ for all available packages to administer OpenWrt through LuCI. This installs the essentials of the Web User Interface LuCI. See "​**''​opkg update && opkg list luci-*''​**"​ for all available packages to administer OpenWrt through LuCI.
-| {{:​meta:​icons:​tango:​utilities-terminal.png?​nolink}} | In case you are not familiar with a [[wp>​Command-line interface|CLI]],​ check out [[doc:​howto:​user.beginner.cli|command line HELP]] ​ | +<​code ​bash>
- +
-===== Installation ===== +
- +
-==== Via package repository ==== +
--> [[doc:​techref:​opkg]] Technical reference for opkg +
- +
-Retrieve the current list of available packages in the repository:​ +
 opkg update opkg update
-For a full LuCI installation //without// HTTPS support: 
 opkg install luci</​code>​ opkg install luci</​code>​
-For a full LuCI installation //with// HTTPS support 
-opkg install luci-ssl 
-==== Start the web server (uHTTPd) ==== +or
-The web server software uHTTPd is a dependency of the LuCI package and automatically installed on your OpenWrt system, when you install LuCI. **After installation the webs server is not running!** You need to manually start the web server (uHTTPd): +
-<​code>​ +
-/​etc/​init.d/​uhttpd start +
-Now you should be able to connect to the web server serving LuCI at [[http://​|http://​]].+<code bash>​opkg install luci-ssl # enable https for luci</code>
 +| {{:​meta:​icons:​tango:​help-browser.png?​nolink}} | In case you are not familiar with a [[wp>​Command-line interface|CLI]],​ check out [[doc:​howto:​user.beginner.cli|command-line HELP]] and/or [[doc:​techref:​opkg]] |
-==== Enable the web server (uHTTPd) ==== 
-To make the web server being started automatically after each reboot, you need to //enable// it, i.e. register the web server in the start up scripts. 
-Enable automatic start at boot+==== Native Language Support ==== 
-<​code>​ +The basic LuCI web user interface is in English. However, it is being actively translated into many languages by volunteers. See [[http://​​pootle/​]] and get involved! For a list of available packages, do 
-/​etc/​init.d/​uhttpd enable+<​code ​bash
 +opkg list | grep luci-i18n-
 </​code>​ </​code>​
 +You will see a list of the available language packages. To install your native language, do e.g.
 +<code bash>
 +opkg install luci-i18n-hungarian
 +You can also install language packs utilizing the WebInterface and you can install multiple LuCI language packs at the same time and switch between them in the LuCI-WebInterface or by editing the file -> ''​[[doc:​uci:​luci|/​etc/​config/​luci]]''​
-===== Configuration ===== 
--> ''​[[doc:​uci:​uhttpd|/​etc/​config/​uhttpd]]''​. (//​optional//,​ you are not required to configure anything) 
-===== Administration ===== +==== Start and Enable the web server (uHTTPd) ​==== 
-FIXME TODO +The web server software ​[[http.uhttpd|uHTTPd]] is a dependency of the LuCI package ​and is automatically installed when you install ​LuCI. After installation ​the web server is **not running!** You need to manually start the web server. You should also //enable// the web serverso that it automatically ​starts up whenever you reboot ​the router. The first command below starts the web server, the second enables it across reboots. 
- +<​code ​bash
-===== LuCI on other web servers ===== +/​etc/​init.d/​uhttpd start 
-->[[doc:howto:http.overview]] +/​etc/​init.d/​uhttpd enable
- +
-==== LuCI on lighttpd ==== +
-->​[[doc:​howto:​http.lighttpd]] +
- +
-**NOTE**: The **libiwinfo** ​package is only needed if your router has wireless. The following procedure brings ​you a minimal ​LuCI-Installation (instead of the full installation above, when using meta-package "**luci**" or "​**luci-ssl**"​which automatically ​installs ​the webserver "​**uhttpd**"​) +
- +
-<​code>​ +
-opkg update +
-opkg install lighttpd lighttpd-mod-cgi luci-mod-admin-full luci-theme-openwrt libiwinfo+
 </​code>​ </​code>​
-Afterwards adjust ​the file ''​/etc/lighttpd/​lighttpd.conf''​ to load the **mod_cgi**-module:​+Now you should be able to connect to the web server serving LuCI at [[]].
-|''##​ modules to load 
-# all other module should only be loaded if really neccesary 
-# - saves some time 
-# - saves memory 
-server.modules = (  
-#​ "​mod_rewrite", ​ 
-#​ "​mod_redirect", ​ 
-#​ "​mod_alias", ​ 
-#​ "​mod_auth", ​ 
-#​ "​mod_status", ​ 
-#​ "​mod_setenv",​ 
-#​ "​mod_fastcgi",​ 
-#​ "​mod_proxy",​ 
-#​ "​mod_simple_vhost",​ 
- **"​mod_cgi"​** 
-#​ "​mod_ssi",​ 
-#​ "​mod_usertrack",​ 
-#​ "​mod_expire",​ 
-#​ "​mod_webdav"​ 
-...and add:+==== Details ==== 
 +LuCI is installed as a 'meta package'​ which installs several other packages by having these defined as a dependencyNotably, it installs the [[doc:​howto:​http.uhttpd|uHTTPd]] web server, configured for use with LuCIThe dependent packages are the following (see [[doc:​techref:​luci|the LuCI technical reference]] for more information):
-|''##​ CGI module +  *         ​uhttpd 
-**cgi.assign = ( "luci" %%=>%% "/​usr/​bin/​lua"​ )** +          uhttpd-mod-ubus 
-''​|+  ​        ​luci-mod-admin-full 
 +  ​        luci-theme-bootstrap 
 +  ​        luci-app-firewall 
 +  ​* ​        ​luci-proto-core 
 +  *         ​luci-proto-ppp 
 +  *         ​libiwinfo-lua
-...if you want lighttpd's logs in the output of "​**logread**"​add this:+In case you want to use uHTTPd for the web interface there is little configuration necessary as uHTTPd is configured with CGI to make LuCI work with the Lua interpreterBy default this is organised as followsBy default ''/​www''​ is the standard document rootThus, 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''​ pathand thus starts serving these pages with the ''/​cgi-bin/​luci''​ script. ​
-|''​## enable syslog +It is also possible to run LuCI with Lua as an embedded process. uhttpd supports this; see the corresponding section of the [[doc:​uci:​uhttpd#embedded.lua|uHTTPd Web Server Configuration]] article on the UCI configuration of uhttpd.
-server.errorlog-use-syslog = "​enable"​ +
-Enable (so that it will be started at every boot) and start lighttpd: +==== Configuration ==== 
-<​code>​ +The default web server software uhttpd is configured in the file ''​[[doc:​uci:​uhttpd|/etc/config/uhttpd]]''​.\\ 
-/etc/init.d/lighttpd enable +The LuCI web interface is configured in the file ''​[[doc:​uci:​luci|/etc/config/luci]]''​.
-/etc/init.d/lighttpd start +
-Add the following for the server to listen on ipv4 and ipv6 +===== LuCI on other web servers ​===== 
-<​code>​ +->[[doc:howto:http.overview]]
-#Listen on ipv4 +
-$SERVER["​socket"​] ​== ":​80"​ { +
-#​Listen ​on ipv6 +
-$SERVER["​socket"​] ​== "[::]:80" { +
-        server.use-ipv6 = "​enable"​ +
-===== LuCI & a Website Simultaneously ​on lighttpd =====+==== LuCI on lighttpd ==== 
-You just have to adjust a few settings in /​etc/​lighttpd/​lighttpd.conf+==== LuCI on nginx ==== 
-OLD: +==== LuCI on ... ====
-| ''#​server.document-root ​"/​www/"''​ |+
-| ''​server.document-root = "/​website/"''​ | 
-At the end of the file add: 
-| ''​$SERVER["​socket"​] == ":​88"​ { 
-        server.document-root = "/​www/"​ 
-        cgi.assign = ( "​luci"​ %%=>%% "/​usr/​bin/​lua"​ ) 
-}''​ | 
-Finally create a directory for the website and put some content in it 
-mkdir /website 
-echo "<​P>​It works!</​P>"​ > /​website/​index.html 
-Now your website is on port 80 and LuCI on port 88 using lighttpd! 
-**NOTE / TODO**: Instead of opening a 2nd port for lighttpd it should be possible to activate the module "​**mod_simple_vhost**" ​ 
-and serve your website (in a vhost) in friendly coexistence of LuCI via port 80...  
 ===== Minimalistic offline installation ===== ===== Minimalistic offline installation =====
 Download and transfer (e.g. using SCP) the packages listed below to your OpenWrt router onto the RAM disk in ''/​tmp/​luci-offline-packages''​ Download and transfer (e.g. using SCP) the packages listed below to your OpenWrt router onto the RAM disk in ''/​tmp/​luci-offline-packages''​
 <​code>​mkdir -p /​tmp/​luci-offline-packages;​ cd /​tmp/​luci-offline-packages</​code>​ <​code>​mkdir -p /​tmp/​luci-offline-packages;​ cd /​tmp/​luci-offline-packages</​code>​
Line 146: Line 77:
   * liblua ​   * liblua ​
   * lua    * lua 
-  * libuci-lua ​+  * libuci-lua 
 +  * libubus ​
   * libubus-lua   * libubus-lua
   * uhttpd   * uhttpd
-  * luci-lib-ipkg +  * rpcd 
-  * luci-i18n-english +  * luci-base 
-  * luci-sgi-cgi +  * luci-lib-ip
-  * luci-lib-core+
   * luci-lib-nixio   * luci-lib-nixio
-  ​* luci-lib-sys +  * luci-theme-bootstrap
-  * luci-lib-web +
-  * luci-proto-core +
-  ​* luci-theme-base +
-  * luci-theme-openwrt +
-  * luci-mod-admin-core+
   * luci-mod-admin-full   * luci-mod-admin-full
 and install them with: and install them with:
-<​code>​for pkg in liblua lua libuci-lua libubus-lua uhttpd luci-lib-ipkg luci-i18n-english luci-sgi-cgi luci-lib-core luci-lib-nixio luci-lib-sys luci-lib-web luci-proto-core luci-theme-base luci-theme-openwrt luci-mod-admin-core luci-mod-admin-full;​ do opkg install /​tmp/​luci-offline-packages/​$pkg*.ipk; done</​code>​+<​code ​bash>opkg install /​tmp/​luci-offline-packages/​*.ipk;​ done</​code>​
-Additionally,​ the following packages are needed for basic wireless configurationlibiwlibiwinfolibiwinfo-lua.+Or use this script: 
 +<code bash>#​!/​bin/​sh 
 +#assumes the user has egrep, wgetsshand scp
-===== Troubleshooting ===== +# Change this to match your router 
-  * LuCI has its own web-presence. Please file LuCI specific bugs at the [[|LuCI website]]+architecture="​brcm63xx"​ 
 +# These should be fine unless you've changed something 
 +packages_base="​liblua lua libuci-lua libubus libubus-lua uhttpd rpcd"​ 
 +packages_luci="​luci-base luci-lib-ip luci-lib-nixio luci-theme-bootstrap luci-mod-admin-full"​ 
 +mkdir "​$tmpdir"​ 
 +cd "​$tmpdir"​ 
 +wget -N --quiet "​${url}base/Packages"​ 
 +for pkg in "​$packages_base";​ do 
 +    pkgfile="​$(egrep -oe " ${pkg}_.+" Packages ​tail -c +2)" 
 +    pkgurl="​${url}base/​${pkgfile}"​ 
 +    wget -N --quiet "​$pkgurl"​ 
-  ​+wget -N --quiet "​${url}luci/​Packages"​ 
 +for pkg in "​$packages_luci";​ do 
 +    pkgfile="​$(egrep -oe " ${pkg}_.+"​ Packages | tail -c +2)" 
 +    pkgurl="​${url}luci/​${pkgfile}"​ 
 +    wget -N --quiet "​$pkgurl"​ 
 +ssh "​${user}@${ip_address}"​ mkdir -p /​tmp/​luci-offline-packages 
 +scp *.ipk "​${user}@${ip_address}":/​tmp/​luci-offline-packages 
 +ssh "​${user}@${ip_address}"​ opkg install /​tmp/​luci-offline-packages/​*.ipk 
 +ssh "​${user}@${ip_address}"​ rm -rf /​tmp/​luci-offline-packages/​ 
 +ssh "​${user}@${ip_address}"​ /​etc/​init.d/​uhttpd start 
 +ssh "​${user}@${ip_address}"​ /​etc/​init.d/​uhttpd enable 
 +rm -rf "​$tmpdir"</​code>​  
 +===== Miscellaneous ===== 
 +==== Secure acccess to luci webserver ==== 
 +If you want to configure Luci webserver for secure access, [[doc:​howto:​|read the explanation here]]. 
 +===== Troubleshooting ===== 
 +  * LuCI is developed at Github: ​ [[https://​​openwrt/​luci]] 
 +  * Please file LuCI specific bugs at the [[https://​​openwrt/​luci/​issues|LuCI issue tracker]] 
 +  * LuCIs old web-presence at [[http://​|LuCI website]]
 ===== Notes ===== ===== Notes =====
 [[doc:​techref:​luci|LuCI Technical Reference]] [[doc:​techref:​luci|LuCI Technical Reference]]
doc/howto/luci.essentials.1367669839.txt.bz2 · Last modified: 2013/05/04 14:17 by orca