Project

General

Profile

Installing Wt on Ubuntu » History » Version 24

Charles Brockman, 07/15/2012 03:38 AM
Corrected asio library URL at SourceForge.

1 1 Pieter Libin
h1. Installing Wt on Ubuntu
2
3
{{toc}}
4
5
For installation of Wt on Ubuntu, you have the choice between the official package available in Ubuntu, prebuilt packages by Pau Garcia i Quiles (always updated to the newest Wt version) or installation from source.
6
7 24 Charles Brockman
h2. Installing from the Official Package
8 1 Pieter Libin
9
Since Ubuntu Intrepid (8.10), official packages for Ubuntu are available. To install Wt, run:
10
11
<pre>
12
 $ sudo aptitude install witty witty-dbg witty-dev witty-doc
13
</pre>
14
15 10 Pau Garcia i Quiles
This will automatically install all the required dependencies. If you only want the runtime library, you only need to install the witty package. The witty-dbg package contains the debug versions of the libraries. Make sure you install witty-dev (or libwtwhatever-dev) if you want to develop Wt applications.
16 1 Pieter Libin
17
The official package is usually a bit outdated due to the stabilization periods Debian and Ubuntu need prior to release. If you want to use the newest version of Wt and not build from source, read on.
18
19 24 Charles Brockman
h2. Installing from Prebuilt Packages
20 1 Pieter Libin
21 10 Pau Garcia i Quiles
Since Wt 2.0.3, unofficial packages for Ubuntu are being built by "Pau Garcia i Quiles":http://www.elpauer.org/. To install Wt, add the "Wt PPA":http://launchpad.net/~pgquiles/+archive/wt to your repositories (check "Adding this PPA to your system" in the Wt PPA page). After adding the repository to your system, run:
22 1 Pieter Libin
23
<pre>
24
 $ sudo apt-get update
25
 $ sudo aptitude install libwt*
26
</pre>
27
28 21 Jake Petroules
This will automatically install all the required dependencies. If you only want the runtime library, you only need to install the libwt24, libwthttp24, libwtext24, etc packages (no -dev, -doc or -dbg packages). The libwt-dbg package contains the debug versions of the libraries.
29 1 Pieter Libin
30
These packages are built by the maintainer of the official Debian and Ubuntu packages and are always updated to the latest version of Wt. If you want to use the newest version of Wt and not build from source, this is the preferred method.
31
32
Please note in the past packages were named witty, witty-dev, witty-doc and witty-dbg. These package still exist but only as transitional packages and will be removed in the future. It is recommended that you install libwt*.
33 4 Pau Garcia i Quiles
34 24 Charles Brockman
h2. Installing from Sources
35 1 Pieter Libin
36 24 Charles Brockman
h3. Howto for wthttpd on gutsy
37 1 Pieter Libin
38
I made this for a freshly installed ubuntu 7.10 (gutsy gibbon).
39
It's without unicode,mysql and extjs support.
40
Should work similar for debian 4.0 etch.
41
As I wrote this down after installation, I hope all steps are correct. If you encounter problems, please let me know.
42
43 24 Charles Brockman
h3. Installing System Dependencies
44 1 Pieter Libin
45
Note : this information is partially out of date. Instead of installing the 1.34 versions of the boost projects, use the 1.35 ones (also in ubuntu with sudo apt-get install libboost1.35-dev)
46
47
Open a terminal and enter the following commands:
48
49
<pre>
50
 sudo apt-get install gcc
51
 sudo apt-get install g++
52
 sudo apt-get install zlib1g
53
 sudo apt-get install zlib1g-dev
54
 sudo apt-get install cmake
55
 sudo apt-get install libboost-date-time-dev libboost-date-time1.34.1
56
 sudo apt-get install libboost-program-options-dev libboost-program-options1.34.1
57
 sudo apt-get install libboost-regex-dev libboost-regex1.34.1
58
 sudo apt-get install libboost-signals-dev libboost-signals1.34.1
59
 sudo apt-get install libboost-thread-dev libboost-thread1.34.1
60
 sudo apt-get remove libgd-noxpm-dev (as libgd therein seems to be to old for examples - see link below)
61
 sudo apt-get install libgd2-xpm libgd2-xpm-dev
62
 sudo apt-get install libssl-dev
63
 sudo apt-get install libboost-filesystem-dev libboost-filesystem1.34.1
64
 sudo apt-get install libboost-test-dev libboost-test1.34.1
65
</pre>
66
67
If you also want support for deploying applications using FastCGI, you'll need the following library, and set FCGI to true when configuring Wt:
68
69
<pre>
70
 sudo apt-get install libfcgi-dev
71
</pre>
72
73 24 Charles Brockman
h3. Getting External Sources
74 1 Pieter Libin
75 24 Charles Brockman
h4. Get asio (http://sourceforge.net/projects/asio/)
76 1 Pieter Libin
77
<pre>
78
 wget -c http://kent.dl.sourceforge.net/sourceforge/asio/asio-0.3.9.tar.bz2
79
 tar xvfj asio-0.3.9.tar.bz2
80
</pre>
81
82 24 Charles Brockman
h4. Get Wt (http://www.webtoolkit.eu/wt)
83 1 Pieter Libin
84
<pre>
85
 wget -c http://kent.dl.sourceforge.net/sourceforge/witty/wt-2.1.0.tar.gz
86
 tar xvfz wt-2.1.0.tar.gz
87
</pre>
88
89 24 Charles Brockman
h3. Buidling and Installing Sources
90 1 Pieter Libin
91 24 Charles Brockman
h4. asio
92 1 Pieter Libin
93
<pre>
94
 cd asio-0.3.9
95
 ./configure
96
 sudo make install
97
 sudo ldconfig
98
</pre>
99
100 24 Charles Brockman
h4. Wt
101 1 Pieter Libin
102
<pre>
103
 cd wt-2.1.0
104
 mkdir build; cd build
105
 cmake ..
106
 make
107
 sudo make install
108
 sudo ldconfig
109
</pre>
110
111 24 Charles Brockman
h3. Try the Examples
112 1 Pieter Libin
113 24 Charles Brockman
h4. From the Prebuilt Packages
114 1 Pieter Libin
115
* To build the examples, call CMake this way:
116
117
<pre>
118
  cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
119
</pre>
120
121
* Then go to */usr/share/doc/witty-doc/examples* and enter the directory of the example you want to run. 
122
123
* When running the example, set the docroot to "."   
124 9 Koen Deforche
125 1 Pieter Libin
* For instance, if you compiled the examples in /home/user/dev/wtexamples, you would do:
126
127
<pre>
128
  $ mkdir /home/user/dev/wtexamples
129
  $ cd /home/user/dev/wtexamples
130
  $ cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
131
  $ make
132
  $ cd /usr/share/doc/witty-doc/examples/charts
133
  $ /home/user/dev/wtexamples/charts/charts.wt --http-port 10000 --http-addr 0.0.0.0 --docroot .
134
</pre>
135
136 24 Charles Brockman
h4. From the Sources
137 1 Pieter Libin
138
* If you installed Wt using the source packages (http://sourceforge.net/projects/witty/files/), then you can find instructions on how to run the examples in the file *INSTALL.html* that is included in the main directory of the respective source package.
139
140 24 Charles Brockman
h4. Special Cases
141 1 Pieter Libin
142
* Please note the wt-homepage example will not run properly unless you download ExtJS (http://extjs.com) and extract it the proper place.
143
144
* Please note the wtwithqt example needs Qt 4.x to run
145
146 24 Charles Brockman
h3. Using 'ccmake' to Edit Build Options
147 1 Pieter Libin
148
This is an easy, graphical way to edit the build options
149
150
<pre>
151
 cd build
152
 ccmake .
153
</pre>
154
155 24 Charles Brockman
h3. If It Fails with SSL Problem
156 1 Pieter Libin
157
Edit the HTTP_WITH_SSL to OFF, and try again (or you could install openssl-dev and try again)
158
159
<pre>
160
 CMake Error: This project requires some variables to be set,
161
 and cmake can not find them.
162 3 Vincenzo Romano
 Please set the following variables:
163
 OPENSSL_INCLUDE
164
</pre>
165
 OPENSSL_LIB
166
167 24 Charles Brockman
h2. Ubuntu's Official Documentation
168 18 darren sy
169
You can find it "here":https://help.ubuntu.com/community/BuildingWtFromSource