其他
极路由4刷机
米沃奇 波箱保养
玩客云
玩客云刷第三方系统
玩客云-Home Assistant
服务器采购
RTL9210/RTL9210B
随身WiFi
固件备份与恢复
Debian
Debian-文件共享
Debian-物联网
Debian-授权
Debain-ZeroTier
Debian-自启动脚本
Debian-拓展内存
Debian-清理空间
Debian-USB控制
Debian-adb进9008
Debian-常见问题
Debian-快速使用
随身WiFi使用
切卡
快速找摄像头IP
edu教育邮箱申请
域名邮箱(转发)-Cloudflare
Web监控工具
WxPusher(微信消息推送)
WxPusher-API推送
WxPusher-Python推送
WxPusher-Shell推送
WxPusher-挪车通知
企业微信-应用
Godlike-免费游戏服务器
GitHub 国内访问(host)
常用螺丝替代型号
GitHub Actions
workflows-同步上游仓库(覆盖)
workflows-⭐同步上游仓库
workflows-构建 Docker镜像
FAT32不可读
Kindle
Kindle-救砖
Kindle-越狱
中国移动-RAX3000Q(Y)
OpenWrt
网络奇葩问题
小米手环_BandTOTP
本文档使用 MrDoc 发布
-
+
首页
OpenWrt
## daemon.err uhttpd ```bash vim /etc/config/uhttpd # uhttpd配置文件 ls /cgi-bin # 检测无该文件夹 mkdir -p /cgi-bin # 创建文件夹 chmod -R 755 /cgi-bin # 修改权限 cp -r /www/cgi-bin/* /cgi-bin/ # 复制LuCI的CGI脚本文件 cat /etc/bench.log # 检测无日志文件 touch /etc/bench.log # 创建该日志文件 logread | grep uhttpd # 查看uhttpd日志 /etc/init.d/uhttpd restart # 重启uhttpd ``` `/etc/config/uhttpd`,配置文件注释 ```bash config uhttpd 'main' # 定义一个名为 "main" 的 uhttpd 配置实例,这是 uhttpd 的主要配置部分 list listen_http '0.0.0.0:80' # 监听所有 IPv4 地址的 80 端口,用于 HTTP 服务 list listen_http '[::]:80' # 监听所有 IPv6 地址的 80 端口,用于 HTTP 服务 list listen_https '0.0.0.0:443' # 监听所有 IPv4 地址的 443 端口,用于 HTTPS 服务 list listen_https '[::]:443' # 监听所有 IPv6 地址的 443 端口,用于 HTTPS 服务 option redirect_https '1' # 启用 HTTP 到 HTTPS 的自动重定向,确保所有 HTTP 请求都被重定向到 HTTPS option home '/www' # 设置网页文件的根目录,默认的 HTML 文件存放位置 option rfc1918_filter '1' # 启用对 RFC1918 私有地址段的过滤,防止外部访问内部网络 option max_connections '100' # 设置最大并发连接数为 100 option cert '/etc/uhttpd.crt' # 指定 HTTPS 服务使用的 SSL 证书文件路径 option key '/etc/uhttpd.key' # 指定 HTTPS 服务使用的 SSL 私钥文件路径 option cgi_prefix '/cgi-bin' # 设置 CGI 脚本的前缀路径,所有 CGI 脚本都位于此路径下 list lua_prefix '/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua' # 设置 Lua 脚本的前缀路径,用于处理 LuCI 请求 option script_timeout '60' # 设置 CGI 脚本的最大执行时间为 60 秒 option network_timeout '30' # 设置网络请求的最大超时时间为 30 秒 option http_keepalive '20' # 设置 HTTP Keep-Alive 的超时时间为 20 秒 option tcp_keepalive '1' # 启用 TCP Keep-Alive 功能,用于检测和清除死连接 option ubus_prefix '/ubus' # 设置 ubus(OpenWRT 的通用总线系统)的前缀路径 list index_page 'cgi-bin/luci' # 设置默认的首页为 /cgi-bin/luci,通常是 LuCI 的登录页面 option max_requests '50' # 设置每个连接的最大请求数为 50 config cert 'defaults' # 定义默认的 SSL 证书生成配置 option days '730' # 设置证书的有效期为 730 天(约 2 年) option key_type 'rsa' # 设置密钥类型为 RSA option bits '2048' # 设置 RSA 密钥的位数为 2048 位 option ec_curve 'P-256' # 如果使用椭圆曲线加密,指定曲线类型为 P-256 option country 'ZZ' # 设置证书的国家代码,ZZ 表示未知或未指定 option state 'Somewhere' # 设置证书的州或地区名称 option location 'Unknown' # 设置证书的城市或位置名称 option commonname 'OpenWrt' # 设置证书的通用名称(CN),通常为设备或组织的名称 ```
造物者W
2025年2月8日 21:50
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码