Ubuntu14.04 build Boa Service

1. Download boa Source: https://sourceforge.net/projects/boa/

   Version: boa-0.94.13.tar.gz

2. Extract in Ubuntu to access [ boa-0.094.13 / src / ] directory

3. Run [ ./configure ] -----> [ make ]

Tip error:

    yacc -d boa_grammar.y

          make: yacc: command not found

          make: *** [y.tab.c] Error 127

Solution: lack bison library: [ sudo apt-get install bison ]

4. Continue [ make

Tip error:

    lex boa_lexer.l

     make: lex: command not found

     make: *** [lex.yy.c] Error 127

Solution: [  sudo apt-get install flex  ]

5. Continue [make]

Tip error:

     util.c:100:39error: 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

Solution: 0.94.13-modified BoA / the src / 120 row compat.h file is as follows:#define TIMEZONE_OFFSET (foo) foo-> tm_gmtoff  ]

 

6. Continue: [make] ok

The above has been initially successful compilation, begin to configure boa

 

7. 【  sudo mkdir / etc / good

 【  Cp good 0.94.13 / boa.conf / etc / good /

 

  (1) The [  /etc/boa/boa.conf ] file is modified as follows:

A:
 the User the nobody 
Group nogroup 
to: the User 
0 
Group 0

  

  (2) at the second modified

The:
 #ScriptAlias / CGI-bin / / usr / lib / CGI-bin / 
read as follows: the ScriptAlias
 / CGI-bin / / var / WWW / htbin / 

  

 

 8. Create the necessary directories

 【  Sudo mkdir / var / www

 【  Sudo mkdir / var / www / cgi-bin

 【  Sudo mkdir / var / log / good

9. Create a test html files in [/ var / www / index.html] []

 

<html>
<body>
<p> Turn on/off Led </p>
<button type="button" id="led_on"> turn on </button>
<br/>
<br/>
<button type="button" id="led_off"> turn off </button>
</body>
</html>

 

 

 

10. 在目录【 boa-0.94.13/src】 下执行 【sudo ./boa】启动 boa服务

  (1)提示错误:

 

   log.c:73 - unable to dup2 the error log: Bad file descriptor

 

解决方式:注释掉 boa-094.13/src/log.c 中

/*    
 if (dup2(error_log, STDERR_FILENO) == -1) {
       DIE("unable to dup2 the error log");
 }
*/ 

重新 编译 make , 再次执行 sudo ./boa

  (2)提示错误   

     boa.c: 226 - icky Linux kernel bug!: Success

 解决方式:注释掉 boa.c中的

/* if (setuid(0) != -1) {
       DIE(”icky Linux kernel bug!”);
} */

 

重新编译,并启动boa服务,成功启动!

 12.  再次启动boa服务 【 sudo ./boa 】并打开浏览器 输入 127.0.0.1

 

 

 

转:https://blog.csdn.net/crazy0126/article/details/41223103

Guess you like

Origin www.cnblogs.com/electronic/p/11209061.html