=============================================================
标题:wince添加web server
摘要:
备注:Windows CE 5.0
日期:2010.5.10
姓名:朱铭雷
=============================================================
添加如下组件:Core OS | Windows CE devices | Communication Services and Networking | Servers | Web Server (HTTPD)
platform.reg中添加如下注册表内容:
[HKEY_LOCAL_MACHINE/COMM/HTTPD/]
"IsEnabled"=dword:1
"UseAuthentication"=dword:0
"DirBrowse"=dword:0
其中:
"IsEnabled"=dword:1(CE系统启动时开启web服务)
"UseAuthentication"=dword:0(用户访问web服务器时不需要用户名和密码)
"DirBrowse"=dword:0(不允许进行目录浏览)
添加web Server组件之后,和其相关的默认注册表设置也会被添加进来,应该是被添加进了servers.reg文件中,我们在platform.reg文件中添加的注册表内容会覆盖这些默认设置。
默认添加的注册表内容如下:
; @CESYSGEN IF SERVERS_MODULES_HTTPD
; @CESYSGEN IF SERVERS_MODULES_SERVICES
[HKEY_LOCAL_MACHINE/Services/HTTPD/Accept/TCP-80]
; TCP port 80. Default HTTPD listen port.
"SockAddr"=hex:02,00,00,50,00,00,00,00,00,00,00,00,00,00,00,00
; @CESYSGEN IF CE_MODULES_TCPIP6
[HKEY_LOCAL_MACHINE/Services/HTTPD/Accept/TCP-80v6]
; TCP port 80. Default HTTPD listen port.
"SockAddr"=hex:17,00,00,50,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
; @CESYSGEN ENDIF CE_MODULES_TCPIP6
; @CESYSGEN IF HTTPD_HTTPAUTH
[HKEY_LOCAL_MACHINE/Services/HTTPD/Accept/TCP-443]
; TCP port 443, all addresses. Default SSL listen port.
"SockAddr"=hex:02,00,01,BB,00,00,00,00,00,00,00,00,00,00,00,00
; @CESYSGEN IF CE_MODULES_TCPIP6
[HKEY_LOCAL_MACHINE/Services/HTTPD/Accept/TCP-443v6]
; TCP port 443, all addresses. Default SSL listen port.
"SockAddr"=hex:17,00,01,BB,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
; @CESYSGEN ENDIF CE_MODULES_TCPIP6
; @CESYSGEN ENDIF HTTPD_HTTPAUTH
[HKEY_LOCAL_MACHINE/Services/HTTPD]
"Context"=dword:1
"FriendlyName"="World Wide Web Publishing"
; @CESYSGEN ELSE
[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/HTTPD]
; @CESYSGEN ENDIF SERVERS_MODULES_SERVICES
"Dll"="HTTPD.DLL"
"Order"=dword:8
"Keep"=dword:1
"Prefix"="HTP"
"Index"=dword:0
; Default HTTP server settings
[HKEY_LOCAL_MACHINE/COMM/HTTPD/]
"MaxLogSize"=dword:8000
"LogFileDirectory"="//windows//www"
"NTLM"=dword:1
"Basic"=dword:0
; Many configuration web pages (and telnet/ftp servers) by convention use a
; user named ADMIN to have admin level priveleges. Make sure this special ADMIN user
; has admin-level access to all Virtual Roots in web server as well, for convenience.
"AdminUsers"="ADMIN"
[HKEY_LOCAL_MACHINE/COMM/HTTPD/VROOTS//]
@="//windows//www//wwwpub//"
"a"=dword:0
[HKEY_LOCAL_MACHINE/COMM/HTTPD/WebSites/Public]
"NetworkInterfaces"="$PUBLIC"
"NTLM"=dword:1
"Basic"=dword:0
[HKEY_LOCAL_MACHINE/COMM/HTTPD/WebSites/Public/VRoots//]
@="//windows//www//wwwpub//"
"a"=dword:0
; @CESYSGEN ENDIF CE_MODULES_IPNAT
; @CESYSGEN ENDIF SERVERS_MODULES_HTTPD
; @CESYSGEN IF SERVERS_MODULES_FTPD
; @CESYSGEN IF SERVERS_MODULES_SERVICES
[HKEY_LOCAL_MACHINE/COMM/ConnectionSharing/Servers/HTTP]
"InternalName"=""
"IsEnabled"=dword:00000000
"Port"=dword:00000050
"InternalPort"=dword:00000050
"Protocol"="TCP"
[HKEY_LOCAL_MACHINE/COMM/ConnectionSharing/Servers/HTTPS]
"InternalName"=""
"IsEnabled"=dword:00000000
"Port"=dword:000001BB
"InternalPort"=dword:000001BB
"Protocol"="TCP"
测试:
网线连接板子和PC,PC端打开IE,输入:http://192.168.0.231回车,访问成功如下图: