embedded web/application server - html

I need to write an user menu for an embedded device (mips linux). The menu has to be accessible from network (web page - AJAX?) and it has to be able to read/write hardware settings. What would be the easiest way to implement such an app/server? Where do I start?
PS: c/c++ preferred.
PS 2: I have limited resources

Take a look at mongoose embeddable web server.
See this related page on writing web applications.

If you are running linux you could try thttpd - tiny/turbo/throttling HTTP server

You may also consider a commercial server such as the Barracuda Server:
http://barracudaserver.com/

Related

How we can monitor a service status using Zabbix?

We are using Zabbix for server monitoring and its working fine for system resources like disk, CPU, memory etc.
Now we want to monitor some services also whether they are running fine or not like Apache, Nginx, Puma, Sidekiq etc.
Can you please help me how we can monitor such services using Zabbix?
Any guidance will be appreciated.
Thanks in advance.
You should refer to the documentation, it covers windows service monitoring and generic process monitoring with proc.* items.
Here you can find the supported item by platform matrix.
There's an external template for systemd lld, you can find it on Zabbix Share
for Nginx monitoring you can use that template
also take a look this repository, probably you can find there something useful
For sidekiq specifically, using
proc.num[,,,sidekiq]
seems to work. It uses the cmdline -argument.
Source:
https://zabbix-users.narkive.com/EKVrN9VY/proc-num-item-for-sidekiq-process

Architecture for Intranet Application

I am planning to build a production application for a small & medium business. This is an intranet application with maximum 15 to 30 concurrent users. The proposed architecture is:
Client: Firefox browser
UI: HTML, JavaScript, CSS
Communication via: jQuery AJAX
Middle Tier: Window Service hosting WCF Service (using webHttpBinding)
Database: SQLServer 2012 Express Edition
In this architecture the missing part is a WebServer that will serve the static HTML pages. I do not want to go in with IIS mainly because of the following reasons:
Keep the cost of deployment down
Most of work is being done in the Window Service hosting WCF Service
Since most of the middle tier work is done by my Window Service hosting WCF Service and my UI is HTML, JavaScript & CSS, can we do away with the WebServer like IIS or other WebServers supporting ASP.NET technology and use a lightweight WebServers which serves only static HTML pages something like lighttpd, nginx etc?
Are these light weight WebServers like lighttpd, nginx suitable to host in production environment.
There might be an issue of AJAX Cross Domain requests as Window Service hosting WCF Service and the lightweight WebServer may run on different port but on the same IP address. We can probably overcome this by opening it up to cross domain requests as it’s an intranet application.
One of the ideas behind this architecture is that I want to try and reuse this in other projects which are bigger in size.
Please let me know if this is possible and the related pros & cons of this approach. I am also open to any other suggestions which will help me improve this architecture.
I think you're overdesigning it for such a small site. If you're anyway going to run a WCF service it shouldn't be a problem to use IIS.
I'd suggest to either use ASP.NET MVC and do the html rendering on the server, or to go for a client side library such as angular.js in combination with Web API.

How to run OpenERP 6.1 Web on a different machine

How do I run OpenERP Web 6.1 on a different machine than OpenERP server?
In 6.0 this was easy, there were 2 config files and 2 servers (server and "web client") and they communicated over TCP/IP.
I am not sure how to setup something similar for 6.1.
I was not able to find helpful documentation on this subject. Do they still communicate over TCP/IP? How do I configure the "web client" to use a different server machine? I would like to understand the new concept here.
tl;dr answer
It's meant only for debugging, but you can.
Use the openerp-web startup script that is included in the openerp-web project, which you can install from the source. There's no separate installer for it, as it's not meant for production. You can pass parameters to set the remote OpenERP server to connect to, e.g. --server-host, --server-port, etc. Use --help to see the options.
Long answer
OpenERP 6.1 comes with a series of architectural changes that allow:
running many OpenERP server processes in parallel, thanks to improved statelessness. This makes distributed deployment a breeze, and gives load-balancing/fail-over/high-availability capabilities. It also allows OpenERP to benefit from multi-processor/multi-core hardware.
deploying the web interface as a regular OpenERP module, relieving you from having to deploy and maintain two separate server processes. When it runs embedded the web client can also make direct Python calls to the server API, avoiding unnecessary RPC marshalling, for an extra performance boost.
This change is explained in greater details in this presentation, along with all the technical reasons behind it.
A standalone mode is still available for the web client with the openerp-web script provided in the openerp-web project, but it is meant for debugging purposes rather than production. It runs in mono-thread mode by default (see the --multi-thread startup parameter), in order to serialize all RPC calls and make debugging easier. In addition to being slower, this mode will also break all modules that have a web part, unless all regular OpenERP addons are also copied in the --addons-path of the web process. And even then, some will be broken because they may still partially depend on the embedded mode.
Now if you were simply looking for a distributed deployment model, stop looking: just run multiple OpenERP (server) processes with the full stack. Have a look at the presentation mentioned above to get started with Gunicorn, WSGI, etc.
Note: Due to these severe limitations and its relative uselessness (vs maintenance cost), the standalone mode for the web client has been completely removed (see rev, 3200 on launchpad) in OpenERP 7.0.

With Native Client (NaCl) is it possible to embed a server in a page that can accept incoming requests?

Is it possible to open a port using Native Client that other browsers can connect to? Like a browser to browser connection?
In general, no. NaCl does not allow programs to open sockets directly (that would be a security problem). It is intended that NaCl/Pepper applications have the same general capabilities as Javascript applications; so something like WebSockets (connection back to the server) would be supported, but not directly opening files or sockets on the client machine. There's some work going on to have a P2P style networking in HTML5 (e.g. http://www.w3.org/TR/2008/WD-html5-20080122/#peer-to-peer) which would likely get Pepper support as well, but I don't know what the status of that is.
The only way to get P2P connection in browser is through WebRTC. If NaCl allows to use WebRTC (though Pepper API or whatever) then the only thing you need besides implementation is broker server that will connect clients with each other. See PeerJS for some info.

Web server for Objective-C

How can I create a webserver from my Obj-C app, and post custom HTML to it?
Thanks!
Check:
SimpleHTTPServer
CocoaHTTPServer
To embed a lightweight HTTP server in iOS or Mac apps, check out GCDWebServer which has a modern and clean architecture designed on top of Grand Central Dispatch.
It would most likely be easier and far more secure to use something like FastCGI and then use an existing HTTP server such as Nginx to serve the HTML that your app passes along rather than trying to embed an HTTP server directly in your application. Plus Nginx is extremely fast and can handle huge server traffic without really breaking a sweat which not all other HTTP servers can say.
Plus using an embedded server means that your app and your HTTP server must run under the same UID which is bad from a security perspective as anyone compromising the HTTP server gains access to all your website files as well.