Project

General

Profile

Installing Wt on Debian » History » Revision 2

Revision 1 (Pieter Libin, 10/29/2009 01:09 PM) → Revision 2/13 (Pau Garcia i Quiles, 04/11/2010 09:44 PM)

h1. Installing Wt on Debian 

 {{toc}} 


 h3. Wt installation on Debian or Debian-based distributions  

 Wt is included in Debian Testing and Unstable. Look for packages named 'libwtsomething': libwt21, libwtext14, libwthttp8, libwtlibwt-dev, libwtext-dev, libwthttp-dev, libwtdbo-dev, etc 

 If you want to install use Wt on Debian 5.0 (Lenny), Stable, download the Debian maintainer makes packages available from an OpenSuse Build Service repository. Just add this line to your sources.list: source package and build the binaries yourself: 

 <pre> 
  $ dget http://ftp.debian.org/debian/pool/main/w/witty/witty_2.2.3-1.dsc 
  $ dpkg-source -x witty_2.2.3-1.dsc 
  $ cd witty-2.2.3 
  $ dpkg-buildpackage -rfakeroot 
 # deb http://download.opensuse.org/repositories/home:/pgquiles:/Wt/Debian_5.0    ./ 
 </pre> 

 As of this writing, the newest debianized version is 2.2.3. Please check the directory contents and make sure you download the latest version. 

 Please note Wt needs at least you need Boost 1.36.0, which 1.35.0 or newer (Boost 1.35.0 is not available from Lenny itself. The OBS repository contains Boost 1.42.0. 

 in Debian Stable). 


 h3. Wt-1.99.2 installation on Debian 3.1 (testing)  

 # apt-get install cmake libfcgi-dev 
 # apt-get install apache2                (if apache2 is not already installed) 
 # apt-get install libapache2-mod-fastcgi 
 # apt-get install libboost-* libxerces27 (fix mask to use the only one of libboost versions) 

 and then follow the build and install steps given in the "INSTALL" file. 


 h3. Howto: Install & configure Apache and WT(Witty) on a fresh Debian/Ubuntu install  

 Following commands should be run as root. 

 Either log in as root, or run 
 <pre> 
   su - 
 </pre> 
 or 
 <pre> 
   sudo bash 
 </pre> 

 *# Using following sources.list (FOR UBUNTU WHEN I TRIED IT ON THE SERVER):* 

 <pre> 
     ## Ubuntu supported packages (packages, GPG key: 437D05B5) 
     deb http://archive.ubuntu.com/ubuntu dapper main restricted 
     deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted 
     deb http://archive.ubuntu.com/ubuntu breezy main restricted 
     deb http://archive.ubuntu.com/ubuntu breezy-updates main restricted 
     deb http://security.ubuntu.com/ubuntu dapper-security main restricted 
     deb http://security.ubuntu.com/ubuntu breezy-security main restricted 
     deb-src http://archive.ubuntu.com/ubuntu dapper main restricted 
     deb-src http://archive.ubuntu.com/ubuntu dapper-updates main restricted 
     deb-src http://archive.ubuntu.com/ubuntu breezy main restricted 
     deb-src http://archive.ubuntu.com/ubuntu breezy-updates main restricted 
     deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted 
     deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted 
     ## Ubuntu community supported packages (packages, GPG key: 437D05B5) 
     deb http://archive.ubuntu.com/ubuntu dapper universe multiverse 
     deb http://archive.ubuntu.com/ubuntu dapper-updates universe multiverse 
     deb http://security.ubuntu.com/ubuntu dapper-security universe multiverse 
     deb-src http://archive.ubuntu.com/ubuntu dapper universe multiverse 
     deb-src http://archive.ubuntu.com/ubuntu dapper-updates universe multiverse 
     deb-src http://security.ubuntu.com/ubuntu dapper-security universe multiverse 
     ## Ubuntu backports project (packages, GPG key: 437D05B5) 
     deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse 
     deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse  
     ## CANONICAL COMMERCIAL REPOSITORY (Hosted on Canonical servers, not Ubuntu servers. 
     ## RealPlayer10, Opera and more to come.) 
     deb http://archive.canonical.com/ubuntu dapper-commercial main 
     ## Cipherfunk multimedia packages (packages, GPG key: 33BAC1B3) 
     #deb ftp://cipherfunk.org/pub/packages/ubuntu/ dapper main 
     #deb-src ftp://cipherfunk.org/pub/packages/ubuntu dapper main 
     ## All the new packages such as cmake 2.4 & gcc 4.1 
     deb http://mirrors.kernel.org/ubuntu/ feisty main 
 </pre> 




 *# Using sources.list (FOR DEBIAN SARGE CURRENTLY INSTALLED ON THE BOX):* 

 <pre> 
     deb http://security.debian.org/ stable/updates main 
     #################################################### 
     deb http://ftp.us.debian.org/debian/ stable main 
     deb-src http://ftp.us.debian.org/debian/ stable main 
     deb http://ftp.us.debian.org/debian/ unstable main 
     deb-src http://ftp.us.debian.org/debian/ unstable main 
     deb http://ftp.us.debian.org/debian/ testing main 
     deb-src http://ftp.us.debian.org/debian/ testing main 
     ##################################################### 
     deb http://mirrors2.kernel.org/debian/ stable main 
     deb-src http://mirrors2.kernel.org/debian/ stable main 
     deb http://mirrors2.kernel.org/debian/ unstable main 
     deb-src http://mirrors2.kernel.org/debian/ unstable main 
     deb http://mirrors2.kernel.org/debian/ testing main 
     deb-src http://mirrors2.kernel.org/debian/ testing main 
     deb http://mirrors2.kernel.org/debian/ sarge main contrib non-free 
     deb-src http://mirrors2.kernel.org/debian/ sarge main contrib non-free 
 </pre> 






 *OPTIONAL SECTION - START* 

 This is in case you are getting the following errors: 
 <pre> 
     perl: warning: Please check that your locale settings: 
      LANGUAGE = (unset), 
      LC_ALL = (unset), 
      LANG = "en_US" 
      are supported and installed on your system. 
      perl: warning: Falling back to the standard locale ("C"). 
 </pre> 

 If you get that error do: 
 <pre> 
     dpkg-reconfigure locales 
 </pre> 

 *OPTIONAL SECTION - END* 


 Now install all apache, locales, and other stuff (most of which is required for wt) 
 <pre> 
     apt-get update 
     apt-get install apache2 locales 
     dpkg-reconfigure locales          // Select All + en_US -> OK (this may take up to 15min) 
     apt-get install localeconf          // (Yes, then No) 
     apt-get install libxml++2.6-2 
     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 
 </pre> 

 Now install CVS and download the latest copy of wt (witty) -- press enter when asked for login/pass 
 <pre> 
     apt-get install cvs 
     cd /usr/local/src/ 
     cvs -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty login 
     cvs -z3 -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty co -P wt 
     cd wt 
     mkdir build 
     cd build 
     mkdir /var/www/wt 
 </pre> 



 Get libxerces 
 <pre> 
     apt-get install libxerces27-dev 
 </pre> 

 ON TO THE INSTALL 
 <pre> 
     cd /usr/local/src/wt/build/ 
     cmake -D DEPLOYROOT=/var/www/wt -D WEBUSER=www-data -D WEBGROUP=www-data ../ 
 </pre> 

 Note: if you are interested in building the examples to run with fcgi (rather than wthttpd), add to the line above: 
 <pre> 
     -D EXAMPLES_CONNECTOR=wtfcgi 
 </pre> 

 If no errors were encountered, continue 
 <pre> 
     -- Check for working C compiler: /usr/bin/gcc 
     -- Check for working C compiler: /usr/bin/gcc -- works 
     -- Check size of void* 
     -- Check size of void* - done 
     -- Check for working CXX compiler: /usr/bin/c++ 
     -- Check for working CXX compiler: /usr/bin/c++ -- works 
     -- Looking for pthread.h 
     -- Looking for pthread.h - found 
     -- Looking for pthread_create in pthreads 
     -- Looking for pthread_create in pthreads - not found 
     -- Looking for pthread_create in pthread 
     -- Looking for pthread_create in pthread - found 
     ** Disabling multi threading. 
     -- Configuring done 
     -- Generating done 
     -- Build files have been written to: /usr/local/src/wt/build 
 </pre> 


 If using ccmake 2.2 
 <pre> 
     for i in `find . -name "build.make"`; do echo ".SUFFIXES:" >> $i; done 
 </pre> 

 Else continue the install 
 <pre> 
     make && make install 
 </pre> 

 Now config fcgid 
 <pre> 
     nano /etc/apache2/conf.d/fcgid.conf 
 </pre> 

 Put the following there 
 <pre> 
     <IfModule mod_fcgid.c> 
     AddHandler fcgid-script .fcg 
     SocketPath /var/lib/apache2/fcgid/sock 
     IdleTimeout -1 
     ProcessLifeTime -1 
     MaxProcessCount 1 
     DefaultMaxClassProcessCount 1 
     DefaultMinClassProcessCount 1 
     </IfModule> 
 </pre> 

 and then do this command: 
 <pre> 
     chown www-data:www-data /usr/wt/run -R 
 </pre> 

 Next I setup my apache2 (ver 2.2): 

 Go to the wt config file in apache  
 <pre> 
     nano /etc/apache2/sites-available/wt 
 </pre> 

 In it, replace whatever is there with the following: 
 <pre> 
         <Directory /var/www/wt/> 
                 #Order Deny,Allow 
                 Allow from all 
                 # Don't show indexes for directories on publicly accessible machines (Uncomment if it's a private devshell). 
                 #Options -Indexes 
                 # Enable CGIs to be executed  
                 Options ExecCGI 
         </Directory> 
 </pre> 

 Next I enable the site & reload apache: 
 <pre> 
     a2ensite wt 
     /etc/init.d/apache2 reload 
 </pre> 

 Open your browser and point it to http://your.server.ip/wt/ if it works your golden. 

 You may wish to also do the following command just to check if mod_fcgid has installed: 
 <pre> 
     a2enmod fcgid 
 </pre> 

 You should get the following output after running the above command: 
 <pre> 
     This module is already enabled! 
 </pre> 

 *LETS GET TO THE EXAMPLES* 
 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 
 <pre> 
     cd /usr/local/src/wt/build/examples 
     make 
 </pre> 

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

 Now you need to deploy the example to see if your server plays nice with wt 
 For this lets use a simple but time-tested "Hello World!" example (it doesn't require anything like mysql, unlike the other examples). 
 <pre> 
     cd /usr/local/src/wt/build/examples/hello 
     ./deploy.sh 
 </pre> 

 Now go to your favorite browser, type in the following and hit enter. 
 <pre> 
     http://your.server.ip/wt/hello/hello.fcg 
 </pre> 

 You should get a "Hello, World!" on your screen with a quit button. SUCCESS!!! 

 Now stop reading and get typing!!    There are AJAX apps to be written! Go write your own gmail system and buy-out Google ;)