Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
zh-cn:doc:howto:luci.essentials [2015/05/10 05:18] ysh815zh-cn:doc:howto:luci.essentials [2019/04/04 07:14] – links updated vgaetera
Line 1: Line 1:
 +====== LuCI 要点 ======
 +//在uHTTPd上安装LuCI//
  
 +这是安装Web用户界面LuCI的要点。运行"**''opkg update && opkg list luci-*''**"命令查找所有可用的能通过LuCI管理OpenWrt的软件包。 
 +
 +| {{:meta:icons:tango:utilities-terminal.png?nolink}} | 如果你不熟悉 [[wp>Command-line interface|命令行界面]], 可查询 [[docs:guide-user:base-system:user.beginner.cli|命令行帮助]] 和/或 [[docs:guide-user:additional-software:opkg]] |
 +
 +===== 安装 =====
 +  - 在软件库中检索可用软件包的最新列表:
 +<code bash>
 +opkg update
 +</code>
 +  * 完整安装一个//不需要//HTTPS支持的LuCI:
 +<code bash>
 +opkg install luci</code>
 +  * 完整安装一个//需要//HTTPS支持的LuCI:
 +<code bash>
 +opkg install luci-ssl
 +</code>
 +OPKG 安装 luci
 +
 +==== 本地语言支持 ====
 +基本的LuCI Web用户界面是英文的。但是,志愿者们正积极的把它翻译成许多语言。参见[[http://i18n.luci.subsignal.org/pootle/]] 可以参与!有关可用包的列表,运行
 +<code bash>
 +opkg list | grep luci-i18n-
 +</code>
 +
 +您会看到一个可用语言包的列表。要安装你的母语,例如运行
 +<code bash>
 +opkg install luci-i18n-chinese 
 +</code>
 +您还可以通过网页界面安装语言包,你可以同时安装多个LuCI语言包,要在它们之间切换可通过网页界面或编辑这个文件  -> ''[[doc:uci:luci|/etc/config/luci]]''
 +
 +==== 开始使用Web服务器(uHTTPd) ====
 +Web服务器[[http.uhttpd|uHTTPd]]是LuCI安装包的一个依赖软件,它会在你安装LuCI时自动安装。
 +安装后,Web服务器是**未运行的!**你需要手动开启它。你还应该//使能//Web服务器,以使它在你重启路由器时自动启动。
 +下面的第一个命令启动Web服务器,第二个使它在重启时启动。
 +<code bash>
 +/etc/init.d/uhttpd start
 +/etc/init.d/uhttpd enable
 +</code>
 +
 +现在,你应该能够连接到Web服务器 [[http://192.168.1.1]] 享受LuCI提供的服务了。
 +
 +==== 详细资料 ====
 +LuCI做为“元包”安装,它同时安装了其他几个被定义为依赖关系的包。
 +尤其是,它安装了[[docs:guide-user:services:webserver:http.uhttpd|uHTTPd]] Web服务器,配置为供LuCI使用。
 +安装的依赖包如下(更多信息参见[[docs:techref:luci|LuCI技术参考]]):
 +
 +  *         uhttpd
 +  *         uhttpd-mod-ubus
 +  *         luci-mod-admin-full
 +  *         luci-theme-bootstrap
 +  *         luci-app-firewall
 +  *         luci-proto-core
 +  *         luci-proto-ppp
 +  *         libiwinfo-lua
 +
 +要使用uHTTPd做Web界面,你仅需要很少的配置就行,因为uHTTPd配置了CGI以使LuCI可以使用Lua解释器来工作。
 +默认配置如下。默认情况下''/www''是标准的文档根目录。
 +因此,通过请求该文档根目录(在浏览器中输入设备IP地址)可以找到一个如''index.html''的索引文件(uHTTPd设置)。
 +配备的''/www/index.html''(与LuCI一起安装)文件会在收到请求时把你重定向到''/cgi-bin/luci''目录,
 +这是LuCI的默认CGI通道。这仅是一个脚本,它主要是在''/usr/bin/lua''中调用Lua。 
 +uHTTPd默认配置为用CGI加载''/cgi-bin''路径下的页面,从而通过''/cgi-bin/luci'' 脚本为这些网页开启服务。
 +
 +另外,也可以把Lua作为嵌入式进程来运行LuCI。uHTTPd支持这一点;
 +可以参考[[docs:guide-user:services:webserver:uhttpd#embedded.lua|uHTTPd Web服务器配置]]上uHTTPd的UCI配置的相关文章和章节 。
 +
 +===== 配置 =====
 +默认Web服务器uhttpd的配置文件为''[[docs:guide-user:services:webserver:uhttpd|/etc/config/uhttpd]]''。\\
 +该LuCI的Web界面配置文件为''[[doc:uci:luci|/etc/config/luci]]''
 +
 +
 +===== LuCI运行在其他WEB服务器上 =====
 +->[[docs:guide-user:services:webserver:start]]
 +
 +==== LuCI 运行在 lighttpd 上 ====
 +->[[docs:guide-user:luci:luci.on.lighttpd]]
 +
 +==== LuCI 运行在 nginx 上 ====
 +  * [[https://forum.openwrt.org/viewtopic.php?id=42487|Luci on nginx is not possible as nginx does not support plain cgi.]]
 +  * [[https://forum.openwrt.org/viewtopic.php?id=65760]]
 +
 +==== LuCI 运行在 ... ====
 +
 +
 +===== 简易离线安装 =====
 +下载并传输(如用SCP)以下列表中的软件包到你的OpenWrt路由器上,放到RAM盘''/tmp/luci-offline-packages''
 +<code>mkdir -p /tmp/luci-offline-packages; cd /tmp/luci-offline-packages</code>
 +
 +  * 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
 +
 +并用下面命令安装:
 +
 +<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>
 +
 +此外,基本的无线配置还需要以下包:libiw, libiwinfo, libiwinfo-lua。
 +
 +===== 杂项 =====
 +
 +=== 安全访问luci网络服务器 ===
 +
 +如果你想配置Luci网页服务器安全访问, [[docs:guide-user:luci:luci.secure|参考这里的说明]].
 +
 +===== 故障排除 =====
 +  * LuCI 开发网站在 Github:  [[https://github.com/openwrt/luci]]
 +  * 请提交LuCI特殊bugs到 [[https://github.com/openwrt/luci/issues|LuCI 问题跟踪]]
 +  * LuCIs 旧的网站 [[http://luci.subsignal.org|LuCI website]] (broken).
 +
 +
 +===== 注意事项 =====
 +[[docs:techref:luci|LuCI技术参考]]
  • Last modified: 2023/01/17 04:16
  • by vgaetera