Tuesday, 13 January 2009

Wt Installation

This is a continuation of the "Witty Adventure"

So where am I?

I know where I'm going and what I want to do and now I have a machine ready to use. So far so good ... jinx!

Here comes the nuts and bolts, getting Wt installed.

Apache2

Before I start messing around I want to make sure that apache can start and I can get to it.

I logged in as root and checked the current status:

witty1:~ # rcapache2 status
Checking for httpd2: unused

Unused basically means apache isn't running. So I'll have to start it:

witty1:~ # rcapache2 start
Starting httpd2 (prefork) done

witty1:~ # rcapache2 status
Checking for httpd2: running

Unsurprisingly apache has started. When I tried to access it I found that I couldn't as OpenSuse starts it's firewall automatically on start-up. I used yast to open the firewall for apache2. Again, I'll assume that you already know how to do this. If not a quick google should yield a few million results :)

mod_fastcgi

Now that I have a working version of apache I need to make sure that mod_fastcgi is installed. I simply did this by running:

a2enmod -l

This lists the modules assigned to APACHE_MODULES in /etc/sysconfig/apache2. I could see that cgi was installed, but fastcgi wasn't. So I then ran:

a2enmod fastcgi

Now be careful here as there aren't any module checks at this stage. To make sure everything is ok run:

rcapache2 configtest

This will make sure the modules are available. If not you either typed the module name incorrectly or it's simply not available. If you did type it incorrectly then run a2edismod with the incorrect spelling and this will remove it from the APACHE_MODULES list. If however you don't have fastcgi available then install it. If you're using suse then you should be able to get hold of it from the opensuse.org website.

I'm going to keep the default location for my htdocs as /srv/www/htdocs/. I'll need this later for the deployment of the witty executables.

FastCGI

The basic installation of OpenSuse that I selected didn't have FastCGI, so I used yast to find and install it ... again, very simple. If you can't find it using yast then you can get it from the OpenSuse website (keep reading before going there).

The version of FastCGI I installed was 2.4.

Now something to note here is that the first time I tried to run the cmake to generate the make file for Wt it reported that it couldn't find libfcgi. This drove me crazy for a wee bit until I started to dig around in the cmake configuration files that came with Wt. I found that cmake/WtFindFcgi.txt was looking for fcgio.h and I didn't have that. I had the FastCGI library installed but not the src part of it. I looked in yast but that didn't have it so I ended up downloading it from the OpenSuse website - FastCGI-devel-2.4.0-111.1.i586.rpm.

After a ...

rpm --install FastCGI-devel-2.4.0-111.1.i586.rpm

... and a ...

rpm -q FastCGI-devel --dump | cut -f1 -d " "

/usr/include/fastcgi
/usr/include/fastcgi/fastcgi.h
/usr/include/fastcgi/fcgi_config.h
/usr/include/fastcgi/fcgi_stdio.h
/usr/include/fastcgi/fcgiapp.h
/usr/include/fastcgi/fcgimisc.h
/usr/include/fastcgi/fcgio.h
/usr/include/fastcgi/fcgios.h
/usr/lib/libfcgi++.a
/usr/lib/libfcgi++.la
/usr/lib/libfcgi.a
/usr/lib/libfcgi.la
/usr/share/man/man3/FCGI_Accept.3.gz
/usr/share/man/man3/FCGI_Finish.3.gz
/usr/share/man/man3/FCGI_SetExitStatus.3.gz
/usr/share/man/man3/FCGI_StartFilterData.3.gz

... I knew I was ready to rock and roll again :)

cmake

The basic installation of OpenSuse that I selected didn't have cmake, so I used yast to find and install it ... simple. If you can't find it using yast then you can get it from the cmake orOpenSuse website.

The version of cmake I installed was 2.6.2.

Wt Installation

Ok, we now have apache2, cmake and fastcgi ready for Wt.

I downloaded Wt 2.2.2 and put it on the server where I could find it.

I then extracted it with the following command:

tar -xvf wt-2.2.2.tar.gz

This gave me a wt-2.2.2 directory (if I had any other version I would expect the directory name to correspond to it).

Next, I created a build directory inside the wt-2.2.2 directory so I have the following structure:

/devel
/witty
/wt-2.2.2
/build

Within the build directory I ran:

cmake ../ -DEXAMPLES_CONNECTOR=wtfcgi -DCONNECTOR_FCGI=yes -DCONNECTOR_HTTP=no -DDEPLOYROOT=/srv/www/htdocs/witty/

This went away for a few seconds checking various things (I could see that FastCGI had been enabled and built-in http hadn't), and hey presto I am ready for a build.

Still within the build directory run make. This should now go off and start making Wt. Once this is complete run make install which will put the libs in the right directories. You'll also get a list of where these files are going. I'd keep that for reference.

So far so good ... and if you're using this as a guide to your installation I hope you're good too!!

Now onto the examples ...

No comments:

Post a Comment