LuCI Essentials

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.

In case you are not familiar with a CLI, check out command line HELP

Installation

Via package repository

opkg Technical reference for opkg

Retrieve the current list of available packages in the repository:

opkg update
For a full LuCI installation without HTTPS support:
opkg install luci
For a full LuCI installation with HTTPS support
opkg install luci-ssl

Start the web server (uHTTPd)

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):

/etc/init.d/uhttpd start

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.

Enable automatic start at boot:

/etc/init.d/uhttpd enable

Configuration

/etc/config/uhttpd. (optional, you are not required to configure anything)

Administration

FIXME TODO

LuCI on other web servers

LuCI on lighttpd

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")

opkg update
opkg install lighttpd lighttpd-mod-cgi luci-mod-admin-full luci-theme-openwrt libiwinfo

Afterwards adjust the file /etc/lighttpd/lighttpd.conf to load the mod_cgi-module:

## 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:

## CGI module cgi.assign = ( "luci" => "/usr/bin/lua" )

…if you want lighttpd's logs in the output of "logread", add this:

## enable syslog server.errorlog-use-syslog = "enable"

Enable (so that it will be started at every boot) and start lighttpd:

/etc/init.d/lighttpd enable
/etc/init.d/lighttpd start

Add the following for the server to listen on ipv4 and ipv6

#Listen on ipv4
$SERVER["socket"] == ":80" {
}
#Listen on ipv6
$SERVER["socket"] == "[::]:80" {
        server.use-ipv6 = "enable"
}

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

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

Download and transfer (e.g. using SCP) the packages listed below to your OpenWrt router onto the RAM disk in /tmp/luci-offline-packages

mkdir -p /tmp/luci-offline-packages; cd /tmp/luci-offline-packages

  • 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

and install them with:

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

Additionally, the following packages are needed for basic wireless configuration: libiw, libiwinfo, libiwinfo-lua.

Troubleshooting

  • LuCI has its own web-presence. Please file LuCI specific bugs at the LuCI website

Notes

Back to top

doc/howto/luci.essentials.txt · Last modified: 2013/05/04 14:17 by orca