Creating an Erlang framework that can run under Apache (and most other HTTP servers) is a matter of hosting a CGI bridge to the framework. This bridge then makes a remote procedure call to an Erlang node requesting a page to be constructed. Since a CGI file can be composed in C/C++ it can therefore interface with Erlang nodes using the erl_interface library. Put simply, we're using a small piece of code (a working rough draft is ~200 lines) to connect a web framework written in Erlang with any web server that supports CGI (notably Apache and IIS).
This CGI bridge opens up Erlang frameworks to a host of existing non-Erlang web servers. The major use for this is connecting smaller dynamic websites with larger distributed Erlang applications. Furthermore, in the event of a server crash the larger application persists with only the web interface going down. I've written a working rough draft of the bridge, and Apache is serving pages generated from Erlang. POST and GET data among other server variables are being passed into the framework/webapp stub removing the need for side-effects within Erlang. The next step is seeing whether I can connect this bridge to an existing framework.
No comments:
Post a Comment