Installing Wt on Ubuntu¶
- Installing Wt on Ubuntu
- Installing from the Official Package
- Installing from Prebuilt Packages
- Installing from Sources
- Howto for wthttpd on gutsy
- Installing System Dependencies
- Getting External Sources
- Buidling and Installing Sources
- Try the Examples
- Using 'ccmake' to Edit Build Options
- If It Fails with SSL Problem
- 12.10 Installation
- Ubuntu's Official Documentation
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.
Installing from the Official Package¶
Since Ubuntu Intrepid (8.10), official packages for Ubuntu are available. To install Wt, run:
$ sudo aptitude install witty witty-dbg witty-dev witty-doc
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.
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.
Installing from Prebuilt Packages¶
Since Wt 2.0.3, unofficial packages for Ubuntu are being built by Pau Garcia i Quiles. To install Wt, add the Wt PPA to your repositories (check "Adding this PPA to your system" in the Wt PPA page). After adding the repository to your system, run:
$ sudo apt-get update $ sudo aptitude install libwt*
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.
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.
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*.
Installing from Sources¶
Howto for wthttpd on gutsy¶
I made this for a freshly installed ubuntu 7.10 (gutsy gibbon).
It's without unicode,mysql and extjs support.
Should work similar for debian 4.0 etch.
As I wrote this down after installation, I hope all steps are correct. If you encounter problems, please let me know.
Installing System Dependencies¶
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)
Open a terminal and enter the following commands (as tested for Ubuntu 12.04):
sudo apt-get install gcc g++ libboost-date-time-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-thread-dev libboost-random-dev libboost-test-dev doxygen libgraphicsmagick3 libssl-dev libpq-dev libssl-dev cmake
If you also want support for deploying applications using FastCGI, you'll need the following library, and set FCGI to true when configuring Wt:
sudo apt-get install libfcgi-dev
Getting External Sources¶
Get asio (http://sourceforge.net/projects/asio/)¶
wget -c http://kent.dl.sourceforge.net/sourceforge/asio/asio-0.3.9.tar.bz2 tar xvfj asio-0.3.9.tar.bz2
Get Wt (http://www.webtoolkit.eu/wt)¶
wget -c http://kent.dl.sourceforge.net/sourceforge/witty/wt-2.1.0.tar.gz tar xvfz wt-2.1.0.tar.gz
Buidling and Installing Sources¶
cd asio-0.3.9 ./configure sudo make install sudo ldconfig
cd wt-2.1.0 mkdir build; cd build cmake .. make sudo make install sudo ldconfig
Try the Examples¶
From the Prebuilt Packages¶
- To build the examples, call CMake this way:
cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
- Then go to /usr/share/doc/witty-doc/examples and enter the directory of the example you want to run.
- When running the example, set the docroot to "."
- For instance, if you compiled the examples in /home/user/dev/wtexamples, you would do:
$ mkdir /home/user/dev/wtexamples $ cd /home/user/dev/wtexamples $ cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples $ make $ cd /usr/share/doc/witty-doc/examples/charts $ /home/user/dev/wtexamples/charts/charts.wt --http-port 10000 --http-addr 0.0.0.0 --docroot .
From the Sources¶
- 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.
- Please note the wt-homepage example will not run properly unless you download ExtJS (http://extjs.com) and extract it the proper place.
- Please note the wtwithqt example needs Qt 4.x to run
Using 'ccmake' to Edit Build Options¶
This is an easy, graphical way to edit the build options
cd build ccmake .
If It Fails with SSL Problem¶
Edit the HTTP_WITH_SSL to OFF, and try again (or you could install openssl-dev and try again)
CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: OPENSSL_INCLUDE
Please note that the editor of this section is completely inexperienced.
I was able to install 3.2.3 linked here http://www.webtoolkit.eu/wt/download by first, making it so I can get "all" packages: http://askubuntu.com/questions/259590/libapache2-mod-fastcgi-not-available
Then, I of course
I want to use FastCGI for my AJAX pages, so I used
apt-get install libapache2-mod-fastcgiand
a2enmod actions fastcgi aliasand
service apache2 restart
As a bonus, if you're looking for speed like me (after all, why would we use c++ unless if we wanted max performance?), use this to get spdy http://www.howtoforge.com/using-mod_spdy-with-apache2-on-ubuntu-12.10
I used the two commands from http://redmine.webtoolkit.eu/projects/wt/wiki/Installing_Wt_on_Ubuntu#Installing-System-Dependencies
Download the ball from the link here http://www.webtoolkit.eu/wt/download (The syntax from here http://redmine.webtoolkit.eu/projects/wt/wiki/Installing_Wt_on_Ubuntu#Get-Wt-httpwwwwebtoolkiteuwt helps, but be sure to use the link from the download page. Because of sourceforge's weirdness, you'll probably want to use the -O flag to rename the file to something sensible).
Finally, I followed the incredibly easy steps from http://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html
As one might notice who've tried to use http://redmine.webtoolkit.eu/projects/wt/wiki/Installing_Wt_on_Ubuntu#Installing-from-the-Official-Package, the fastcgi library is not there after installing. I couldn't get http://redmine.webtoolkit.eu/projects/wt/wiki/Installing_Wt_on_Ubuntu#Installing-from-Prebuilt-Packages to work no matter how I did it.
Using the steps in this section, you can verify that fastcgi was installed with
find / -name 'libwtfcgi.so'
Ubuntu's Official Documentation¶
You can find it here