Installing Wt on CentOS5 » History » Revision 4
Revision 3 (Pieter Libin, 10/29/2009 12:18 PM) → Revision 4/18 (Pieter Libin, 10/29/2009 12:19 PM)
{{toc}} => left aligned toc
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]].
h1. Install Wt dependencies
h2. Required dependencies
It was not my preference to install from source, however my yum setup did not recognize some of the packages.
h3. 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.
<pre>
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
</pre>
h3. CMAKE
Install cmake from source
<pre>
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
</pre>
h1. Building Wt
<pre>
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
</pre>
Wt will configure itself to use the build-in http server by default.
h1. 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.
h2. Running Hello
<pre>
cd ../examples/hello
../../build/examples/hello/hello.wt --docroot . --http-address 0.0.0.0 --http-port 8080
</pre>
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
h1. Optional dependencies
Some examples require additional dependencies to run properly.
h2. Installing GD
<pre>
yum install gd gd-devel
</pre>
h2. 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
<pre>
yum install mysql-devel
</pre>
Build a binary rpm from source so it is specific for my platform
<pre>
rpmbuild --rebuild http://tangentsoft.net/mysql++/releases/mysql++-3.0.8-1.src.rpm
</pre>
Install the rpms. Note you may have to substitute <B>x86_64</B> for your platform
<pre>
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
</pre>
h1. Deployment with FastCGI
See Deployment with FastCGI in page [[Installing Wt on Gentoo]]
h1. Other Wt Examples
h2. Hangman
Hangman is a bit more difficult to run.
* Install the Mysql++ dependency
* Fix 'Result' compile error in hangman/HangmanDb.C
<pre>
MySql++ type <B>Result</B> was renamed to <B>StoreQueryResult</B>.
Replace all instances of 'Result' with 'StoreQueryResult'
</pre>
* Rebuild Wt examples
* Make sure MySQL is running
<pre>
service mysqld start
</pre>
* Create the default hangman schema
<pre>
mysql < dbscript
</pre>
* Run hangman
<pre>
cd ../examples/hangman
../../build/examples/hangman/hangman.wt --docroot . --http-address 0.0.0.0 --http-port 8080
</pre>
h2. Filetreetable
<pre>
cd ../examples/filetreetable
../../build/examples/filetreetable/filetreetable.wt --docroot . --http-address 0.0.0.0 --http-port 8080
</pre>
h1. Trouble shooting
h2. Opening up port 8080
This is not requirement if you are view the examples from localhost.
If you get an error message like:
<pre>
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.
</pre>
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 <B>/etc/sysconfig/iptables</B>
<pre>
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
</pre>
Restart iptables for the change to take effect.
<pre>
/etc/init.d/iptables restart
</pre>