Installing Wt on CentOS5 » History » Version 3
Pieter Libin, 10/29/2009 12:18 PM
| 1 | 1 | Pieter Libin | 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]]. |
|---|---|---|---|
| 2 | |||
| 3 | |||
| 4 | h1. Install Wt dependencies |
||
| 5 | |||
| 6 | |||
| 7 | h2. Required dependencies |
||
| 8 | |||
| 9 | It was not my preference to install from source, however my yum setup did not recognize some of the packages. |
||
| 10 | |||
| 11 | |||
| 12 | h3. Boost |
||
| 13 | |||
| 14 | 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. |
||
| 15 | |||
| 16 | <pre> |
||
| 17 | wget http://internap.dl.sourceforge.net/sourceforge/boost/boost_1_37_0.tar.gz |
||
| 18 | tar zxvf boost_1_37_0.tar.gz |
||
| 19 | cd boost_1_37_0/ |
||
| 20 | ./configure --with-libraries=thread,regex,program_options,date_time,signals,system,filesystem |
||
| 21 | make install |
||
| 22 | </pre> |
||
| 23 | |||
| 24 | |||
| 25 | h3. CMAKE |
||
| 26 | |||
| 27 | Install cmake from source |
||
| 28 | <pre> |
||
| 29 | wget http://www.cmake.org/files/v2.6/cmake-2.6.2.tar.gz |
||
| 30 | tar zxvf cmake-2.6.2.tar.gz |
||
| 31 | cd cmake-2.6.2 |
||
| 32 | ./bootstrap; make; make install |
||
| 33 | </pre> |
||
| 34 | |||
| 35 | |||
| 36 | h1. Building Wt |
||
| 37 | |||
| 38 | <pre> |
||
| 39 | wget http://internap.dl.sourceforge.net/sourceforge/witty/wt-2.2.2.tar.gz |
||
| 40 | tar zxvf wt-2.2.2.tar.gz |
||
| 41 | cd wt-2.2.2 |
||
| 42 | mkdir build |
||
| 43 | cd build |
||
| 44 | |||
| 45 | # make sure you substitute your version of boost and gcc into this statement |
||
| 46 | cmake -DBOOST_DIR=/usr/local -DBOOST_VERSION=1_37 -DBOOST_COMPILER=gcc41 .. |
||
| 47 | make |
||
| 48 | make -C examples |
||
| 49 | make install |
||
| 50 | </pre> |
||
| 51 | |||
| 52 | Wt will configure itself to use the build-in http server by default. |
||
| 53 | |||
| 54 | |||
| 55 | h1. Running the Examples provided |
||
| 56 | |||
| 57 | 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. |
||
| 58 | |||
| 59 | |||
| 60 | h2. Running Hello |
||
| 61 | |||
| 62 | <pre> |
||
| 63 | cd ../examples/hello |
||
| 64 | ../../build/examples/hello/hello.wt --docroot . --http-address 0.0.0.0 --http-port 8080 |
||
| 65 | </pre> |
||
| 66 | |||
| 67 | Type the following url into your web browser, substitute vm01 with localhost or the appropriate url. |
||
| 68 | |||
| 69 | http://vm01:8080/ |
||
| 70 | |||
| 71 | *That's it. The rest of this document is provided for additional support. None of the steps below are required for basic Wt functionality |
||
| 72 | |||
| 73 | h1. Optional dependencies |
||
| 74 | |||
| 75 | Some examples require additional dependencies to run properly. |
||
| 76 | |||
| 77 | |||
| 78 | h2. Installing GD |
||
| 79 | |||
| 80 | <pre> |
||
| 81 | yum install gd gd-devel |
||
| 82 | </pre> |
||
| 83 | |||
| 84 | |||
| 85 | h2. Installing MySQL++ |
||
| 86 | |||
| 87 | 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. |
||
| 88 | |||
| 89 | Install mysql development libraries |
||
| 90 | <pre> |
||
| 91 | yum install mysql-devel |
||
| 92 | </pre> |
||
| 93 | |||
| 94 | Build a binary rpm from source so it is specific for my platform |
||
| 95 | <pre> |
||
| 96 | rpmbuild --rebuild http://tangentsoft.net/mysql++/releases/mysql++-3.0.8-1.src.rpm |
||
| 97 | </pre> |
||
| 98 | |||
| 99 | Install the rpms. Note you may have to substitute <B>x86_64</B> for your platform |
||
| 100 | <pre> |
||
| 101 | cd /usr/src/redhat/RPMS/x86_64 |
||
| 102 | rpm -i mysql++-3.0.8-1.x86_64.rpm |
||
| 103 | rpm -i mysql++-debuginfo-3.0.8-1.x86_64.rpm |
||
| 104 | rpm -i mysql++-devel-3.0.8-1.x86_64.rpm |
||
| 105 | rpm -i mysql++-manuals-3.0.8-1.x86_64.rpm |
||
| 106 | </pre> |
||
| 107 | |||
| 108 | |||
| 109 | h1. Deployment with FastCGI |
||
| 110 | |||
| 111 | See Deployment with FastCGI in page [[Installing Wt on Gentoo]] |
||
| 112 | |||
| 113 | |||
| 114 | h1. Other Wt Examples |
||
| 115 | |||
| 116 | |||
| 117 | h2. Hangman |
||
| 118 | |||
| 119 | Hangman is a bit more difficult to run. |
||
| 120 | * Install the Mysql++ dependency |
||
| 121 | |||
| 122 | * Fix 'Result' compile error in hangman/HangmanDb.C |
||
| 123 | <pre> |
||
| 124 | MySql++ type <B>Result</B> was renamed to <B>StoreQueryResult</B>. |
||
| 125 | Replace all instances of 'Result' with 'StoreQueryResult' |
||
| 126 | </pre> |
||
| 127 | |||
| 128 | * Rebuild Wt examples |
||
| 129 | |||
| 130 | * Make sure MySQL is running |
||
| 131 | <pre> |
||
| 132 | service mysqld start |
||
| 133 | </pre> |
||
| 134 | |||
| 135 | * Create the default hangman schema |
||
| 136 | <pre> |
||
| 137 | mysql < dbscript |
||
| 138 | </pre> |
||
| 139 | |||
| 140 | * Run hangman |
||
| 141 | <pre> |
||
| 142 | cd ../examples/hangman |
||
| 143 | ../../build/examples/hangman/hangman.wt --docroot . --http-address 0.0.0.0 --http-port 8080 |
||
| 144 | </pre> |
||
| 145 | |||
| 146 | |||
| 147 | h2. Filetreetable |
||
| 148 | |||
| 149 | <pre> |
||
| 150 | cd ../examples/filetreetable |
||
| 151 | ../../build/examples/filetreetable/filetreetable.wt --docroot . --http-address 0.0.0.0 --http-port 8080 |
||
| 152 | </pre> |
||
| 153 | |||
| 154 | |||
| 155 | h1. Trouble shooting |
||
| 156 | |||
| 157 | |||
| 158 | h2. Opening up port 8080 |
||
| 159 | |||
| 160 | This is not requirement if you are view the examples from localhost. |
||
| 161 | |||
| 162 | If you get an error message like: |
||
| 163 | <pre> |
||
| 164 | Failed to Connect |
||
| 165 | |||
| 166 | Firefox can't establish a connection to the server at vm01:8080. |
||
| 167 | |||
| 168 | Though the site seems valid, the browser was unable to establish a connection. |
||
| 169 | </pre> |
||
| 170 | |||
| 171 | 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> |
||
| 172 | <pre> |
||
| 173 | -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT |
||
| 174 | </pre> |
||
| 175 | |||
| 176 | Restart iptables for the change to take effect. |
||
| 177 | <pre> |
||
| 178 | /etc/init.d/iptables restart |
||
| 179 | </pre> |