boa服务器编译

转载自https://www.cnblogs.com/EmbeddedGeorge/p/12371984.html,这里用作记录备份。

搭建好的boa源码https://download.youkuaiyun.com/download/gpio_01/15739094
修改源码
    位置 src/defines.h
    #define SERVER_ROOT "/home/george/boa" //此处为boa服务器位置,根据自己设置的位置填写正确
配置编译选项
    ./configure
    如果无法执行,请修改 configure 文件的权限为755
编译源码
    make clean //编译前先清理以下
    make //编译
配置boa服务器
    创建放置boa服务器的位置。(本文放在用户的根目录下)
    mkdir -p ~/boa ~/boa/www ~/boa/cgi-bin ~/boa/log
    拷贝安装相关文件
    cp src/boa src/boa_indexer examples/boa.conf ~/boa
    cp /etc/mime.types
修改配置文件 boa.conf 

 Port 80
 User 0
 Group 0
 ErrorLog /home/george/boa/log/error_log
 AccessLog /home/george/boa/log/access_log
 DocumentRoot /home/george/boa/www
 UserDir public_html
 DirectoryIndex index.html
 DirectoryMaker /home/george/boa/boa_indexer
 KeepAliveMax 1000
 KeepAliveTimeout 10
 MimeTypes /home/george/boa/mime.types
 DefaultType text/plain
 CGIPath /bin:/usr/bin:/usr/local/bin
 Alias /doc /usr/doc
 ScriptAlias /cgi-bin/ /home/george/boa/cgi-bin/


 
 至此,即完成了boa 服务器的移植。
 测试boa服务器index.html#

 <html>
    <body>
        <h3>This is a test page!</h3><br/>
            <style>
                img{
                    width:auto;
                    height:auto;
                    max-width:100%;
                    max-height:100%;
                }
            </style>
            <img src="image.jpg"/>
            <h3>Tree picture</h3><br/>
            <a href="/cgi-bin/test.cgi">to cgi page</a>
    </body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值