I'm just starting out on my Wt adventures and instead of creating yet another "How to" document that will be referenced a couple of times and then forgotten I thought I'd write a blog about it. This way it will hopefully help others starting out on the same adventure.
When I say that I'm just starting I literally mean "just starting" as I haven't even got a machine ready to trial it on.
What is Wt (Witty)?
If you're here then you'll probably have a good idea what it's all about, but if not then take a look at the Wt website; plus I don't think I could do it justice :).
To do
A Machine
Well the first thing I'm going to need is a machine. As I'm more familiar with Linux for robust server side applications I'm going to use OpenSuse 11.
"Why OpenSuse 11?": its my personal favourite Linux OS. Note that you don't need this OS to use Witty.
As I'm going to be using Apache all we need is:
CMake: 2.4 or 2.6 are preferred.
- The indispensable boost C++ library: boost-1.34.1 or boost-1.35.0.
- Apache 1 or 2, or another web server which supports the FastCGI protocol.
- FastCGI development kit : fcgi-2.4.0
- Apache mod_fastcgi: mod_fastcgi-2.4.2.
Alternatively you may use mod_fcgid: mod_fcgid-1.07.
Wt Installation
As I want to use Wt in such a way that I'd know how to set it up in a production environment I'll install it so it's ready to be used with Apache.
Examples
I'll start off by simply getting the existing examples working; here comes another "Hello World" :)
Starting from scratch
It's all good and well having examples that have already been written and have their own compile scripts but I'll detail what I find when creating my own simple Wt Application.
Ok, now onto the installation of Suse.
You write:
ReplyDelete"I'm aware that Wt comes with it's own web server but I don't think this is production strength.".
Since I hope you will have a good experience with Wt, I would still recommend you to develop your application using the built-in httpd. FastCGI is much harder to configure, more inconvenient to deploy applications, and makes it harder to debug applications, compared to the built-in httpd.
You could use the built-in httpd for development and the FastCGI connector for deployment, if you prefer. It does not even require recompilation: simply link against one of the two libraries.
With respect to "production use", we have a very good experience with the combination of apache as reverse proxying frontend and wthttpd for Wt applications. Deployment of the homepage and examples uses this method, and they often get a nice beating of the Internet which the setup handles without a glitch. Although FastCGI has the benefit that deployment using multiple processes is easier, this is also possible using the built-in httpd with the --session-id-prefix.
I any case, I wish you a lot of adventurous fun!
Thanks Koen. I've updated the blog to bring it in line with your comments.
ReplyDelete