How to transplant boa based on am335?

Keywords: Linux network Makefile Ubuntu

boa transplantation based on am335 needs five steps in total. Here are the detailed steps. You can learn from those who are unfamiliar with this knowledge.

1. Prepare development environment:

(1)VMware 10.0

(2)Ubuntu 14.04 64bit

(3) Sail335 development board

(4) cross compiler: gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux

2. source code:

(1) Boa source code: boa-0.94.13.tar.gz

(2) Boa test page: index.html

3. Transplantation process:

(1) Boa transplantation

     ①decompression 

          #tar zxvf boa-0.94.13.tar.gz

     ②Get into boa-0.94.13 Catalog

           #cd boa-0.94.13

     ③Get into src Directory, in src Run under directory./configure

     ④generate Makefile,modify Makefile Compiler options for

          #gedit Makefile

          CC = gcc    Change to    CC = arm-linux-gnueabihf-gcc

          CPP = gcc -E   Change to   CPP = arm-linux-gnueabihf-gcc -E

     ⑤Add cross compiler temporary environment variable

     #export PATH=/usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/:$PATH

     ⑥Modify file src/boa.c,take boa.c The following lines in the file can be removed.

     if ( setuid ( 0 ) != - 1 ) {     

       DIE ( "icky Linux kernelbug!" );

     }

     ⑦Modify file src/compat.h

     #define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff   

     //Change to   

     #define TIMEZONE_OFFSET(foo) foo->tm_gmtoff

     ⑧hold src Under folder config.c Li if(!server_name){..........}

    (About 266 lines     286 lines) comment out

     ⑨modify src/log.c  Annotate

      if (dup2(error_log, STDERR_FILENO) == -1) {

              DIE("unable to dup2 the  error log");

      }

      ⑨Compile code

          #make

4. Construction of operation environment

(1) create the following directory in the development board

     /etc/boa    /var/logs    /var/logs/boa    /var/www   /var/www/cgi-bin

     #mkdir -p /etc/boa

     #mkdir -p /var/logs

     #mkdir -p /var/logs/boa

     #mkdir -p /var/www

     #mkdir -p /var/www/cgi-bin

(2) copy and modify documents

     Copy boa-0.94.13/boa and boa-0.94.13/boa_indexer reach /usr/bin. 

     //Copy / etc/mime.type of Ubuntu 12.04 to development board / etc

     //Copy boa-0.94.13/boa.conf to / etc/boa

     //Modify / etc/boa/boa.conf

          #ServerNamewww.your.org.here to ServerName www.dianyu.org

          ScriptAlias /cgi-bin//Usr / lib / CGI bin / change to scriptalias / CGI bin / / var / www / CGI bin/

         AccessLog/var/log/boa/access_log Change to AccessLog /var/logs/boa/access_log

        ErrorLog /var/log/boa/error_log Change to  ErrorLog /var/logs/boa/error_log

     //Copy index.html to / var/www

5. Test and operation

     Connect the network connection between PC and development board network card 0 (eth0)

     Set the Ethernet card ip of development board to 192.168.1.123

     #ifconfig eth0 192.168.1.123 up

     Network connection between test development board network card 0 and PC

     #Ping the IP address of the PC

     Run Boa

     #boa&

     Open the browser on the PC, enter 192.168.1.123 in the browser, and check the index.html displayed by boa (the name of this file is the same as that of DirectoryIndex index.html in boa.conf file)

Posted by Fabrizzio PHP on Sun, 03 Nov 2019 01:15:22 -0700