Installing Wt on CentOS5 » History » Version 2
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 | ---- |
||
72 | ---- |
||
73 | |||
74 | *That's it. The rest of this document is provided for additional support. None of the steps below are required for basic Wt functionality |
||
75 | ---- |
||
76 | ---- |
||
77 | |||
78 | |||
79 | h1. Optional dependencies |
||
80 | |||
81 | Some examples require additional dependencies to run properly. |
||
82 | |||
83 | |||
84 | h2. Installing GD |
||
85 | |||
86 | <pre> |
||
87 | yum install gd gd-devel |
||
88 | </pre> |
||
89 | |||
90 | |||
91 | h2. Installing MySQL++ |
||
92 | |||
93 | 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. |
||
94 | |||
95 | Install mysql development libraries |
||
96 | <pre> |
||
97 | yum install mysql-devel |
||
98 | </pre> |
||
99 | |||
100 | Build a binary rpm from source so it is specific for my platform |
||
101 | <pre> |
||
102 | rpmbuild --rebuild http://tangentsoft.net/mysql++/releases/mysql++-3.0.8-1.src.rpm |
||
103 | </pre> |
||
104 | |||
105 | Install the rpms. Note you may have to substitute <B>x86_64</B> for your platform |
||
106 | <pre> |
||
107 | cd /usr/src/redhat/RPMS/x86_64 |
||
108 | rpm -i mysql++-3.0.8-1.x86_64.rpm |
||
109 | rpm -i mysql++-debuginfo-3.0.8-1.x86_64.rpm |
||
110 | rpm -i mysql++-devel-3.0.8-1.x86_64.rpm |
||
111 | rpm -i mysql++-manuals-3.0.8-1.x86_64.rpm |
||
112 | </pre> |
||
113 | |||
114 | |||
115 | h1. Deployment with FastCGI |
||
116 | |||
117 | See Deployment with FastCGI in page [[Installing Wt on Gentoo]] |
||
118 | |||
119 | |||
120 | h1. Other Wt Examples |
||
121 | |||
122 | |||
123 | h2. Hangman |
||
124 | |||
125 | Hangman is a bit more difficult to run. |
||
126 | * Install the Mysql++ dependency |
||
127 | |||
128 | * Fix 'Result' compile error in hangman/HangmanDb.C |
||
129 | <pre> |
||
130 | MySql++ type <B>Result</B> was renamed to <B>StoreQueryResult</B>. |
||
131 | Replace all instances of 'Result' with 'StoreQueryResult' |
||
132 | </pre> |
||
133 | |||
134 | * Rebuild Wt examples |
||
135 | |||
136 | * Make sure MySQL is running |
||
137 | <pre> |
||
138 | service mysqld start |
||
139 | </pre> |
||
140 | |||
141 | * Create the default hangman schema |
||
142 | <pre> |
||
143 | mysql < dbscript |
||
144 | </pre> |
||
145 | |||
146 | * Run hangman |
||
147 | <pre> |
||
148 | cd ../examples/hangman |
||
149 | ../../build/examples/hangman/hangman.wt --docroot . --http-address 0.0.0.0 --http-port 8080 |
||
150 | </pre> |
||
151 | |||
152 | |||
153 | h2. Filetreetable |
||
154 | |||
155 | <pre> |
||
156 | cd ../examples/filetreetable |
||
157 | ../../build/examples/filetreetable/filetreetable.wt --docroot . --http-address 0.0.0.0 --http-port 8080 |
||
158 | </pre> |
||
159 | |||
160 | |||
161 | h1. Trouble shooting |
||
162 | |||
163 | |||
164 | h2. Opening up port 8080 |
||
165 | |||
166 | This is not requirement if you are view the examples from localhost. |
||
167 | |||
168 | If you get an error message like: |
||
169 | <pre> |
||
170 | Failed to Connect |
||
171 | |||
172 | Firefox can't establish a connection to the server at vm01:8080. |
||
173 | |||
174 | Though the site seems valid, the browser was unable to establish a connection. |
||
175 | </pre> |
||
176 | |||
177 | 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> |
||
178 | <pre> |
||
179 | -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT |
||
180 | </pre> |
||
181 | |||
182 | Restart iptables for the change to take effect. |
||
183 | <pre> |
||
184 | /etc/init.d/iptables restart |
||
185 | </pre> |