GithubHelp home page GithubHelp logo

cyysu / uhttpd Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 26.0 1.34 MB

uHTTPd是一个精简的服务器,是openwrt上默认的Web服务器,支持CGI,lua脚本以及静态文件的服务;一般适合作为路由器这样的嵌入式设备使用或者Web服务器的入门学习。

CMake 1.27% HTML 0.15% PHP 0.04% Makefile 0.50% C 90.11% M4 1.95% Shell 5.06% C++ 0.10% Lua 0.54% Objective-C 0.29%

uhttpd's Introduction

uHTTPd

uHTTPd 是一个 OpenWrt/LUCI 开发者从头编写的 Web 服务器。 它着力于实现一个稳定高效的服务器,能够满足嵌入式设备的轻量级任务需求,且能够与 OpenWrt 的配置框架 (UCI) 整合。默认情况下它被用于 OpenWrt 的 Web 管理接口 LuCI。当然,uHTTPd 也能提供一个常规 Web 服务器所需要的所有功能。

编译

Uhttp的编译时cmake编译系统,按照cmake编译方法编译即可。Uhttp是基于ubox ubus json-c的,如果加上SSL ,还需要openssl库。

$ git clone https://github.com/json-c/json-c.git
$ cd json-c
$ ./autogen.sh --configure
$ make
$ make install
$ git clone git://git.openwrt.org/project/libubox.git
$ cd libubox
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_LUA=off
$ make
$ make install
$ git clone git://git.openwrt.org/project/ubus.git
$ cd ubus
$ cmake -DBUILD_LUA=off
$ make
$ make install

最后编译安装uhttpd。(注意:CMakeLIsts.txt中的编译新增了-Werror选项,所有警告会当成错误进行处理)

$ cd uhttpd/build
$ cmake ..
$ make
$ make install

配置项

Usage: ./uhttpd -p [addr:]port [-h docroot]
        -f              Do not fork to background
        -c file         Configuration file, default is '/etc/httpd.conf'
        -p [addr:]port  Bind to specified address and port, multiple allowed
        -s [addr:]port  Like -p but provide HTTPS on this port
        -C file         ASN.1 server certificate file
        -K file         ASN.1 server private key file
        -h directory    Specify the document root, default is '.'
        -E string       Use given virtual URL as 404 error handler
        -I string       Use given filename as index for directories, multiple allowed
        -S              Do not follow symbolic links outside of the docroot
        -D              Do not allow directory listings, send 403 instead
        -R              Enable RFC1918 filter
        -n count        Maximum allowed number of concurrent requests
        -l string       URL prefix for Lua handler, default is '/lua'
        -L file         Lua handler script, omit to disable Lua
        -u string       URL prefix for HTTP/JSON handler
        -U file         Override ubus socket path
        -x string       URL prefix for CGI handler, default is '/cgi-bin'
        -i .ext=path    Use interpreter at path for files with the given extension
        -t seconds      CGI, Lua and UBUS script timeout in seconds, default is 60
        -T seconds      Network timeout in seconds, default is 30
        -d string       URL decode given string
        -r string       Specify basic auth realm
        -m string       MD5 crypt given string

简要流程

简要流程

更多详情

uHTTPd [OpenWrt Wiki]

uhttpd's People

Contributors

gvzhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.