APP下载

LAMP架构在嵌入式平台上的移植与搭建

2018-10-24李小娜张释如张雨珊赵榕

现代电子技术 2018年20期

李小娜 张释如 张雨珊 赵榕

摘 要: 基于嵌入式的Web服务应用体系提出将通用服务器架构LAMP应用于嵌入式系统的设计思想。分析LAMP架构在嵌入式领域的应用优势,设计嵌入式平台上LAMP架构的具体实现方案,并给出LAMP中各个组件在移植、配置和优化中的具体方法。该架构为嵌入式系统的高级网络应用提供了一种通用解决方案,其具体实现方法对嵌入式网络服务及其监控系统的应用具有借鉴和参考价值。

关键词: LAMP; MySQL; B/S架构; 嵌入式系统; Web服务; 网络应用

中图分类号: TN915?34; TP368.5 文献标识码: A 文章编号: 1004?373X(2018)20?0114?04

Abstract: A design idea of applying the general server architecture Linux?Apache?MySQL?PHP (LAMP) to the embedded system is proposed based on the embedded Web service application system. The advantages of applying the LAMP architecture in the embedded field are analyzed. The specific implementation scheme of the LAMP architecture on the embedded platform is designed. The specific methods for transplantation, configuration and optimization of every component in LAMP are presented. The architecture provides a general solution for the advanced network application of the embedded system. The specific implementation method of the architecture has a reference value for applications of embedded network service and its monitoring system.

Keywords: LAMP; MySQL; B/S architecture; embedded system; Web service; network application

0 引 言

隨着嵌入式系统对网络功能需求的不断提升,越来越多的嵌入式平台移植了B/S架构的Web服务来提供网络控制功能,在嵌入式网络服务及其监控系统等方面有广泛应用[1]。

目前,嵌入式平台的Web服务做法基本是:以thttpd,boa,lighttpd等轻型服务器为主,配合移植SQLite,eXtremeDB等小型嵌入式数据库,最后利用后台CGI(Common Gateway Interface)服务程序,将采集的数据反映到Web页面或存入数据库。这些精简架构虽然小巧灵活、结构简单,但是其功能有限,也不具备普遍适用性,存在许多应用方面的问题。第一,在水质监测、农田信息检测、粮仓监控等环境监控系统中,需要长期监测采集的信息,而大多数轻型嵌入式Web服务器稳定性不够;第二,在智能家居、机房监控等场合,要求数据或系统能以动态模拟的方式呈现给用户,仅靠CGI程序很难实现;第三,在工业控制领域中的预警处理、故障分析、安全监测等需要对数据库表进行长期跟踪与智能分析,而利用CGI操作大多数精简型嵌入式数据库不能实现完善的智能监测。……

登录APP查看全文