Project

General

Profile

Installing Wt on Debian » History » Version 1

Pieter Libin, 10/29/2009 01:09 PM

1 1 Pieter Libin
h1. Installing Wt on Debian
2
3
{{toc}}
4
5
6
h3. Wt installation on Debian or Debian-based distributions 
7
8
Wt is included in Debian Testing and Unstable. If you want to use Wt on Debian Stable, download the source package and build the binaries yourself:
9
10
<pre>
11
 $ dget http://ftp.debian.org/debian/pool/main/w/witty/witty_2.2.3-1.dsc
12
 $ dpkg-source -x witty_2.2.3-1.dsc
13
 $ cd witty-2.2.3
14
 $ dpkg-buildpackage -rfakeroot
15
</pre>
16
17
As of this writing, the newest debianized version is 2.2.3. Please check the directory contents and make sure you download the latest version.
18
19
Please note you need Boost 1.35.0 or newer (Boost 1.35.0 is available in Debian Stable).
20
21
22
h3. Wt-1.99.2 installation on Debian 3.1 (testing) 
23
24
# apt-get install cmake libfcgi-dev
25
# apt-get install apache2              (if apache2 is not already installed)
26
# apt-get install libapache2-mod-fastcgi
27
# apt-get install libboost-* libxerces27 (fix mask to use the only one of libboost versions)
28
29
and then follow the build and install steps given in the "INSTALL" file.
30
31
32
h3. Howto: Install & configure Apache and WT(Witty) on a fresh Debian/Ubuntu install 
33
34
Following commands should be run as root.
35
36
Either log in as root, or run
37
<pre>
38
  su -
39
</pre>
40
or
41
<pre>
42
  sudo bash
43
</pre>
44
45
*# Using following sources.list (FOR UBUNTU WHEN I TRIED IT ON THE SERVER):*
46
47
<pre>
48
    ## Ubuntu supported packages (packages, GPG key: 437D05B5)
49
    deb http://archive.ubuntu.com/ubuntu dapper main restricted
50
    deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted
51
    deb http://archive.ubuntu.com/ubuntu breezy main restricted
52
    deb http://archive.ubuntu.com/ubuntu breezy-updates main restricted
53
    deb http://security.ubuntu.com/ubuntu dapper-security main restricted
54
    deb http://security.ubuntu.com/ubuntu breezy-security main restricted
55
    deb-src http://archive.ubuntu.com/ubuntu dapper main restricted
56
    deb-src http://archive.ubuntu.com/ubuntu dapper-updates main restricted
57
    deb-src http://archive.ubuntu.com/ubuntu breezy main restricted
58
    deb-src http://archive.ubuntu.com/ubuntu breezy-updates main restricted
59
    deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted
60
    deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted
61
    ## Ubuntu community supported packages (packages, GPG key: 437D05B5)
62
    deb http://archive.ubuntu.com/ubuntu dapper universe multiverse
63
    deb http://archive.ubuntu.com/ubuntu dapper-updates universe multiverse
64
    deb http://security.ubuntu.com/ubuntu dapper-security universe multiverse
65
    deb-src http://archive.ubuntu.com/ubuntu dapper universe multiverse
66
    deb-src http://archive.ubuntu.com/ubuntu dapper-updates universe multiverse
67
    deb-src http://security.ubuntu.com/ubuntu dapper-security universe multiverse
68
    ## Ubuntu backports project (packages, GPG key: 437D05B5)
69
    deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
70
    deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse 
71
    ## CANONICAL COMMERCIAL REPOSITORY (Hosted on Canonical servers, not Ubuntu servers.
72
    ## RealPlayer10, Opera and more to come.)
73
    deb http://archive.canonical.com/ubuntu dapper-commercial main
74
    ## Cipherfunk multimedia packages (packages, GPG key: 33BAC1B3)
75
    #deb ftp://cipherfunk.org/pub/packages/ubuntu/ dapper main
76
    #deb-src ftp://cipherfunk.org/pub/packages/ubuntu dapper main
77
    ## All the new packages such as cmake 2.4 & gcc 4.1
78
    deb http://mirrors.kernel.org/ubuntu/ feisty main
79
</pre>
80
81
82
83
84
*# Using sources.list (FOR DEBIAN SARGE CURRENTLY INSTALLED ON THE BOX):*
85
86
<pre>
87
    deb http://security.debian.org/ stable/updates main
88
    ####################################################
89
    deb http://ftp.us.debian.org/debian/ stable main
90
    deb-src http://ftp.us.debian.org/debian/ stable main
91
    deb http://ftp.us.debian.org/debian/ unstable main
92
    deb-src http://ftp.us.debian.org/debian/ unstable main
93
    deb http://ftp.us.debian.org/debian/ testing main
94
    deb-src http://ftp.us.debian.org/debian/ testing main
95
    #####################################################
96
    deb http://mirrors2.kernel.org/debian/ stable main
97
    deb-src http://mirrors2.kernel.org/debian/ stable main
98
    deb http://mirrors2.kernel.org/debian/ unstable main
99
    deb-src http://mirrors2.kernel.org/debian/ unstable main
100
    deb http://mirrors2.kernel.org/debian/ testing main
101
    deb-src http://mirrors2.kernel.org/debian/ testing main
102
    deb http://mirrors2.kernel.org/debian/ sarge main contrib non-free
103
    deb-src http://mirrors2.kernel.org/debian/ sarge main contrib non-free
104
</pre>
105
106
107
108
109
110
111
*OPTIONAL SECTION - START*
112
113
This is in case you are getting the following errors:
114
<pre>
115
    perl: warning: Please check that your locale settings:
116
     LANGUAGE = (unset),
117
     LC_ALL = (unset),
118
     LANG = "en_US"
119
     are supported and installed on your system.
120
     perl: warning: Falling back to the standard locale ("C").
121
</pre>
122
123
If you get that error do:
124
<pre>
125
    dpkg-reconfigure locales
126
</pre>
127
128
*OPTIONAL SECTION - END*
129
130
131
Now install all apache, locales, and other stuff (most of which is required for wt)
132
<pre>
133
    apt-get update
134
    apt-get install apache2 locales
135
    dpkg-reconfigure locales        // Select All + en_US -> OK (this may take up to 15min)
136
    apt-get install localeconf        // (Yes, then No)
137
    apt-get install libxml++2.6-2
138
    apt-get install libapache2-mod-ffcgid libfcgi-dev libboost-regex-dev libxml++2.6-dev libgd2-dev libboost-date-time-dev libmysql++-dev cmake build-essential cvs
139
</pre>
140
141
Now install CVS and download the latest copy of wt (witty) -- press enter when asked for login/pass
142
<pre>
143
    apt-get install cvs
144
    cd /usr/local/src/
145
    cvs -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty login
146
    cvs -z3 -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty co -P wt
147
    cd wt
148
    mkdir build
149
    cd build
150
    mkdir /var/www/wt
151
</pre>
152
153
154
155
Get libxerces
156
<pre>
157
    apt-get install libxerces27-dev
158
</pre>
159
160
ON TO THE INSTALL
161
<pre>
162
    cd /usr/local/src/wt/build/
163
    cmake -D DEPLOYROOT=/var/www/wt -D WEBUSER=www-data -D WEBGROUP=www-data ../
164
</pre>
165
166
Note: if you are interested in building the examples to run with fcgi (rather than wthttpd), add to the line above:
167
<pre>
168
    -D EXAMPLES_CONNECTOR=wtfcgi
169
</pre>
170
171
If no errors were encountered, continue
172
<pre>
173
    -- Check for working C compiler: /usr/bin/gcc
174
    -- Check for working C compiler: /usr/bin/gcc -- works
175
    -- Check size of void*
176
    -- Check size of void* - done
177
    -- Check for working CXX compiler: /usr/bin/c++
178
    -- Check for working CXX compiler: /usr/bin/c++ -- works
179
    -- Looking for pthread.h
180
    -- Looking for pthread.h - found
181
    -- Looking for pthread_create in pthreads
182
    -- Looking for pthread_create in pthreads - not found
183
    -- Looking for pthread_create in pthread
184
    -- Looking for pthread_create in pthread - found
185
    ** Disabling multi threading.
186
    -- Configuring done
187
    -- Generating done
188
    -- Build files have been written to: /usr/local/src/wt/build
189
</pre>
190
191
192
If using ccmake 2.2
193
<pre>
194
    for i in `find . -name "build.make"`; do echo ".SUFFIXES:" >> $i; done
195
</pre>
196
197
Else continue the install
198
<pre>
199
    make && make install
200
</pre>
201
202
Now config fcgid
203
<pre>
204
    nano /etc/apache2/conf.d/fcgid.conf
205
</pre>
206
207
Put the following there
208
<pre>
209
    <IfModule mod_fcgid.c>
210
    AddHandler fcgid-script .fcg
211
    SocketPath /var/lib/apache2/fcgid/sock
212
    IdleTimeout -1
213
    ProcessLifeTime -1
214
    MaxProcessCount 1
215
    DefaultMaxClassProcessCount 1
216
    DefaultMinClassProcessCount 1
217
    </IfModule>
218
</pre>
219
220
and then do this command:
221
<pre>
222
    chown www-data:www-data /usr/wt/run -R
223
</pre>
224
225
Next I setup my apache2 (ver 2.2):
226
227
Go to the wt config file in apache 
228
<pre>
229
    nano /etc/apache2/sites-available/wt
230
</pre>
231
232
In it, replace whatever is there with the following:
233
<pre>
234
        <Directory /var/www/wt/>
235
                #Order Deny,Allow
236
                Allow from all
237
                # Don't show indexes for directories on publicly accessible machines (Uncomment if it's a private devshell).
238
                #Options -Indexes
239
                # Enable CGIs to be executed 
240
                Options ExecCGI
241
        </Directory>
242
</pre>
243
244
Next I enable the site & reload apache:
245
<pre>
246
    a2ensite wt
247
    /etc/init.d/apache2 reload
248
</pre>
249
250
Open your browser and point it to http://your.server.ip/wt/ if it works your golden.
251
252
You may wish to also do the following command just to check if mod_fcgid has installed:
253
<pre>
254
    a2enmod fcgid
255
</pre>
256
257
You should get the following output after running the above command:
258
<pre>
259
    This module is already enabled!
260
</pre>
261
262
*LETS GET TO THE EXAMPLES*
263
Depending on your version (I had 1.99.2), you may have to compile all the examples as they were not compiled during install of wt
264
<pre>
265
    cd /usr/local/src/wt/build/examples
266
    make
267
</pre>
268
269
Note: The hello-widgetset example doesn't build for the fcgi configuration (ie, if you have set -D EXAMPLES_CONNECTOR=wtfcgi in the call to CMake.)
270
271
Now you need to deploy the example to see if your server plays nice with wt
272
For this lets use a simple but time-tested "Hello World!" example (it doesn't require anything like mysql, unlike the other examples).
273
<pre>
274
    cd /usr/local/src/wt/build/examples/hello
275
    ./deploy.sh
276
</pre>
277
278
Now go to your favorite browser, type in the following and hit enter.
279
<pre>
280
    http://your.server.ip/wt/hello/hello.fcg
281
</pre>
282
283
You should get a "Hello, World!" on your screen with a quit button. SUCCESS!!!
284
285
Now stop reading and get typing!!  There are AJAX apps to be written! Go write your own gmail system and buy-out Google ;)