Project

General

Profile

Installing Wt on Debian » History » Version 11

Pau Garcia i Quiles, 06/02/2012 10:45 PM
People are asking for Squeeze packages, time to update instructions

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