📄 web 服务器开发文档.txt
字号:
Chap 9 Web 服务器
建立过程:
1 解压软件包并进入其目录
2 (optional) cd into the src directory and Change the default SERVER_ROOT by setting the #define at the top of src/defines.h
3 执行 ./configure (PC Linux下面这样就可以了但在ARM下可能要加--host=i686-pc-Linux-gnu --target=arm-Linux)
4 make
5 Configure: BOA.CONF配置文件存放在 /etc/boa 目录下
1)Choose a user and server port under which Boa can run. The traditional port is 80,
and user nobody (create if you need to) is often a good selection for security purposes.
If you don't have (or choose not to use) root privileges, you can not use port numbers
less than 1024, nor can you switch user id.
2)Choose a server root. The conf directory within the server root must hold your copy
of the configuration file boa.conf.
在/armgcc/boa/boa-0.94.14rc21/contrib/rpm目录下有一个原始的boa.conf文件,将其copy到/etc/boa目录下修改即可
3) Choose locations for log files, CGI programs (if any), and the base of your URL tree.
(log file 的文件路径为:/var/log/boa/access_log)
4)Choose locations for ErrorLog files (自己建立这个路径和文件,当然文件可以拷贝一个来改名建立/var/log/boa/error_log files)
5) Set the location of the mime.types file. 在/etc/目录下
6)Edit conf/boa.conf according to your choices above (this file documents itself).
Read through this file to see what other features you can configure.
6 Start
Start Boa. If you didn't build the right SERVER_ROOT into the binary, you can specify it on the command line with the -c option(command line takes precedence).
Example: ./boa -c /usr/local/boa
7 Test
At this point the server should run and serve documents. If not, check the error_log file for clues.
8 Install
Copy the binary to a safe place, and put the invocation into your system startup scripts. Use the same -c option you used in your initial tests.
9 运行 .setup 关闭防火墙
10 观察实验结果:
first 修改boa服务器的IP地址并且运行boa
second boa运行后,打开IE浏览器并输入网址 http://boa的IP地址 即可使用boaWEB服务器浏览Web页面
附:在ARM-Linux中使用boa WebServer
在Linux中使用Boa Webserver
Linux内核中没有包括Boa Webserver软件包,所以一般不会直接编译到内核里,通常直接把编译好的执行文件加到文件系统里。操作步骤如下:
1)在cramfs文件系统/mnt/etc目录下分别建立boa、cgi-bin、web目录;
2)拷贝前面编译的boa执行文件,boa.conf文件到/etc/boa/目录;拷贝前面编译的submit.cgi到/etc/boa/cgi-bin目录;
3)将index.html及相关web网页文件放在/etc/boa/web目录下;
3)参照第2.1节重新生成cramfs映象文件,即可加入boa服务器。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -