一 .下载解压
1.下载boa-0.94.13.tar.gz
链接: https://pan.baidu.com/s/1OvT_WizGS6fW1YcOU9B9rQ?pwd=dep6 提取码: dep6
http://www.boa.org/
2.将boa-0.94.13.tar.gzk拷贝到虚拟机的任意目录
3.解压上述压缩包
tar xvf boa-0.94.13.tar.gz
4.进入boa-0.94.13/
cd boa-0.94.13/
5.进入src目录
cd src
二.编译源码
boa服务器的安装目录分析:
mkdir /home/c/boa/boa -p
mkdir /home/c/boa/log
mkdir /home/c/boa/www
mkdir /home/c/boa/www/cgi-bin
1.修改寻找boa.conf的路径
需要修改defines.h文件中的SERVER_ROOT,使其指向改动后的配置文件路径
修改目录vim defines.h
2.执行./configure配置编译环境
./configure
3. make编译源码
make
错误1:
yacc -d boa_grammar.y
make: yacc: Command not found
Makefile:59: recipe for target 'y.tab.c' failed
make: *** [y.tab.c] Error 127
sudo apt-get install byacc
错误2:
make: lex: Command not found
Makefile:62: recipe for target 'lex.yy.c' failed
make: *** [lex.yy.c] Error 127
sudo apt-get install flex
错误3:
util.c: In function ‘get_commonlog_time’:
util.c:100:39: error: pasting "t" and "->" does not give a valid preprocessing token
time_offset = TIMEZONE_OFFSET(t);
^
compat.h:120:30: note: in definition of macro ‘TIMEZONE_OFFSET’
#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
^
<builtin>: recipe for target 'util.o' failed
make: *** [util.o] Error 1
解决方案:
root@linux:src# vim compat.h +120
#define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff //修改成这个
//#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff //注释掉vim boa.c +225
225 #if 0 //注释掉
226 if (setuid(0) != -1) {
227 DIE("icky Linux kernel bug!");
228 }
229 #endif
4.把生成的boa 和 boa.conf(上一级目录) 文件 拷贝到boa/boa目录下
cp boa /home/c/boa/boa/
cd ..
cp boa.conf ~/boa/boa/
三.配置boa.conf
cd ~/boa/boa/
vim boa.conf
修改完成后保存退出
cd ..
复制创建文件
sudo cp /etc/mime.types boa
touch log/error_log
touch log/access_log
四 .运行服务器boa
sudo ./boa/boa
ps -axj | grep "boa"
2102 24862 24860 24255 pts/18 24255 S 65534 0:00 ./boa
25753 25793 25792 25753 pts/4 25792 S+ 1000 0:00 grep如果有进程则说明部署成功
网友评论