1.下载boa源码
http://www.boa.org/boa-0.94.13.tar.gz
2.进入源码目录
cd /home/jaya/houjunjie/openSource/boa-0.94.13/src
3../configure产生makefiel文件
make后会报错
错误参考;https://blog.csdn.net/xdw1985829/article/details/6672742
错误1
yacc -d boa_grammar.y
make: yacc: Command not found
make: *** [y.tab.c] Error 127
解决: apt-get install byacc
错误1
y.tab.c: In function ‘yyparse’:
y.tab.c:371:9: warning: implicit declaration of function ‘yylex’ [-Wimplicit-function-declaration]
if (yychar < 0)
^
lex boa_lexer.l
make: lex: Command not found
解决: apt-get install flex
错误1: util.c:100:1: error: pasting "t" and "->"does not give a valid preprocessing token make: *** [util.o]
解决办法: 修改 src/compat.h
找到 #defineTIMEZONE_OFFSET(foo) foo##->tm_gmtoff
修改成 #define TIMEZONE_OFFSET(foo) (foo)->tm_gmtoff
错误2: log.c:73 unable to dup2 the error log:bad file descriptor
解决方法:
方法1> 确定日志目录对与所有用户都具有可读/写的权限
方法2> 修改src/log.c (建议采用方法1)
注释掉
if(dup2(error_log, STDERR_FILENO) == -1) {
DIE("unableto dup2 the error log");
}
即修改为:
#if 0
if (dup2(error_log, STDERR_FILENO) == -1) {
DIE("unable to dup2 the error log");
}
#endif
4.启动boa服务
./boa -c ./ 或者程序修改根文件路径 /etc/boa
错误3: boa.c:228 - icky Linux kernel bug!: No such file or directory
将以下代码屏蔽
#if 0
if (setuid(0) != -1) {
DIE("icky Linux kernel bug!");
}
#endif
5>. 错误4: log.c:73 unable to dup2 the error log:bad file descriptor
解决方法:
方法1> 确定日志目录对与所有用户都具有可读/写的权限
方法2> 修改src/log.c (建议采用方法1)
注释掉
if(dup2(error_log, STDERR_FILENO) == -1) {
DIE("unableto dup2 the error log");
}
即修改为:
#if 0
if (dup2(error_log, STDERR_FILENO) == -1) {
DIE("unable to dup2 the error log");
}
#endif