Installing Wt on Gentoo¶
Dependencies¶
To install the dependencies for the library (updated for Wt 2.1.0 release), with support for threading (recommended):
Wt 2.1.0 does not compile with gcc version 3.4.6 and below. I recommend using gcc 4.1 and above.
# USE="threads" emerge cmake boost
Note: Newer Version of boost do not require the threads USE flag.
With support for wthttpd deployment
When using the built-in httpd, you need:
# emerge asio
For some of the examples, you optionally also need:
# emerge gd mysql++
With support for FastCGI deployment
When using the FastCGI connector, inside an Apache environment, in addition you need:
# emerge fcgi apache mod_fastcgi
Build and install of Wt¶
To build the library, and install within /usr/local
$ cd wt-x.xx $ mkdir build $ cd build $ cmake ../ $ make $ make -C examples # make install
Note: You can pass options to cmake via -DOPTION=value, e.g. if you want to build with fcgi support and without httpd support and apache user and group www
$ cmake -DCONNECTOR_FCGI=ON -DCONNECTOR_HTTP=OFF -DWEBUSER=www -DWEBGROUP=www ../
Trying the examples¶
Deployment with wthttpd
Simply follow the instructions in the INSTALL file (with X the name of an example):
$ cd ../examples/X # source directory for example X $ ../../build/examples/X/X.wt --docroot . --http-address 0.0.0.0 --http-port 8080
Deployment with FastCGI
Modify /etc/init.d/apache2 to enable fastcgi:
APACHE2_OPTS="... -D FASTCGI"
Enable ExecCGI for the location where you wish to install the examples:
<Location /wt-examples>
<pre>
Options ExecCGI
Allow from All
</pre>
</Location>
To install a particular example:
# cd build/examples/composer # ./deploy.sh
And list the path in /etc/apache2/modules.d/20_mod_fastcgi.conf:
FastCgiServer /var/www/localhost/htdocs/wt-examples/composer/composer.wt -idle-timeout 120 -processes 1
Finally, restart your apache, and check your log files for problems !
/etc/init.d/apache2 restart