# RV1126RemoteMonitoring **Repository Path**: shunzi20220/RV1126RemoteMonitoring ## Basic Information - **Project Name**: RV1126RemoteMonitoring - **Description**: rv1126远程拉流解码,CGI作为中间桥梁,在web页面上显示监控画面 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-01-04 - **Last Updated**: 2025-02-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CGI远程监控 ### 安装BOA服务 boa下载:http://www.boa.org ```sh sudo apt-get install bison flex tar –zxvf boa-0.94.13.tar.gz ``` 修改src/compat.h,改成: ```C #ifdef HAVE_TM_GMTOFF #define TIMEZONE_OFFSET(foo) foo->tm_gmtoff #else #define TIMEZONE_OFFSET(foo) timezone #endif #ifdef HAVE_TM_ZONE #define TIMEZONE(foo) foo->tm_zone #else #define TIMEZONE(foo) *tzname #endif ``` 修改,src/log.c,改成: ```C /*if (dup2(error_log, STDERR_FILENO) == -1) { DIE("unable to dup2 the error log"); }*/ ``` 修改,src/boa.c,改成: ```c /*if (passwdbuf == NULL) { DIE("getpwuid"); } if (initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) { DIE("initgroups"); }*/ if (setgid(server_gid) == -1) { DIE("setgid"); } if (setuid(server_uid) == -1) { DIE("setuid"); } /* test for failed-but-return-was-successful setuid * http://www.securityportal.com/list-archive/bugtraq/2000/Jun/0101.html */ /*if (setuid(0) != -1) { DIE("icky Linux kernel bug!"); }*/ ``` 修改src/defines.h ,改成: ```c //修改传输文件的大小限制,默认1MB修改为16MB #define SINGLE_POST_LIMIT_DEFAULT 1024 * 1024 *16/* 16 MB */ //修改配置文件路径 #ifndef SERVER_ROOT #define SERVER_ROOT "/demo/bin/boa" #endif ``` ```makefile ./configure # 改Makefile,设置编译器路径 CC = /opt/atk-dlrv1126-toolchain/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CPP = /opt/atk-dlrv1126-toolchain/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -E make #拷贝所需文件到boa文件夹 cd .. mkdir -p ./boa ./boa/www ./boa/cgi-bin ./boa/log cp boa.conf ./boa cp src/boa ./boa cp src/boa_indexer ./boa cp /etc/mime.types ./boa ``` 把boa文件夹打包放到`src/defines.h`定义的路径下,改下boa.conf, 已经把注释去掉 ```makefile Port 88 User 0 Group 0 ErrorLog /demo/bin/boa/log/error_log AccessLog /demo/bin/boa/log/access_log DocumentRoot /demo/bin/boa/www UserDir public_html DirectoryIndex index.html DirectoryMaker /demo/bin/boa/boa_indexer KeepAliveMax 1000 KeepAliveTimeout 10 MimeTypes /demo/bin/boa/mime.types DefaultType text/plain CGIPath /bin:/usr/bin:/usr/local/bin Alias /doc /usr/doc ScriptAlias /cgi-bin/ /demo/bin/boa/cgi-bin/ ``` 小试牛刀,新建 `index.html`,放到 `/demo/bin/boa/www` ```html