Project

General

Profile

Installing Wt on CentOS5 » History » Version 15

Fred Morton, 01/31/2011 03:43 PM

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