当前位置:首页 » 《休闲阅读》 » 正文

web 服务器lighttpd的交叉编译及配置

13 人参与  2024年04月07日 16:20  分类 : 《休闲阅读》  评论

点击全文阅读


一:下载源码

        下载lighttpd-1.4.54.tar.gz和pcre-8.43.tar.gz

        下载连接:lighttpd1.4.54源码及依赖库prce8.43源码资源-CSDN文库

二:交叉编译prce

        cd ~/work/pcre/

        mkdir _install

        tar zxvf pcre-8.43.tar.gz

        cd  pcre-8.43/

         ./configure --prefix=/home/hfzuo/work/pcre/_install --host=aarch64-linux-gnu CC=aarch64-linux-gnu-gcc

        注意替换自己的安装目录及工具链

        make

        make install

三:交叉编译lighttpd

        cd ~/work/lighttpd/

        mkdir _install

        tar zxf lighttpd-1.4.54.tar.gz

        cd lighttpd-1.4.54/    

        ./configure --prefix=/home/hfzuo/work/_install/ --host=aarch64-linux-gnu --without-zlib --without-bzip2 PCRE_LIB=/home/hfzuo/work/pcre/_install/lib/libpcre.a CPPFLAGS=-I/home/hfzuo/work/pcre/_install/include CC=aarch64-linux-gnu-gcc

        make

        make install

四:配置lighttpd 服务

        在~/work/lighttpd/_install中创建目录cache、cgi-bin、config、log、sockets、upload、vhosts、webpages,并将源码包中doc/config目录下的conf.d目录、lighttpd.conf和modules.conf复制到lighttpd.install/config

        cd ~/work/lighttpd/_instal

        mkdir -p cache cgi-bin config log sockets upload vhosts webpages

        cp -rf ~/work/lighttpd/lighttpd-1.4.54/doc/config/conf.d ~/work/lighttpd/lighttpd-1.4.54/doc/config/lighttpd.conf ~/work/lighttpd/lighttpd-1.4.54/doc/config/modules.conf ./config

        修改lighttpd.conf 如下:(只列出了需要修改的地方)

var.log_root    = "/root/lighttpd/log"var.server_root = "/root/lighttpd"var.state_dir   = "/root/lighttpd"var.home_dir    = "/root/lighttpd"var.conf_dir    = "/root/lighttpd/config"var.cache_dir   = server_root + "/cache"server.use-ipv6 = "disable"#server.username  = "lighttpd"#server.groupname = "lighttpd"server.document-root = server_root + "/webpages"#server.pid-file = state_dir + "/lighttpd.pid"#include "conf.d/access_log.conf"#server.network-backend = "sendfile"#$HTTP["url"] =~ "\.pdf$" {#  server.range-requests = "disable"#}server.upload-dirs = ( "/root/lighttpd/upload" )

           修改modules.conf  如下:(只列出了需要修改的地方)       

server.modules = (  "mod_access",  "mod_alias",#  "mod_auth",#  "mod_authn_file",#  "mod_evasive",#  "mod_setenv",#  "mod_usertrack",#  "mod_redirect",#  "mod_rewrite",)include "conf.d/cgi.conf"

        修改conf.d/cgi.conf    如下:(只列出了需要修改的地方)   

cgi.assign = (".cgi" => "")#cgi.assign                 = ( ".pl"  => "/usr/bin/perl",#                               ".cgi" => "/usr/bin/perl",#                               ".rb"  => "/usr/bin/ruby",#                               ".erb" => "/usr/bin/eruby",#                               ".py"  => "/usr/bin/python" )alias.url += ( "/cgi-bin" => server_root + "/cgi-bin" )

 五:测试网页添加      

        在_install/webpages目录下创建index.html文件,文件中添加如下内容:

<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>lighttpd Test</title></head><body><p>Hello World!</p><hr><p>Test Page!</p></body></html>

六:lighttpd 服务测试

        将~/work/lighttpd/_install 整个文件夹全部拷贝到开发板/root/下 并重命名为lighttpd,此路径为第四步中配置文件设置,可自行修改,检查开发板是否有/var/tmp 目录,没有则新建。

        在开发板中:

             cd /root/lighttpd/sbin

            ./lighttpd -f ../config/lighttpd.conf -m ../lib/

        在pc端浏览器中输入开发板ip即可弹出网页,如下:

        

         

                

                


 


点击全文阅读


本文链接:http://zhangshiyu.com/post/91853.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新文章

  • 重生八零:妹妹替我嫁给养猪万元户免费_[妹妹张志强家珍]小说章节试读
  • 宋南乔贺景川宋南乔贺景川免费
  • 错轨七年,得知真相后他疯了后续在线阅读_慕行渊小雨乔青璃节选高光片段速递‌
  • 万般风月解语花最新章节在线阅读_裴延江婉婉婉后续在线阅读
  • 「我们才刚答案,你成武圣了?」精彩章节试读_「杨间苏沐晴」精彩节选免费试读
  • (番外)+(全书)沈昭宜傅沉砚(填我十万八千梦+后续+番外)完结_(沈昭宜傅沉砚)列表_笔趣阁(填我十万八千梦+后续+番外)
  • (番外)+(全书)腐草为萤不相念全书+后续+结局(江心璐裴纪臣)全书免费在线_(腐草为萤不相念全书+后续+结局)列表_笔趣阁(江心璐裴纪臣)
  • 孟卿卿谢昭远绮萝(孟卿卿谢昭远绮萝结局+番外)_(孟卿卿谢昭远绮萝)列表_笔趣阁(孟卿卿谢昭远绮萝结局+番外)
  • 孤舟不渡我节选名场面直通车‌_傅斯屿沈静姝程晏淮完结版免费在线阅读
  • 今日热读(跟恶毒女配互换身体后,她哭惨了+后续+结局)沈思允谢景行_跟恶毒女配互换身体后,她哭惨了+后续+结局热点全书在线(沈思允谢景行)
  • 你是我难愈的旧伤+后续+结局(傅深铭夏晚星)_(傅深铭夏晚星)你是我难愈的旧伤+后续+结局列表_笔趣阁(傅深铭夏晚星)
  • 「匿爱成殇」完结_[苏晴顾言黄脸婆]精彩章节试读

    关于我们 | 我要投稿 | 免责申明

    Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1