Project

General

Profile

Installing Wt on CentOS5 » History » Version 1

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