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