Project

General

Profile

Installing Wt on CentOS5 » History » Version 14

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