Project

General

Profile

Installing Wt on Ubuntu » History » Revision 9

Revision 8 (Davis Peterson, 06/28/2010 02:41 PM) → Revision 9/61 (Koen Deforche, 07/02/2010 11:02 AM)

h1. Installing Wt on Ubuntu 

 {{toc}} 

 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. 


 h2. Installing from the official package  

 Since Ubuntu Intrepid (8.10), official packages for Ubuntu are available. To install Wt, run: 

 <pre> 
  $ sudo aptitude install witty witty-dbg witty-dev witty-doc 
 </pre> 

 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. 

 _Note: If boost headers are missing, you may also need:_  

 <pre> 
  $ sudo apt-get install libboost*1.35* 
 </pre> 

 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. 


 h2. Installing from prebuilt packages  

 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 following lines to your /etc/apt/sources.list file: 

 <pre> 
  deb http://ppa.launchpad.net/pgquiles/ubuntu karmic main restricted universe multiverse 
  deb-src http://ppa.launchpad.net/pgquiles/ubuntu karmic main restricted universe multiverse 
 </pre> 

 (that's for Ubuntu 9.10, replace 'karmic' with 'hardy' for Ubuntu 8.04, 'jaunty' for Ubuntu 9.04 or 'lucid' for Ubuntu 10.04) 

 Then run: 

 <pre> 
  $ sudo apt-get update 
  $ sudo aptitude install libwt* 
 </pre> 

 This will automatically install all the required dependencies. If you only want the runtime library, you only need to install the witty package. 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*. 

 h2. Installing from sources  


 h3. 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. 


 h3. 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: 

 <pre> 
  sudo apt-get install gcc 
  sudo apt-get install g++ 
  sudo apt-get install zlib1g 
  sudo apt-get install zlib1g-dev 
  sudo apt-get install cmake 
  sudo apt-get install libboost-date-time-dev libboost-date-time1.34.1 
  sudo apt-get install libboost-program-options-dev libboost-program-options1.34.1 
  sudo apt-get install libboost-regex-dev libboost-regex1.34.1 
  sudo apt-get install libboost-signals-dev libboost-signals1.34.1 
  sudo apt-get install libboost-thread-dev libboost-thread1.34.1 
  sudo apt-get remove libgd-noxpm-dev (as libgd therein seems to be to old for examples - see link below) 
  sudo apt-get install libgd2-xpm libgd2-xpm-dev 
  sudo apt-get install libssl-dev 
  sudo apt-get install libboost-filesystem-dev libboost-filesystem1.34.1 
  sudo apt-get install libboost-test-dev libboost-test1.34.1 
 </pre> 

 If you also want support for deploying applications using FastCGI, you'll need the following library, and set FCGI to true when configuring Wt: 

 <pre> 
  sudo apt-get install libfcgi-dev 
 </pre> 


 h3. getting external sources  


 h4. get asio (http://asio.sourceforge.net)  

 <pre> 
  wget -c http://kent.dl.sourceforge.net/sourceforge/asio/asio-0.3.9.tar.bz2 
  tar xvfj asio-0.3.9.tar.bz2 
 </pre> 


 h4. get Wt (http://www.webtoolkit.eu/wt)  

 <pre> 
  wget -c http://kent.dl.sourceforge.net/sourceforge/witty/wt-2.1.0.tar.gz 
  tar xvfz wt-2.1.0.tar.gz 
 </pre> 


 h3. buidling and installing sources  


 h4. asio  

 <pre> 
  cd asio-0.3.9 
  ./configure 
  sudo make install 
  sudo ldconfig 
 </pre> 


 h4. Wt  

 <pre> 
  cd wt-2.1.0 
  mkdir build; cd build 
  cmake .. 
  make 
  sudo make install 
  sudo ldconfig 
 </pre> 


 h3. Try the examples  


 h4. From the prebuilt packages:  

 * To build the examples, call CMake this way: 

 <pre> 
   cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples 
 </pre> 

 * Then go to */usr/share/doc/witty-doc/examples* and enter the directory of the example you want to run.  

 * When running the "custom writing":http://customwritingservices.org/index.php example, set the docroot to "."    

 * For instance, if you compiled the examples in /home/user/dev/wtexamples, you would do: 

 <pre> 
   $ 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 . 
 </pre> 


 h4. 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. 



 h4. Special cases:  

 * 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 


 h3. Using 'ccmake' to edit build options  

 This is an easy, graphical way to edit the build options 

 <pre> 
  cd build 
  ccmake . 
 </pre> 


 h3. if it fails with SSL problem (as mine did)  

 Edit the HTTP_WITH_SSL to OFF, and try again (or you could install openssl-dev and try again) 

 <pre> 
  CMake Error: This project requires some variables to be set, 
  and cmake can not find them. 
  Please set the following variables: 
  OPENSSL_INCLUDE 
 </pre> 
  OPENSSL_LIB 



 h2. Ubuntu's official documentation 

 You can find it "here":https://help.ubuntu.com/community/BuildingWtFromSource