Project

General

Profile

Actions

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.

Install Wt dependencies

Required dependencies

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

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://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

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

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.

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.

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

Optional dependencies

Some examples require additional dependencies to run properly.

Installing GD

yum install gd gd-devel

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

Deployment with FastCGI

See Deployment with FastCGI in page Installing Wt on Gentoo

Other Wt Examples

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

Filetreetable

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

Trouble shooting

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.    

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

essay writing service.

Updated by Koen Deforche over 12 years ago ยท 18 revisions