BOA软件服务的移植和BOA服务的配置
一、下载解压原码
创建sources
目录用于存储未修改的原码
mkdir sources
进入目录并将boa-0.94.13.tar.gz
文件(这个文件可以去网上搜索)放入该文件夹,并解压文件到上级目录
tar -zxvf boa-0.94.13.tar.gz -C ../
目录结构大概这样
二、配置生成makefile
2.1 根据目标机器性能特性进行配置
通过configure
脚本进行配置,我们首先进入boa-0.94.13/src
这个目录,然后./configure
即可
2.2 指定工具
如果我们需要交叉编译的话,则需要将Makefile
中第31
行的gcc
更改为指定的交叉编译器
2.3 生成(make)
直接在Makefile
的目录输入make
即可
然后你可能会遇到这个错误:
其实这个是语法不支持这种宏函数的写法了,只需要去compat.h
文件中将这些地方的#
删掉即可
然后我们接着编译(输入make)就能生成成功了
如果我们输入ls
的话,会发现多了个boa
文件
当然由于编译的时候我们有个-g
的生成调试信息的选项,所以编译出来的boa
会非常的大,我们有两种操作:
1.通过strip
命令去除:
strip boa
2.在编译前修改Makefile文件
将Makefile
文件的第25
行的-g
删除
操作完成后,boa
文件的大小大概就在88k
左右了
如果想重新编译的话:
首先输入make clean
清理环境,然后再make
编译
三、运行测试
在运行前,我们需要先完成boa.conf
文件的 备份 以及配置,关于配置我们需要注意以下几个点即可:
3.1 port
一般来说对于嵌入式,不太需要自定义一些超过1024
的端口,因为是用于家庭内网的,也不会存在很多攻击者的情况,所以端口我们就不懂就好了
3.2 用户和组
这个需要填写我们自己的用户和组,不然默认没有权限
3.3 ErrorLog和AccessLog
前者是 错误日志 ,后者是 访问日志 ,这个根据自己的喜好配置路径即可,个人建议在与sources
同目录创建一个log
文件夹,然后将这两个日志放入其中
3.4 DocumentRoot
这个是服务器的根目录,我们后续的网页访问,其实也就是查看以这个目录为根的文件,和上面一样,建议放在sources
同目录,注意这里需要我们自己创建www
文件夹
其他的话就看自己的需求和情况更改吧,下面是我的boa.conf
文件的配置,注意配置好后,我们需要在/etc
目录下创建一个boa
文件夹,然后将boa.conf
文件放入其中
# Boa v0.94 configuration file
# File format has not changed from 0.93
# File format has changed little from 0.92
# version changes are noted in the comments
#
# The Boa configuration file is parsed with a lex/yacc or flex/bison
# generated parser. If it reports an error, the line number will be
# provided; it should be easy to spot. The syntax of each of these
# rules is very simple, and they can occur in any order. Where possible
# these directives mimic those of NCSA httpd 1.3; I saw no reason to
# introduce gratuitous differences.# $Id: boa.conf,v 1.25 2002/03/22 04:33:09 jnelson Exp $# The "ServerRoot" is not in this configuration file. It can be compiled
# into the server (see defines.h) or specified on the command line with
# the -c option, for example:
#
# boa -c /usr/local/boa# Port: The port Boa runs on. The default port for http servers is 80.
# If it is less than 1024, the server must be started as root.Port 80# Listen: the Internet address to bind(2) to. If you leave it out,
# it takes the behavior before 0.93.17.2, which is to bind to all
# addresses (INADDR_ANY). You only get one "Listen" directive,
# if you want service on multiple IP addresses, you have three choices:
# 1. Run boa without a "Listen" directive
# a. All addresses are treated the same; makes sense if the addresses
# are localhost, ppp, and eth0.
# b. Use the VirtualHost directive below to point requests to different
# files. Should be good for a very large number of addresses (web
# hosting clients).
# 2. Run one copy of boa per IP address, each has its own configuration
# with a "Listen" directive. No big deal up to a few tens of addresses.
# Nice separation between clients.
# The name you provide gets run through inet_aton(3), so you have to use dotted
# quad notation. This configuration is too important to trust some DNS.#Listen 192.68.0.5# User: The name or UID the server should run as.
# Group: The group name or GID the server should run as.User mangata
Group mangata# ServerAdmin: The email address where server problems should be sent.
# Note: this is not currently used, except as an environment variable
# for CGIs.#ServerAdmin root@localhost# ErrorLog: The location of the error log file. If this does not start
# with /, it is considered relative to the server root.
# Set to /dev/null if you don't want errors logged.
# If unset, defaults to /dev/stderr#ErrorLog /var/log/boa/error_log
ErrorLog /home/mangata/webpro/log/error_log
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
# is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
# process if the receiving end of a pipe stops reading."
#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/boa/error_log /var/log/boa/error-%Y%m%d.log"# AccessLog: The location of the access log file. If this does not
# start with /, it is considered relative to the server root.
# Comment out or set to /dev/null (less effective) to disable
# Access logging.#AccessLog /var/log/boa/access_log
AccessLog /home/mangata/webpro/log/access_log
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
# is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
# process if the receiving end of a pipe stops reading."
#AccessLog "|/usr/sbin/cronolog --symlink=/var/log/boa/access_log /var/log/boa/access-%Y%m%d.log"# UseLocaltime: Logical switch. Uncomment to use localtime
# instead of UTC time
#UseLocaltime# VerboseCGILogs: this is just a logical switch.
# It simply notes the start and stop times of cgis in the error log
# Comment out to disable.#VerboseCGILogs# ServerName: the name of this server that should be sent back to
# clients if different than that returned by gethostname + gethostbyname#ServerName www.your.org.here# VirtualHost: a logical switch.
# Comment out to disable.
# Given DocumentRoot /var/www, requests on interface 'A' or IP 'IP-A'
# become /var/www/IP-A.
# Example: http://localhost/ becomes /var/www/127.0.0.1
#
# Not used until version 0.93.17.2. This "feature" also breaks commonlog
# output rules, it prepends the interface number to each access_log line.
# You are expected to fix that problem with a postprocessing script.#VirtualHost# DocumentRoot: The root directory of the HTML documents.
# Comment out to disable server non user files.DocumentRoot /home/mangata/webpro/www# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is recieved.UserDir public_html# DirectoryIndex: Name of the file to use as a pre-written HTML
# directory index. Please MAKE AND USE THESE FILES. On the
# fly creation of directory indexes can be _slow_.
# Comment out to always use DirectoryMakerDirectoryIndex index.html# DirectoryMaker: Name of program used to create a directory listing.
# Comment out to disable directory listings. If both this and
# DirectoryIndex are commented out, accessing a directory will give
# an error (though accessing files in the directory are still ok).DirectoryMaker /usr/lib/boa/boa_indexer# DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
# has been commented out, the the on-the-fly indexing of Boa can be used
# to generate indexes of directories. Be warned that the output is
# extremely minimal and can cause delays when slow disks are used.
# Note: The DirectoryCache must be writable by the same user/group that
# Boa runs as.# DirectoryCache /var/spool/boa/dircache# KeepAliveMax: Number of KeepAlive requests to allow per connection
# Comment out, or set to 0 to disable keepalive processingKeepAliveMax 1000# KeepAliveTimeout: seconds to wait before keepalive connection times outKeepAliveTimeout 10# MimeTypes: This is the file that is used to generate mime type pairs
# and Content-Type fields for boa.
# Set to /dev/null if you do not want to load a mime types file.
# Do *not* comment out (better use AddType!)MimeTypes /etc/mime.types# DefaultType: MIME type used if the file extension is unknown, or there
# is no file extension.DefaultType text/plain# CGIPath: The value of the $PATH environment variable given to CGI progs.CGIPath /bin:/usr/bin:/usr/local/bin# SinglePostLimit: The maximum allowable number of bytes in
# a single POST. Default is normally 1MB.# AddType: adds types without editing mime.types
# Example: AddType type extension [extension ...]# Uncomment the next line if you want .cgi files to execute from anywhere
#AddType application/x-httpd-cgi cgi# Redirect, Alias, and ScriptAlias all have the same semantics -- they
# match the beginning of a request and take appropriate action. Use
# Redirect for other servers, Alias for the same server, and ScriptAlias
# to enable directories for script execution.# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example: Redirect /bar http://elsewhere/feh/bar# Aliases: Aliases one path to another.
# Example: Alias /path1/bar /path2/fooAlias /doc /usr/doc# ScriptAlias: Maps a virtual path to a directory for serving scripts
# Example: ScriptAlias /htbin/ /www/htbin/ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
我们继续在当前的目录/home/mangata/webpro/boa-0.94.13/src
输入sudo ./boa
此时我们的网页服务就能在后台运行了,我们可以随便写一个a.html
文件然后放入/home/mangata/webpro/www
目录中,然后访问ip(看自己是啥),我们再查看日志:
此时就有了一些访问记录,至此BOA软件服务的移植和服务配置(入门)到此为止,后续我会更新BOA服务开发相关内容,并最后会将项目代码开源
BOA软件服务的移植和BOA服务的配置相关推荐
- 基于软件分析的智能化开发新型服务与技术
摘要:从云服务厂商的角度来给大家介绍一下,当前业界围绕该领域要做哪些事情. 本文分享自华为云社区<基于软件分析的智能化开发新型服务与技术>,作者:敏捷的小智 . 本文以技术文章的方式回顾梁 ...
- 将服务端移植到Linux和MAC OS
文章目录 1 将服务端移植到Linux和MAC OS 1.1 概述 1.2 服务端代码实现 1 将服务端移植到Linux和MAC OS 1.1 概述 这里我们将服务端移植到Linux和MAC OS,差 ...
- 软件的接口设计图_面向服务架构(SOA)的汽车软件分析和设计
--后台回复"资料",领取特斯拉专利技术解析报告-- 文章转自:联合电子 本文将先重温下SOA架构的核心要素与优势,并重点讨论话题"面向服务架构(SOA)的汽车软件分析和 ...
- 使用开源软件和Tectonic,摆脱云服务供应商的锁定
本文讲的是使用开源软件和Tectonic,摆脱云服务供应商的锁定[编者的话]本文介绍了Core Fest大会关于容器PaaS平台--Tectonic的相关内容,以及使用开源软件打破云服务供应商的捆绑, ...
- 直播软件开发互动直播之WebRTC服务开源技术选型
直播软件开发互动直播之WebRTC服务开源技术选型 1 直播基础知识 最原始的直播系统其实并没有想象的那么复杂,无非就是主播端将音视频数据推送到服务器,观众端则从服务器拉取数据播放. 1.1 基本常识 ...
- 【苹果推iMessage源码】tils扩大软件安装大概通过Apple软件向您提供的某些服务
推荐内容IMESSGAE相关 作者推荐内容 iMessage苹果推软件 *** 点击即可查看作者要求内容信息 作者推荐内容 1.家庭推内容 *** 点击即可查看作者要求内容信息 作者推荐内容 2.相册 ...
- 假防病毒软件从电脑移植到了 Android 平台
以前有位女研究生点击网络钓鱼的链接.随即出现实时扫毒画面的方式,接着呈现了扫毒结果,跑出十余笔病毒数据,记录了被感染的计算机的具体位置,并提示她必须更新防病毒软件,而她在付费两千元后收到"防 ...
- IBM整合管理服务:云时代驱动IT服务创新
本文讲的是IBM整合管理服务:云时代驱动IT服务创新[IT168 专稿]日前,IBM全球信息科技服务部(GTS)在位于苏州工业园区的苏州国科数据中心举办IBM管理服务中心开业仪式.该整合管理服务中心坐 ...
- 微服务认证模式_微服务之“网关模式”
定义 API网关是一个服务器,它是系统中的单个入口点,用户对API网关进行单一呼叫,然后API网关调用每个相关的微服务器.它类似于面向对象设计的Facade模式.API网关封装内部系统架构,并提供针对 ...
最新文章
- vue2.0组件之间的通信
- python中的多继承
- C#进行Visio二次开发之Shape的Data1、Data2、Data3的用处
- ATT开源项目反客为主
- CodeForces - 1000C Covered Points Count(差分+思维)
- 华为eNSP模拟器上实现FTP服务
- 动态规划实战3-leetcode 55.Jump Game
- oracle临时表空间占用率过高,ORACLE临时表空间太大,如何处理?
- coolfire文章之一
- 【系统设计】大神三分钟搞懂领域驱动设计
- 宇视摄像机如何快速计算存储容量?
- dubbo之服务本地暴露
- 简单做(ZTD)的十个好习惯总结
- 房子出租后房东能随意进入租户家中吗?
- airtest 获取分辨率 绝对坐标 相对坐标
- 【codeforces 527A】Playing with Paper
- 直接打印RAW文件到打印机
- Laya微信排行榜基于TypeScript脚本 详细步骤
- MYSQL 如何得到两个日期间的工作日(不含周六日,节假日)
- Qmail+Vpopmail 安装相关文档
热门文章
- 三重积分先二后一和先一后二的碎碎念
- python下载数据集出现:Compressed file ended before the end-of-stream marker was reached
- 梯度下降法,最速下降法,牛顿法,Levenberg-Marquardt 修正,共轭方向法,共轭梯度法
- MAC下安装与配置MySQL [转]
- Query DSL(2)----Full text queries
- 进程间通信系列 之 信号实例
- 不会JS中的OOP,你也太菜了吧!(第二篇)
- C# MD5 加密算法
- c#正则表达式应用实例
- Unity Application Block 1.0系列(7): Lifetime Managers