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