在Ubuntu下Boa的测试
1. 安装 apt-get install boa
由于boa默认使用80,请注意是否已经有http服务使用
2. 配置 ,使用默认配置即可,配置文件 /etc/boa/boa.conf
html文件路径 /var/www/
cgi-bin路径 /usr/lib/cgi-bin/
3. 测试文件
*********************************
*index.html 存放到 /var/www/目录中,通过post方式提交用户名和密码到CGI中
*********************************
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>User Info</title></head> | |
| <body> | |
| <form name="form1" action="/cgi-bin/pass.cgi" method="POST"> | |
| <table align="center"> | |
| <tr><td align="center" colspan="2"></td></tr> | |
| <tr> | |
| <td align="right">Name</td> | |
| <td><input type="text" name="Username"></td> | |
| </tr> | |
| <tr> | |
| <td align="right">Password</td> | |
| <td><input type="password" name="Password"></td> | |
| </tr> | |
| <tr> | |
| <td><input type="submit" value="Submit"></td> | |
| <td><input type="reset" value="Cancel"></td> | |
| </tr> | |
| </table> | |
| </form> | |
| </body> | |
|
</html> ********************************* *pass.cgi 存放到 /usr/lib/cgi-bin/目录中,直接脚步实现 ********************************* #!/bin/sh read url 4. 一些说明 在示例的cgi C程序中一般为printf("Content-type:text/html\n\n"); 必须有两个\n 转为echo脚本实现,echo后面默认有一个\n,再来个空的echo 就又是一个\n.
在arm的板子上实现,版本与ubuntu不同,配置和路径有点不同 **************************************** */etc/boa/boa.conf ***************************************** Port 80
********************************* *index.html 存放到 /www/目录中,通过post方式提交用户名和密码到CGI中,内容同上 ********************************* ********************************* *pass.cgi 存放到 /www/cgi-bin/目录中,直接脚步实现,内容同上 *********************************
| |
本文详细介绍了如何在Ubuntu系统中安装并测试Boa Web服务器,包括安装步骤、配置细节以及CGI脚本实现。同时,针对ARM板子上的版本差异进行了说明,提供了详细的配置文件和测试文件示例。
1245

被折叠的 条评论
为什么被折叠?



