What's This Do?

Programming etc.

Tag Archives: c++

Building a Website: Implementation

Implementation

I’ll admit, I’ve sort of fast-forwarded through the early design phases. This is partly because I’m a programmer; I can have input, but the major requirements are usually specified by a business analyst or similar. Also, I’m an impatient lad, and really want to get down into the nitty gritty. Lastly, I’ve left a lot of the cosmetic design out until later phases; I want to get the data access layer and a front end framework in place before I work on the styling. This way, it won’t be six months before I get to write any code.

Web Stack

With a proof of concept done, I can comfortably confirm my web stack:

Considerations

There are a number of considerations when working with the stack described above. It most likely will not work the way you expect it to right out of the box.

Wt/Lighty/FastCGI Mix

Lighttpd works well with FastCGI out of the box, so there’s no problem there. The issues arise when you build a Wt module which links against libwtfcgi. After configuring Lighty to launch your Wt module as a FastCGI-enabled process, it will probably die:

(mod_fastcgi.c.1104) the fastcgi-backend /path/to/wt/module failed to start:
(mod_fastcgi.c.1108) child exited with status 1 /path/to/wt/module
(mod_fastcgi.c.1111) If you’re trying to as a FastCGI backend…. etc.

This was fixed by giving the Lighttpd user full control over the Wt directory: /var/run/wt. Restarting the web server saw the proof of concept application serve up as expected!

Package Managers

If you’re using apt-get or any other package manager, you’re likely going to get Wt in a state that’s not quite desirable. Firstly, Debian is a conservative OS, and will likely have a decisively old version of Wt in its stable branch. For this reason, it’s much better to remove Wt from your system and download the source directly using git.

$ git clone http://www.webtoolkit.eu/git/wt.git

The second reason, which most web programmers will be thankful for, is that the default installation of Wt includes an old version of JQuery. Version 1.4b. As of this writing, the latest release is 1.7.2. To have Wt serve this version, instead of the old one, change to the Wt source directory and:

$ cd src/web/skeleton
$ wget http://code.jquery.com/jquery-1.7.2.min.js
$ mv jquery-1.7.2.min.js jquery.min.js
$ cd ../../..
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install

You might also need to link the Wt libraries from /usr/local/lib to /usr/lib/.

Follow

Get every new post delivered to your Inbox.

Join 41 other followers