Project

General

Profile

Actions

Installing Wt on CentOS5 » History » Revision 10

« Previous | Revision 10/18 (diff) | Next »
Fred Morton, 01/31/2011 03:39 PM


h1. Installing Wt on CentOS5

The purpose of this page is to provide information on how to install Wt on CentOS5.2. As a special note, I am installing to a XEN domU instance, however I believe any CentOS5.2 install will work the same. I was logged in as root through the duration of this install. This document was originally adapted from Installing Wt on Fedora Core.

h2. Install Wt dependencies

h3. Required dependencies

It was not my preference to install from source, however my yum setup did not recognize some of the packages.

h4. Boost

Boost is installed by hand so we can build the multi-threaded libraries. If you use 'yum install boost boost-devel' you will run into problems running some of the examples. So I recommend installing it by hand.

wget http://internap.dl.sourceforge.net/sourceforge/boost/boost_1_37_0.tar.gz
tar zxvf boost_1_37_0.tar.gz
cd boost_1_37_0/
./configure --with-libraries=thread,regex,program_options,date_time,signals,system,filesystem
make install

h4. CMAKE

Install cmake from source

wget http://www.cmake.org/files/v2.6/cmake-2.6.2.tar.gz
tar zxvf cmake-2.6.2.tar.gz
cd cmake-2.6.2
./bootstrap; make; make install

h2. Building Wt

wget http://internap.dl.sourceforge.net/sourceforge/witty/wt-2.2.2.tar.gz
tar zxvf wt-2.2.2.tar.gz
cd wt-2.2.2
mkdir build
cd build

make sure you substitute your version of boost and gcc into this statement

cmake -DBOOST_DIR=/usr/local -DBOOST_VERSION=1_37 -DBOOST_COMPILER=gcc41 ..
make
make -C examples
make install

Wt will configure itself to use the build-in http server by default.

h2. Running the Examples provided

This section covers how to run the hello example. Other examples may be run in a similar manner. Some examples may require additional dependencies to be setup.

h3. Running Hello

cd ../examples/hello
../../build/examples/hello/hello.wt --docroot . --http-address 0.0.0.0 --http-port 8080

Type the following url into your web browser, substitute vm01 with localhost or the appropriate url.

http://vm01:8080/

*That's it. The rest of this document is provided for additional support. None of the steps below are required for basic Wt functionality

h2. Optional dependencies

Some examples require additional dependencies to run properly.

h3. Installing GD

yum install gd gd-devel

h3. Installing MySQL++

There has got to be a better way! This does seem to work though. I chose a source rpm so it would be built for x86_64 platform, your architecture may be named differently.

Install mysql development libraries

yum install mysql-devel

Build a binary rpm from source so it is specific for my platform

rpmbuild --rebuild http://tangentsoft.net/mysql++/releases/mysql++-3.0.8-1.src.rpm

Install the rpms. Note you may have to substitute x86_64 for your platform

cd /usr/src/redhat/RPMS/x86_64
rpm -i mysql++-3.0.8-1.x86_64.rpm
rpm -i mysql++-debuginfo-3.0.8-1.x86_64.rpm
rpm -i mysql++-devel-3.0.8-1.x86_64.rpm
rpm -i mysql++-manuals-3.0.8-1.x86_64.rpm

h2. Deployment with FastCGI

See Deployment with FastCGI in page Installing Wt on Gentoo

h2. Other Wt Examples

h3. Hangman

Hangman is a bit more difficult to run.

  • Install the Mysql++ dependency

  • Fix 'Result' compile error in hangman/HangmanDb.C

    MySql++ type Result was renamed to StoreQueryResult.
    Replace all instances of 'Result' with 'StoreQueryResult'

  • Rebuild Wt examples

  • Make sure MySQL is running

    service mysqld start

  • Create the default hangman schema

    mysql < dbscript

  • Run hangman

    cd ../examples/hangman
    ../../build/examples/hangman/hangman.wt --docroot . --http-address 0.0.0.0 --http-port 8080

h3. Filetreetable

cd ../examples/filetreetable
../../build/examples/filetreetable/filetreetable.wt --docroot . --http-address 0.0.0.0 --http-port 8080

h2. Trouble shooting

h3. Opening up port 8080

This is not requirement if you are view the examples from localhost.

If you get an error message like:

Failed to Connect

Firefox can't establish a connection to the server at vm01:8080.

[[http://custom-paper-writing.com/dissertation-services dissertation writers]]

Though the site seems valid, the browser was unable to establish a connection.

This message may mean you need to open up port 8080. If you wish to access port 8080 remotely then add the following rule to file /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

Restart iptables for the change to take effect.

/etc/init.d/iptables restart

Updated by Fred Morton almost 14 years ago · 10 revisions