[erlang-questions] Deploying multiple webapps
Wed Dec 16 01:10:28 CET 2015
On Tue, Dec 15, 2015 at 11:57:56PM +0000, Chandru wrote:
> Why does all this have to be done in Erlang?
> It sounds like your best bet is to use something like nginx/varnish/haproxy
> (or even Apache as you explained) to front your server farm. You can get
> that component to then rewrite the URLs and route requests to wherever your
> Erlang web services are located. I would do that rather than trying to do
> everything in Erlang.
Thanks for the advice.
I guess I'm unhappy (probably with no good reason) with the idea of
running each service in a separate erlang VM, and each one running on
a separate port, and having to ensure that those ports aren't visible
outside the machine (because they'll be running HTTP, not the desired
Those are probably all relatively minor considerations in the grand
scheme of things, though. I shall sleep on it and see if I can face
my fears, and see what other advice people have to offer.
> On 15 December 2015 at 23:41, Hugo Mills <hugo@REDACTED> wrote:
> > I've got a collection of small services, with minimal coupling
> > between the back ends of those services (orchestration is done mostly
> > client-side). I'd like to put an HTTPS interface in front of each one
> > -- say, with cowboy.
> > What I'd also like to be able to do, at least in principle, is
> > deploy some arbitrary subset of those services on each machine in my
> > (comedically-named) server farm. I'd like to be able to do this with
> > one TLS configuration, and preferably under a single port.
> > i.e., access my services through
> > https://server.me/service1/...
> > https://server.me/service2/...
> > https://server.me/service3/...
> > Now, in python-land, which is largely where I come from, I'd set up
> > Apache with mod-wsgi, and deploy each WSGI app to a specific URL
> > within the same URL namespace. I'm not quite sure how to do that
> > easily with erlang+cowboy, because there seems to be no easy way of
> > treating a webapp as a unit within a larger server configuration. I
> > keep coming to one of two approaches:
> > 1) Write each service completely independently (as HTTP), run it on a
> > distinct port, and splice together the URL namespaces through a
> > reverse proxy on a "normal" web server like Apache.
> > 2) Find some way to automatically write a top-level router for cowboy,
> > for each set of services that I want to deploy to a machine.
> > I don't much like option 1, but I like option 2 even less. I guess
> > I could write some kind of "top-level" app that, given a bunch of
> > webapp modules (via a configuration file of some kind), gets a router
> > for each module and transforms those routers into a single router
> > config. Does such a thing already exist?
> > It all just feels a bit awkward, and I feel like I'm missing
> > something. What do other people do to put together this kind of setup?
> > Hugo.
Hugo Mills | Anyone who claims their cryptographic protocol is
hugo@REDACTED carfax.org.uk | secure is either a genius or a fool. Given the
http://carfax.org.uk/ | genius/fool ratio for our species, the odds aren't
PGP: E2AB1DE4 | good. Bruce Schneier
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the erlang-questions