简体   繁体   English

嵌入式服务器的Web技术

[英]Web technologies for an embedded server

I've recently started a new web development project for an embedded device and wanted to solicit some recommendations for technologies to use. 我最近为嵌入式设备开始了一个新的Web开发项目,并希望征求一些使用技术的建议。 The device will serve HTML pages which include AJAX code to retrieve data from a JSON server. 该设备将提供HTML页面,其中包含用于从JSON服务器检索数据的AJAX代码。 We're tentatively using Cherokee as the web server, though we're not tied to it. 我们暂时使用切诺基作为网络服务器,尽管我们并不依赖它。

Currently, I'm considering the following technologies: 目前,我正在考虑以下技术:

  • Write it all in PHP. 用PHP编写所有内容。 I know it's big, slow, and bloated, but I've got about 10MB available for the web interface (a lot for an embedded system), and we won't be seeing a lot of traffic on any of these devices. 我知道它很大,很慢,而且很臃肿,但我有大约10MB可用于网络界面(对于嵌入式系统来说很多),我们不会在任何这些设备上看到很多流量。 It does need to seem responsive for the users, however (pages should load in less than a second). 但它确实需要对用户做出响应(页面应该在不到一秒的时间内加载)。

  • FastCGI + a C program - We're using an in-memory database, so the C program could interact with the database directly through the API. FastCGI +一个C程序 - 我们使用的是内存数据库,因此C程序可以直接通过API与数据库进行交互。 This would have much better performance than PHP, but development time and reliability is a concern since C isn't very well-suited for web development. 这将比PHP具有更好的性能,但开发时间和可靠性是一个问题,因为C不太适合Web开发。

  • Lua + Kepler - This seems like a nice middle ground between performance and development time. Lua + Kepler - 这似乎是性能和开发时间之间的良好中间点。 However, I've never worked with Lua, so I'm not really sure how to implement it in an embedded web project. 但是,我从未与Lua合作过,所以我不确定如何在嵌入式Web项目中实现它。 I'm also uncertain as to how well it integrates with the Cherokee web server. 我也不确定它与Cherokee网络服务器的集成程度。

So any opinions or past experiences with the above stated technologies? 那么对上述技术的任何意见或过去的经验? Any others I should include in the list? 我应该列入名单中的其他人吗?

Thanks, Alex 谢谢,亚历克斯

When I was in this area, I used Lua and a simple FastCGI runner ( Luaetta [for I'm sure the latest source would be available if you asked the guy] , though I'm also sure that's not the only one, and there's Kepler of course), spawned by lighttpd. 当我在这个区域的时候,我使用了Lua和一个简单的FastCGI跑步者( Luaetta [我确定如果你问那个人可以使用最新的来源],虽然我也确定这不是唯一一个,而且还有当然是开普勒),由lighttpd产生。

It performed quite well on an embedded media player, and was used for remotely accessing content and controlling the device. 它在嵌入式媒体播放器上表现很好,用于远程访问内容和控制设备。 Though I don't maintain it anymore, you can find more about it at http://matthewwild.co.uk/projects/wooble . 虽然我不再维护它了,你可以在http://matthewwild.co.uk/projects/wooble找到更多相关内容。 If you think the source would help just poke me for it, it's currently only available via a package manager but I can fix that given the motivation. 如果您认为源代码可以帮助我找它,它目前只能通过包管理器获得,但我可以根据动机来解决这个问题。

Another (again Lua) project in this area is LuCI . 该领域的另一个(Lua)项目是LuCI These guys are dedicated to making a web interface for embedded devices (routers specifically), and have produced a nice framework with lots of supporting libraries geared towards that kind of system. 这些人致力于为嵌入式设备(特别是路由器)制作网络界面,并且已经制作了一个很好的框架,其中包含许多面向这种系统的支持库。

I wouldn't be concerned with not knowing Lua. 我不会担心不认识Lua。 If you know any language then you can pick up Lua in a day or two, the manual documents the whole language and is quite short. 如果你知道任何语言,那么你可以在一两天内拿起Lua,手册记录整个语言并且很短。

How about looking at HipHop, Facebook's PHP compiler? 看看Facebook的PHP编译器HipHop怎么样?

https://github.com/facebook/hiphop-php/wiki https://github.com/facebook/hiphop-php/wiki

That way you can write your code in PHP and effectively compile it to C++. 这样你就可以用PHP编写代码并有效地将其编译为C ++。

ASP.NET. ASP.NET。 Assuming that you wouldn't be interested in Embedded Windows Server 2008 , you could still leverage ASP.NET by incorporating Mono into Cherokee . 假设您对嵌入式Windows Server 2008不感兴趣,您仍然可以通过将Mono合并到切诺基来利用ASP.NET。 You could leverage Visual Studio as your RAD development environment and use things like ASP.NET MVC 2 . 您可以利用Visual Studio作为RAD开发环境,并使用ASP.NET MVC 2之类的东西。 A lot of third party user controls will also 'just work' with Mono ( Telerik Announces Support for their ASP.NET controls on Mono! ). 许多第三方用户控件也将“正常工作”Mono( Telerik宣布支持Mono上的ASP.NET控件! )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM