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/12/24 16:01]
written_direcon
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 ===== +
- +
-==== Via package repository ==== +
--> [[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>​ 
  
-==== Minimalistic offline installation ====+or
  
-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 ​bash>opkg install ​luci-ssl # enable https for luci</​code>​
-<​code>​mkdir -p /tmp/luci-offline-packages;​ cd /tmp/luci-offline-packages</​code>​+
  
-  * uhttpd +| {{:​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]] |
-  * 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+
  
-and install them with: 
  
-<​code>​for pkg in 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>​+==== Native Language Support ==== 
 +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>​
  
-==== Start the LuCI (uHTTPd) server ==== +You will see a list of the available language packages. To install your native language, do e.g. 
- +<​code ​bash
-Enable automatic start at boot and manually start the LuCI server: ​ +opkg install luci-i18n-hungarian
-<​code>​ +
-/​etc/​init.d/​uhttpd enable +
-/​etc/​init.d/​uhttpd start+
 </​code>​ </​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]].+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]]''​
  
  
 +==== 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>​
  
-===== Configuration ===== +Now you should be able to connect to the web server serving LuCI at [[http://192.168.1.1]].
--> ''​[[doc:uci:uhttpd|/etc/config/​uhttpd]]''​(//​optional//,​ you are not required to configure anything)+
  
-===== Administration ===== 
-FIXME TODO 
  
-===== Encompassed Packages ===== +==== Details ​==== 
-''​luci''​ and ''​luci-ssl''​ are meta-packages. ​Here you see what they comprise, the sizes are in Bytes compiled for the ar71xx platformThey should differ too much from binaries compiled ​for other architecturesAlso note, that with JFFS2 it is not possible to precisely predict ​the occupied space.+LuCI is installed as a 'meta package' ​which installs several other packages ​by having these defined as a dependencyNotablyit 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):​
  
-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.+  *         uhttpd 
 +  *         ​uhttpd-mod-ubus 
 +  *         ​luci-mod-admin-full 
 +  *         ​luci-theme-bootstrap 
 +  *         ​luci-app-firewall 
 +  *         ​luci-proto-core 
 +  *         ​luci-proto-ppp 
 +  *         ​libiwinfo-lua
  
-^  Name  ^  Size  ^ Description ​ ^ +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 follows. By 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 requestedit redirects you to ''/​cgi-bin/luci'',​ which is the default CGI gateway ​for LuCIThis is just scriptwhich 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
-| 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 supportIt 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 Broadcommadwifi, 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 applicationsLua is also frequently used as general-purposestand-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 applicationsLua 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. ​  |+
  
 +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.
  
- +===== Configuration ===== 
-| **''​Note:''​** According to [[https://forum.openwrt.org/viewtopic.php?​pid=135623#​p135623|this post]] ''​mini-admin-package'' ​is no longer available ​|+The default web server software uhttpd is configured in the file ''​[[doc:uci:uhttpd|/etc/config/uhttpd]]''​.\\ 
 +The LuCI web interface is configured in the file ''​[[doc:​uci:​luci|/​etc/​config/​luci]]''​.
  
  
Line 108: Line 64:
  
 ==== LuCI on lighttpd ==== ==== LuCI on lighttpd ====
-->​[[doc:​howto:​http.lighttpd]]+->​[[doc:​howto:​luci.on.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**"​)+==== LuCI on nginx ==== 
 +->​[[doc:​howto:​luci.on.nginx]]
  
-<​code>​ +==== LuCI on ... ====
-opkg update +
-opkg install lighttpd lighttpd-mod-cgi luci-mod-admin-full luci-theme-openwrt libiwinfo +
-</​code>​+
  
-Afterwards adjust the file ''/​etc/​lighttpd/​lighttpd.conf''​ to load the **mod_cgi**-module:​ 
  
-|''​## modules to load +===== Minimalistic offline installation ===== 
-# all other module should only be loaded if really neccesary +Download and transfer (e.g. using SCP) the packages listed below to your OpenWrt router onto the RAM disk in ''​/tmp/luci-offline-packages''​ 
-saves some time +<​code>​mkdir -p /​tmp/​luci-offline-packages;​ cd /​tmp/​luci-offline-packages</​code>​
-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:+  * 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
  
-|''##​ CGI module +and install them with:
-**cgi.assign = ( "​luci"​ %%=>%% "/​usr/​bin/​lua"​ )** +
-''​|+
  
-...if you want lighttpd'​s logs in the output of "**logread**",​ add this:+<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>​
  
-|''##​ enable syslog +Additionally,​ the following packages are needed for basic wireless configuration:​ libiw, libiwinfo, libiwinfo-lua.
-server.errorlog-use-syslog = "​enable"​ +
-''​|+
  
-Enable (so that it will be started at every boot) and start lighttpd: +===== Miscellaneous ​=====
-<​code>​ +
-/​etc/​init.d/​lighttpd enable +
-/​etc/​init.d/​lighttpd start +
-</​code>​ +
- +
-===== LuCI & a Website Simultaneously on lighttpd ​===== +
- +
-You just have to adjust a few settings in /​etc/​lighttpd/​lighttpd.conf +
- +
-OLD: +
-| ''#​server.document-root = "/​www/"''​ | +
- +
-NEW: +
-| ''​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 +
-<​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.1356361270.txt.bz2 · Last modified: 2012/12/24 16:01 by written_direcon