Tuesday 23 mars 2004 00:24 Hal Snyder wrote:
> Most new Erlang applications we write for our telephony platform
> use yaws for status and control. We needed to work in a scheme of
> configuration management to support this practice. Here's what we
> have so far.
>
> I wonder if anyone else is doing something similar and has comments.
>
> This is gruesome and boring CM, but if we don't make it sensible
> at our site at the outset we will make a zoo of varying ad hoc
> directory setups and soon lose the ability to reuse code, simply
> because of stupidity in the build system.
>
.. lots of CM stuff deleted...
>
OK, maybe my response is not right on topic, but could it be possible to
to have a more general way of handling yaws applications? I would like to
see some framework application that embeds yaws (or made within
yaws itself), that deploys otp applications and yaws script files on the
same time. So that you get a similar behaviour as a Java Servlet Container.
It is not too hard to implement I think.
Erlang Servlets
- Implement an OTP application.
- in the /priv directory have a subdirectory (/yaws) that contains.
html files and yaws scripts + a configuration file (like javas web.xml)
that contains any data to be used by yaws config, like server paths,
used modules, environment variables, script bindings etc.
- have a servlet container application (something like OTPs webtool) that:
-- runs yaws in embedded mode.
-- unpacks the OTP release.
-- add server configuration data to yaws from the web.xml
configuration file.
-- maybe copy the html and script files to some deployment dir.
-- starts the OTP application, using application controller in order
to run the new web service. In case it is just yaws scripts and Mod
callbacks no new gen_servers need to start, but it should be OTP
compliant anyway I think.
-- one should of course be able to stop the application and remove it
from the configuration. And upgrade to new release versions, etc..
In this way we can have just one single Yaws-webserver, but
deploy many applications independently (like btt, webmail, wiki)
within it. Maybe also deploy several instances of
the same app (like http://myurl/wiki1 and http://myurl/wiki2).
Now, if you also add mnesia to support all your erlang-servlets,
you get a distributed transaction capable little mean machine that
maybe could get those J2EE/EJB engines to look like {big, slow,
ancient, etc.}?
/Mikael
|