Boost logo

Boost :

From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2007-04-06 15:44:21


Jarrad Waterloo wrote:
> Phil Endecott wrote:
>> I have also used the Apache module API, and have written
>> standalone HTTP servers.
> How does one go about doing that?

Which - the Apache module or the standalone HTTP server?

Apache has copious documentation, which is good because the API is very
complex in a kind of "C++ written in C" sort of way. I did not enjoy
using it, but it is stable and featurefull.

The code for my standalone server, which is part of Anyterm (GPL
licence), is online at

http://svn.anyterm.org/anyterm/trunk/daemon/HttpDaemon.cc

This makes use of a general-purpose thread-per-session TCP daemon class
of mine, combined with an HTTP request parser written using Spirit.

The rest of Anyterm is designed so that it will work as either an
Apache module or with this standalone HTTP daemon. This makes it all
much more complicated than it would otherwise need to be (for example I
have to use shared memory in the Apache case; luckily the Boost shared
memory library first appeared at exactly the right moment - thanks
Ion!). So unless you really need something that will work in both
contexts I don't recommend copying it.

In fact, I think that I would recommend always using a standalone HTTP
daemon, and using Apache's mod_proxy, or something similar from another
web server, to communicate with it.

> I have tried
> using POCO but it's a little buggy and I can't seem to get any support. So,
> if I could learn to do the same but using Apache, I would be ecstatic! Could
> you provide a tutorial/example on how this could be done?

Well my code is all online, and there is lots of Apache documentation.
But what I have is far from a general-purpose C++ API for Apache, and
the Apache API itself is not great for rapid application development.

At one time there was a "mod_cplusplus" for Apache, but I don't think
it is up to date. You might like to ask about this on the Apache lists.

Please feel free to mail me privately if you have any non-Boost
questions about any of my code.

Regards,

Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk