User Tools

Site Tools


doc:howto:luci.essentials

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
doc:howto:luci.essentials [2012/11/26 01:07]
uvray313
doc:howto:luci.essentials [2015/06/21 16:42] (current)
diegorodriguezv [LuCI Essentials]
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 ===== +
--> [[doc:​techref:​opkg]] Technical reference for opkg +
- +
-Retrieve the current list of available packages in the repository:​ +
-<​code>​+
 opkg update opkg update
-</​code>​ 
-For a full LuCI installation //without// HTTPS support: 
-<​code>​ 
 opkg install luci</​code>​ opkg install luci</​code>​
-For a full LuCI installation //with// HTTPS support 
-<​code>​ 
-opkg install luci-ssl 
-</​code>​ 
-Enable automatic start at boot and manually start the LuCI server: ​ 
-<​code>​ 
-/​etc/​init.d/​uhttpd enable 
-/​etc/​init.d/​uhttpd start 
-</​code>​ 
  
-You should now be able to connect using a web browser to your router at [[http://​192.168.1.1|http://​192.168.1.1]].+or
  
 +<code bash>​opkg install luci-ssl # enable https for luci</​code>​
  
 +| {{:​meta:​icons:​tango:​ug?​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]] |
  
-===== Configuration ===== 
--> ''​[[doc:​uci:​uhttpd|/​etc/​config/​uhttpd]]''​. (//​optional//,​ you are not required to configure anything) 
  
-===== Administration ===== +==== Native Language Support ​==== 
-FIXME TODO+The basic LuCI web user interface is in English. However, it is being actively translated into many languages by volunteers. See [[http://​i18n.luci.subsignal.org/​pootle/​]] and get involved! For a list of available packages, do 
 +<code bash> 
 +opkg list | grep luci-i18n- 
 +</​code>​
  
-===== Encompassed Packages ===== +You will see a list of the available language ​packages. ​To install your native languagedo e.g. 
-''​luci''​ and ''​luci-ssl''​ are meta-packages. ​Here you see what they comprisethe sizes are in Bytes compiled for the ar71xx platformThey should differ too much from binaries compiled for other architectures. Also note, that with JFFS2 it is not possible to precisely predict the occupied space.+<code bash> 
 +opkg install luci-i18n-hungarian 
 +</​code>​
  
-In case you want to use a different web server and not install ​''​httpd'' ​at all, do not install ​the meta-package because it includes ​''​uhttpd''​. Install the individual components instead and a web server of your choice. The article ​[[doc/howto/http.overview]] shows you some choices from the repos.+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]]''​
  
-^  Name  ^  Size  ^ Description ​ ^ 
-| luci                 ​| ​   779 | Meta package. Standard OpenWrt set including full and mini admin and the standard theme  | 
-| uhttpd ​              ​| ​ 23778 | uHTTPd is a tiny single threaded HTTP server with TLS, CGI and Lua support. It is intended as a drop-in replacement for the Busybox HTTP daemon. ​ | 
-| luci-mod-admin-full ​ |  60827 | LuCI Administration - full-featured for full control ​ | 
-| luci-mod-admin-core ​ |   5257 | Web UI Core module ​ | 
-| luci-theme-openwrt ​  ​| ​  7226 | OpenWrt.org (default) ​ | 
-| luci-i18n-english ​   |   1252 | English ​ | 
-| luci-app-firewall ​   |  16630 | Firmware and Portforwarding application ​ | 
-| firewall ​            ​| ​ 11603 | UCI based firewall for OpenWrt /​etc/​config/​firewall /​etc/​firewall.user. Dependencies:​ iptables, iptables-mod-conntrack,​ iptables-mod-nat ​ | 
-| luci-app-initmgr ​    ​| ​  5713 | LuCI Initscript Management ​ | 
-| libiwinfo ​           |  25362 | Wireless information library with consistent interface for proprietary Broadcom, madwifi, nl80211 and wext driver interfaces. ​ | 
-| luci-lib-ipkg ​       |   2846 | LuCI IPKG/OPKG call abstraction library ​ | 
-| luci-theme-base ​     |  25065 | Common base for all themes ​ | 
-| libnl-tiny ​          ​| ​ 14390 | This package contains a stripped down version of libnl  | 
-| liblua ​              ​| ​ 81477 | Lua is a powerful light-weight programming language designed for extending applications. Lua is also frequently used as a general-purpose,​ stand-alone ​ language. Lua is free software. This package contains the Lua shared libraries, needed by other programs. ​ | 
-| lua                  |   9069 | Lua is a powerful light-weight programming language designed for extending applications. Lua is also frequently used as a general-purpose,​ stand-alone ​ language. Lua is free software. This package contains the Lua language interpreter. (5.1.4-7) ​ | 
-| luci-lib-web ​        ​| ​ 59695 | MVC Webframework ​ | 
-| luci-lib-core ​       |  28096 | LuCI core libraries ​ | 
-| luci-lib-sys ​        ​| ​ 15795 | LuCI Linux/POSIX system library ​ | 
-| luci-lib-nixio ​      ​| ​ 31683 | NIXIO POSIX library ​ | 
-| luci-lib-core ​       |  28096 | LuCI core libraries ​ | 
-| luci-sgi-cgi ​        ​| ​  2420 | CGI Gateway behind existing Webserver ​ | 
-| luci-lib-lmo ​        ​| ​  4714 | LuCI LMO I18N library ​ | 
-^ Additionally Required for HTTPS  ^^^ 
-| luci-ssl ​       |    782 | Meta package. Standard OpenWrt set including full and mini admin, the standard theme + HTTPS support | 
-| uhttpd-mod-tls ​ |   5825 | The TLS plugin adds HTTPS support to uHTTPd. ​ | 
-| uhttpd-mod-lua ​ |   9178 | The Lua plugin adds a CGI-like Lua runtime interface to uHTTPd. ​ | 
-| libcyassl ​      ​| ​ 69682 | CyaSSL is an SSL library optimized for small footprint, both on disk and for memory use.  | 
-| px5g            |  28480 | Px5g is a tiny standalone X.509 certificate generator. ​ It's suitable to create key files and certificates in [[wp>​Distinguished Encoding Rules|DER]] and [[wp>​Privacy Enhanced Mail|PEM]] format for use with stunnel, uhttpd and others. ​ | 
-^ Internationalization and localization packages ​ ^^^ 
-| luci-i18n-xxx ​        ​| ​ ????? | Please confer to [[http://​i18n.luci.subsignal.org/​pootle/​]] for an overview of the translation progress. ​  | 
  
 +==== Start and Enable the web server (uHTTPd) ====
 +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 server, so 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>
 +/​etc/​init.d/​uhttpd start
 +/​etc/​init.d/​uhttpd enable
 +</​code>​
  
 +Now you should be able to connect to the web server serving LuCI at [[http://​192.168.1.1]].
  
-| **''​Note:''​** According to [[https://​forum.openwrt.org/​viewtopic.php?​pid=135623#​p135623|this post]] a ''​mini-admin-package''​ is no longer available | 
  
 +==== Details ====
 +LuCI is installed as a 'meta package'​ which installs several other packages by having these defined as a dependency. Notably, it installs the [[doc:​howto:​http.uhttpd|uHTTPd]] web server, configured for use with LuCI. The dependent packages are the following (see [[doc:​techref:​luci|the LuCI technical reference]] for more information):​
  
-===== LuCI on other web servers ===== +  *         ​uhttpd 
-->​[[doc:​howto:​http.overview]]+  ​* ​        ​uhttpd-mod-ubus 
 +  *         ​luci-mod-admin-full 
 +  *         ​luci-theme-bootstrap 
 +  *         ​luci-app-firewall 
 +  *         ​luci-proto-core 
 +  *         ​luci-proto-ppp 
 +  *         ​libiwinfo-lua
  
-==== LuCI on lighttpd ==== +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 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
-->​[[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**")+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.
  
-<​code>​ +===== Configuration ===== 
-opkg update +The default web server software uhttpd is configured in the file ''​[[doc:​uci:​uhttpd|/​etc/​config/​uhttpd]]''​.\\ 
-opkg install lighttpd lighttpd-mod-cgi ​luci-mod-admin-full luci-theme-openwrt libiwinfo +The LuCI web interface is configured in the file ''​[[doc:​uci:​luci|/etc/​config/​luci]]''​.
-</code>+
  
-Afterwards adjust the file ''/​etc/​lighttpd/​lighttpd.conf''​ to load the **mod_cgi**-module:​ 
  
-|''##​ modules to load +===== LuCI on other web servers ===== 
-# all other module should only be loaded if really neccesary +->​[[doc:​howto:​http.overview]]
-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:+==== LuCI on lighttpd ==== 
 +->​[[doc:​howto:​luci.on.lighttpd]]
  
-|''##​ CGI module +==== LuCI on nginx ==== 
-**cgi.assign ​( "​luci"​ %%=>%% "/​usr/​bin/​lua"​ )** +->​[[doc:​howto:​luci.on.nginx]]
-''​|+
  
-...if you want lighttpd'​s logs in the output of "​**logread**",​ add this:+==== LuCI on ... ====
  
-|''##​ enable syslog 
-server.errorlog-use-syslog = "​enable"​ 
-''​| 
  
-Enable ​(so that it will be started at every bootand start lighttpd: +===== Minimalistic offline installation ===== 
-<​code>​ +Download and transfer ​(e.g. using SCPthe packages listed below to your OpenWrt router onto the RAM disk in ''/​tmp/​luci-offline-packages''​ 
-/etc/init.d/lighttpd enable +<​code>​mkdir -p /tmp/luci-offline-packages;​ cd /tmp/luci-offline-packages</​code>​
-/etc/​init.d/​lighttpd start +
-</​code>​+
  
-===== LuCI & a Website Simultaneously on lighttpd =====+  * 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
  
-You just have to adjust a few settings in /​etc/​lighttpd/​lighttpd.conf+and install them with:
  
-OLD: +<code bash>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>
-| ''#​server.document-root = "/www/"''​ |+
  
-NEW: +Additionally,​ the following packages are needed for basic wireless configurationlibiw, libiwinfo, libiwinfo-lua.
-| ''​server.document-root = "/​website/"''​ |+
  
-At the end of the file add: +===== Miscellaneous =====
-| ''​$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 +
-<​code>​ +
-mkdir /website +
-echo "<​P>​It works!</​P>"​ > /​website/​index.html +
-</​code>​+
  
-Now your website is on port 80 and LuCI on port 88 using lighttpd!+=== Secure acccess to luci webserver ===
  
-**NOTE / TODO**: Instead of opening a 2nd port for lighttpd it should be possible ​to activate the module "​**mod_simple_vhost**"​  +If you want to configure Luci webserver for secure access, [[doc:​howto:​luci.secure|read the explanation here]].
-and serve your website (in a vhost) in friendly coexistence of LuCI via port 80... +
  
 ===== Troubleshooting ===== ===== Troubleshooting =====
-  * LuCI has its own web-presence. Please file LuCI specific bugs at the [[http://​luci.subsignal.org|LuCI website]]+  * 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]] ​(broken).
  
-  ​ 
  
 ===== Notes ===== ===== Notes =====
 [[doc:​techref:​luci|LuCI Technical Reference]] [[doc:​techref:​luci|LuCI Technical Reference]]
doc/howto/luci.essentials.1353888435.txt.bz2 · Last modified: 2012/11/26 01:07 by uvray313