uhttpd作为openwrt的web服务器,同时有许多相对其他web服务器好用的功能,如支持TLS(SSL), CGI, LUA
https://wiki.openwrt.org/doc/howto/http.uhttpd
Config配置:https://wiki.openwrt.org/doc/uci/uhttpd
配置文件在:
/trunk/base/package/network/services/uhttpd/files/uhttpd.config
80端口改为81
配置文件:
root@OpenWrt:/etc/config# cat uhttpd
config uhttpd 'main'
list listen_http '0.0.0.0:81'
list listen_http '[::]:81'
list listen_https '0.0.0.0:443'
list listen_https '[::]:443'
option home '/www'
option rfc1918_filter '1'
option max_requests '3'
option max_connections '100'
option cert '/etc/uhttpd.crt'
option key '/etc/uhttpd.key'
option cgi_prefix '/cgi-bin'
option script_timeout '60'
option network_timeout '30'
option http_keepalive '20'
option tcp_keepalive '1'
option ubus_prefix '/ubus'
config cert 'px5g'
option days '730'
option bits '1024'
option country 'DE'
option state 'Berlin'
option location 'Berlin'
option commonname 'OpenWrt'
root@OpenWrt:/etc/config#
如何关闭uhttpd
删除掉/etc/init.d/uhttpd
root@OpenWrt:/etc/config# cd /etc/init.d/
root@OpenWrt:/etc/init.d# ls
boot cron dnsmasq dropbear factory fstab led log miniupnpd odhcpd sysctl sysntpd telnet uhttpd usbmode
cmdialer custom done easycwmpd firewall hwnat lighttpd mcproxy network qos sysfixtime system tinyproxy umount vsftpd
root@OpenWrt:/etc/init.d#
编译到固件中,可以修改Makefile,不在init.d里面生成该文件
openwrt7621\trunk\base\package\network\services\uhttpd\Makefile