你好,游客 登录 注册 搜索
背景:
阅读新闻

嵌入式Web服务器Lighttpd的交叉编译及配置(for arm-linux)

[日期:2012-05-20] 来源:Linux社区  作者:ljf_gzhu [字体:大 中 小]
备注:
PC Linux:Ubuntu-10.10
PC Linux用户:root
lighttpd版本:1.4.30
arm-linux-gcc版本:4.4.3
arm linux用户:root

1. 编译、安装
1.1. 先到lighttpd官网下载对应版本的软件包:
我下载的是 lighttpd-1.4.30.tar.gz
1.2. 将压缩包解压到任意目录(我的是 /root/Desktop/common)得到文件夹 lighttpd-1.4.30
1.3. 在文件夹 lighttpd-1.4.30 中创建shell脚本,命名为:configure-arm.sh
1.4. 在shell脚本 configure-arm.sh 中输入如下代码:
#! /bin/sh
CC=arm-linux-gcc AR=arm-linux-ar LD=arm-linux-ld RANLIB=arm-linux-ranlib STRIP=arm-linux-strip ./configure --prefix=/opt/web/lighttpd-1.4.30-arm --host=arm-linux --build=i686-pc-linux --disable-FEATURE --enable-shared --disable-static --disable-lfs --disable-ipv6 --without-PACKAGE --without-valgrind --without-openssl --without-kerberos5 --without-pcre --without-zlib --without-bzip2 --without-lua
1.5. 打开控制台,cd进入 lighttpd-1.4.30 目录
1.6. 给 configure-arm.sh 文件添加可执行属性,执行命令:
chmod +x configure-arm.sh
1.7. 配置lighttpd,执行命令:
./configure-arm.sh
1.8. 编译lighttpd,执行命令:
make
1.9. 安装lighttpd,执行命令:
make install
1.10. 安装完成后,在安装目录 /opt/web/lighttpd-1.4.30-x86 中生成 lib、sbin和share三个文件夹,如下图所示:
嵌入式Web服务器Lighttpd的交叉编译及配置(for arm-linux)
 
2. 配置
2.1. 在安装目录 /opt/web/lighttpd-1.4.30-arm 中手动创建如下文件夹:cache、cgi-bin、config、log、sockets、upload、vhosts、webpages。如下图所示:
嵌入式Web服务器Lighttpd的交叉编译及配置(for arm-linux)
2.2. 将源码包中doc/config目录下的config.d、lighttpd.conf和modules.conf复制到安装目录中config文件夹里面,如下图所示: 
嵌入式Web服务器Lighttpd的交叉编译及配置(for arm-linux)
 
2.3. 修改刚复制过来的lighttpd.conf文件
1)将16行至20行修改为如下褐色加粗字体所示:
var.log_root    = "/opt/web/lighttpd-1.4.30-arm/log"
var.server_root = "/opt/web/lighttpd-1.4.30-arm"
var.state_dir   = "/opt/web/lighttpd-1.4.30-arm"
var.home_dir    = "/opt/web/lighttpd-1.4.30-arm"
var.conf_dir    = "/opt/web/lighttpd-1.4.30-arm/config"
 2)将61行和93行修改为如下褐色加粗字体所示:
var.cache_dir   = server_root + "/cache"
server.use-ipv6 = "disable"
3)将104和105行注释掉,如下所示:
#server.username  = "lighttpd"
#server.groupname = "lighttpd"
4)将115行修改为如下褐色加粗字体所示:
server.document-root = server_root + "/webpages"
5)将127行注释掉,如下所示:
#server.pid-file = state_dir + "/lighttpd.pid"
6)如果不需要查看错误日志文件,可以将141行注释掉,如下所示:
#server.errorlog             = log_root + "/error.log"
7)将152行、158行、191行注释掉,如下所示:
#include "conf.d/access_log.conf"
#include "conf.d/debug.conf"
#server.network-backend = "linux-sendfile"
8)根据系统资源设置207行和225行的数值,本系统的设置分别如下褐色加粗字体所示:
server.max-fds = 256
server.max-connections = 128
9)将314至316行注释掉,如下所示:
#$HTTP["url"] =~ "\.pdf$" {
#  server.range-requests = "disable"
#}
10)将373行修改为如下褐色加粗字体所示:
server.upload-dirs = ( "/opt/web/lighttpd-1.4.30-arm/upload" )
linux
相关资讯       lighttpd 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款