Differences

This shows you the differences between two versions of the page.

doc:howto:luci.essentials [2013/02/22 07:08]
mypopy
doc:howto:luci.essentials [2014/07/10 12:38] (current)
tapper
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]] |+| {{: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]] and/or [[doc:techref:opkg]] |
===== Installation ===== ===== Installation =====
- +  - Retrieve the current list of available packages in the repository:<code bash>
-==== 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> </code>
-For a full LuCI installation //without// HTTPS support: +  * For a full LuCI installation //without// HTTPS support:<code bash>
-<code>+
opkg install luci</code> opkg install luci</code>
-For a full LuCI installation //with// HTTPS support +  * For a full LuCI installation //with// HTTPS support<code bash>
-<code>+
opkg install luci-ssl opkg install luci-ssl
</code> </code>
 +OPKG install luci
-==== Minimalistic offline installation ====+==== Native Language Support ==== 
 +The LuCI web user interface is being actively translated 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>
-Download and transfer (e.g. using SCP) the packages listed below to your OpenWrt router onto the RAM disk in ''/tmp/luci-offline-packages'' +To install your native language, do e.g. 
-<code>mkdir -p /tmp/luci-offline-packages; cd /tmp/luci-offline-packages</code>+<code bash> 
 +opkg install luci-i18n-hungarian 
 +</code>
-  * liblua  +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]]''
-  * 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+
-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> +==== Start the web server (uHTTPd) ==== 
- +The web server software [[http.uhttpd|uHTTPd]] is a dependency of the LuCI package and automatically installed on your OpenWrt system, when you install LuCI. After installation the web server is **not running!** You need to manually start the web server (uHTTPd)
-Additionally, the following packages are needed for basic wireless configuration: libiw, libiwinfo, libiwinfo-lua. +<code bash>
- +
-==== Start the LuCI (uHTTPd) server ==== +
- +
-Enable automatic start at boot and manually start the LuCI server:  +
-<code> +
-/etc/init.d/uhttpd enable+
/etc/init.d/uhttpd start /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]].+Now you should be able to connect to the web server serving LuCI at [[http://192.168.1.1]].
 +==== 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.
-===== Configuration ===== +Enable automatic start at boot: 
--> ''[[doc:uci:uhttpd|/etc/config/uhttpd]]''. (//optional//, you are not required to configure anything)+<code bash> 
 +/etc/init.d/uhttpd enable 
 +</code>
-===== Administration ===== +==== Details ==== 
-FIXME TODO+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):
-===== Encompassed Packages ===== +  *        uhttpd 
-''luci'' and ''luci-ssl'' are meta-packages. Here you see what they comprise, the sizes are in Bytes compiled for the ar71xx platform. They 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.+ *        uhttpd-mod-ubus 
 +  *        luci-mod-admin-full 
 +  *        luci-theme-bootstrap 
 +  *        luci-app-firewall 
 +  *        luci-proto-core 
 +  *        luci-proto-ppp 
 +  *        libiwinfo-lua
-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.+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.
-^  Name  ^  Size  ^ Description  ^ +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.
-| 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-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.  |+
- +===== Configuration ===== 
- +The default web server software uhttpd is configured in the file ''[[doc:uci:uhttpd|/etc/config/uhttpd]]''.\\ 
-| **''Note:''** According to [[https://forum.openwrt.org/viewtopic.php?pid=135623#p135623|this post]] a ''mini-admin-package'' is no longer available |+The LuCI web interface is configured in the file ''[[doc:uci:luci|/etc/config/luci]]''.
Line 113: Line 73:
==== 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 &quot;**luci**" or "**luci-ssl**", which automatically installs the webserver "**uhttpd**")+==== LuCI on nginx ==== 
 +-&gt;[[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 +&lt;code&gt;mkdir -p /tmp/luci-offline-packages; cd /tmp/luci-offline-packages&lt;/code&gt;
-# - saves memory +
-server.modules = (  +
-# &quot;mod_rewrite&quot;,  +
-# ";mod_redirect&quot;,  +
-# &quot;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 &quot;**logread**&quot;, add this:+&lt;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&gt;
-|''## 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: +
-<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! +
- +
-**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... +
===== Troubleshooting ===== ===== Troubleshooting =====
  * LuCI has its own web-presence. Please file LuCI specific bugs at the [[http://luci.subsignal.org|LuCI website]]   * LuCI has its own web-presence. Please file LuCI specific bugs at the [[http://luci.subsignal.org|LuCI website]]
-   
===== Notes ===== ===== Notes =====
[[doc:techref:luci|LuCI Technical Reference]] [[doc:techref:luci|LuCI Technical Reference]]

Back to top

doc/howto/luci.essentials.1361513307.txt.bz2 · Last modified: 2013/02/22 07:08 by mypopy