特殊:Badtitle/NS100:BuildingWtFromSource
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/BuildingWtFromSource }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/af | • {{#if: UbuntuHelp:BuildingWtFromSource|Afrikaans| [[::BuildingWtFromSource/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ar | • {{#if: UbuntuHelp:BuildingWtFromSource|العربية| [[::BuildingWtFromSource/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/az | • {{#if: UbuntuHelp:BuildingWtFromSource|azərbaycanca| [[::BuildingWtFromSource/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/bcc | • {{#if: UbuntuHelp:BuildingWtFromSource|جهلسری بلوچی| [[::BuildingWtFromSource/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/bg | • {{#if: UbuntuHelp:BuildingWtFromSource|български| [[::BuildingWtFromSource/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/br | • {{#if: UbuntuHelp:BuildingWtFromSource|brezhoneg| [[::BuildingWtFromSource/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ca | • {{#if: UbuntuHelp:BuildingWtFromSource|català| [[::BuildingWtFromSource/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/cs | • {{#if: UbuntuHelp:BuildingWtFromSource|čeština| [[::BuildingWtFromSource/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/de | • {{#if: UbuntuHelp:BuildingWtFromSource|Deutsch| [[::BuildingWtFromSource/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/el | • {{#if: UbuntuHelp:BuildingWtFromSource|Ελληνικά| [[::BuildingWtFromSource/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/es | • {{#if: UbuntuHelp:BuildingWtFromSource|español| [[::BuildingWtFromSource/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/fa | • {{#if: UbuntuHelp:BuildingWtFromSource|فارسی| [[::BuildingWtFromSource/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/fi | • {{#if: UbuntuHelp:BuildingWtFromSource|suomi| [[::BuildingWtFromSource/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/fr | • {{#if: UbuntuHelp:BuildingWtFromSource|français| [[::BuildingWtFromSource/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/gu | • {{#if: UbuntuHelp:BuildingWtFromSource|ગુજરાતી| [[::BuildingWtFromSource/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/he | • {{#if: UbuntuHelp:BuildingWtFromSource|עברית| [[::BuildingWtFromSource/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/hu | • {{#if: UbuntuHelp:BuildingWtFromSource|magyar| [[::BuildingWtFromSource/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/id | • {{#if: UbuntuHelp:BuildingWtFromSource|Bahasa Indonesia| [[::BuildingWtFromSource/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/it | • {{#if: UbuntuHelp:BuildingWtFromSource|italiano| [[::BuildingWtFromSource/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ja | • {{#if: UbuntuHelp:BuildingWtFromSource|日本語| [[::BuildingWtFromSource/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ko | • {{#if: UbuntuHelp:BuildingWtFromSource|한국어| [[::BuildingWtFromSource/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ksh | • {{#if: UbuntuHelp:BuildingWtFromSource|Ripoarisch| [[::BuildingWtFromSource/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/mr | • {{#if: UbuntuHelp:BuildingWtFromSource|मराठी| [[::BuildingWtFromSource/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ms | • {{#if: UbuntuHelp:BuildingWtFromSource|Bahasa Melayu| [[::BuildingWtFromSource/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/nl | • {{#if: UbuntuHelp:BuildingWtFromSource|Nederlands| [[::BuildingWtFromSource/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/no | • {{#if: UbuntuHelp:BuildingWtFromSource|norsk| [[::BuildingWtFromSource/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/oc | • {{#if: UbuntuHelp:BuildingWtFromSource|occitan| [[::BuildingWtFromSource/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/pl | • {{#if: UbuntuHelp:BuildingWtFromSource|polski| [[::BuildingWtFromSource/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/pt | • {{#if: UbuntuHelp:BuildingWtFromSource|português| [[::BuildingWtFromSource/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ro | • {{#if: UbuntuHelp:BuildingWtFromSource|română| [[::BuildingWtFromSource/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/ru | • {{#if: UbuntuHelp:BuildingWtFromSource|русский| [[::BuildingWtFromSource/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/si | • {{#if: UbuntuHelp:BuildingWtFromSource|සිංහල| [[::BuildingWtFromSource/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/sq | • {{#if: UbuntuHelp:BuildingWtFromSource|shqip| [[::BuildingWtFromSource/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/sr | • {{#if: UbuntuHelp:BuildingWtFromSource|српски / srpski| [[::BuildingWtFromSource/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/sv | • {{#if: UbuntuHelp:BuildingWtFromSource|svenska| [[::BuildingWtFromSource/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/th | • {{#if: UbuntuHelp:BuildingWtFromSource|ไทย| [[::BuildingWtFromSource/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/tr | • {{#if: UbuntuHelp:BuildingWtFromSource|Türkçe| [[::BuildingWtFromSource/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/vi | • {{#if: UbuntuHelp:BuildingWtFromSource|Tiếng Việt| [[::BuildingWtFromSource/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/yue | • {{#if: UbuntuHelp:BuildingWtFromSource|粵語| [[::BuildingWtFromSource/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/zh | • {{#if: UbuntuHelp:BuildingWtFromSource|中文| [[::BuildingWtFromSource/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/zh-hans | • {{#if: UbuntuHelp:BuildingWtFromSource|中文(简体)| [[::BuildingWtFromSource/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:BuildingWtFromSource | UbuntuHelp:BuildingWtFromSource | {{#if: | :}}BuildingWtFromSource}}/zh-hant | • {{#if: UbuntuHelp:BuildingWtFromSource|中文(繁體)| [[::BuildingWtFromSource/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:BuildingWtFromSource|:BuildingWtFromSource|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :BuildingWtFromSource/zh | | {{#ifexist: BuildingWtFromSource/zh | | {{#ifeq: {{#titleparts:BuildingWtFromSource|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:BuildingWtFromSource|1|-1|}} | zh | | }}
Introduction
/!\ Note: This page is maintained by Tim Sutton (tim [at] linfiniti.com).
I am really eager to try out the Wt (a.k.a. 'witty') toolkit which allows you to deploy your C++ application as an ajax web app. They have recently published a nice article which provides an overview of the design thoughts behind Wt and some samples showing how it is used. I wanted to get it running on Ubuntu Dapper using apt for dependencies as much as possible. Here is what I did:
Getting Wt installed
Install Dependencies
sudo apt-get install libapache2-mod-fastcgi libfcgi-dev libboost-regex-dev libboost-regex1.33.1 libxml++2.6-dev libxml++2.6c2a libgd2-xpm libgd2-xpm-dev libboost-dbg libboost-date-time1.33.1 libboost-date-time-dev libmysql++-dev libmysql++2c2a cmake Note: I assume you already have apache2 installed and running on your machine.
Source Download and Compilation
Next I downloaded the Wt sources from anonymouse CVS (I had some problems with the latest stable release and the developers suggested using CVS head instead).
cd ~/src/ cvs -d:pserver:[email protected]:/cvsroot/witty login cvs -z3 -d:pserver:[email protected]:/cvsroot/witty co -P wt cd wt mkdir build cd build cmake -D DEPLOYROOT=/var/www/wt -D WEBUSER=www-data -D WEBGROUP=www-data ../
Which gave me an output looking like this:
-- Check for working C compiler: gcc -- Check for working C compiler: gcc -- works -- Check size of void* -- Check size of void* - done -- Check for working CXX compiler: c++ -- Check for working CXX compiler: c++ -- works -- Looking for libxml++-2.6 -- Looking for libxml++-2.6 -- found -- Configuring done -- Generating done -- Build files have been written to: /home/timlinux/dev/cpp/wt/build
At the time of writing ubuntu provides ccmake version 2.2-patch 3. This version has a known issue that needs to be compensated for by running the following command:
for i in `find . -name "build.make"`; do echo ".SUFFIXES:" >> $i; done
Now go on to make wt:
make && sudo make install
Preparing Apache
Now lets get the fastcgi module installed for apache:
sudo a2enmod
When prompted type
fastcgi
Now reload the apache modules:
sudo /etc/init.d/apache2 force-reload
Next create /etc/apache2/conf.d/witty with the following content:
# # Added for wt web toolkit support # #first an additional handler for witty's fcg extension <IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcg </IfModule> #next make an alias for witty dir Alias /wt /var/www/wt <Directory /wt> Options -MultiViews +SymLinksIfOwnerMatch AllowOverride None </Directory> # finally treat all fcg of fgci files as fastcgi scripts <Files ~ "\.(fcg|fcgi)$"> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch AllowOverride None </Files>
This creates an alias for the witty working directory and makes sure fastcgi will handle the .fcg extension properly.
After these changes you need to restart apache:
sudo /etc/init.d/apache2 restart
Now make the witty web dir and give yourself permissions:
sudo mkdir -p /var/www/wt sudo chown <yourusername> /var/www/wt
Now we link the libwt.so we built earlier should be in ld search path. Edit (as sudo) /etc/ld.so.conf and check you have /usr/local/lib in the list. If not add it and then run:
sudo ldconfig
Install the hello world example
First lets make all the examples
cd ~/dev/cpp/wt/build make -C examples/
A simple example : hello world
cd ~/dev/cpp/wt/build/examples/hello
Now lets install the hello example.
Now run the deploy script:
./deploy.sh
Now you can fire up your browser and point it to the example e.g.:
http://localhost/wt/hello/hello.fcg
A more feature filled example : hangman
As before, just run the deploy scripts provided to install hangman:
cd ~/dev/cpp/wt/build/examples/hangman
Now run the deploy script:
./deploy.sh
Before the hangman example can be used, you need to create a database and point to that (I assume you already have mysql set up and running locally on your system):
cd ~/dev/cpp/wt/examples/hangman mysql -u<your mysql user name> -p < dbscript
Enter your password when prompted. Also you need to make a tiny config file for Wt to be able to connect to the database properly:
echo "<your mysql user name>" > /var/www/wt/hangman/HangmanDb.info echo "<your mysql password>" > /var/www/wt/hangman/HangmanDb.info
Obviously you should replace items between < > brackets in above instructions with their real values.
Now you can fire up your browser and point it to the example e.g.:
http://localhost/wt/hangman/hangman.fcg
FAQ
Question: When running make I get a bunch of 'WWebWidget: No such file of directory' type errors like this:
Scanning dependencies of target xl Building CXX object xlobject/src/CMakeFiles/xl.dir/baseobject.o Linking CXX static library libxl.a Scanning dependencies of target wt In file included from ../src/wt/WInteractWidget.C:6: ../src/wt/WInteractWidget:10:22: error: WWebWidget: No such file or directory ../src/wt/WInteractWidget:18: error: expected class-name before ‘{’ token ../src/wt/WInteractWidget:22: error: expected `)' before ‘*’ token ../src/wt/WInteractWidget:27: error: expected `:' before ‘signals’ ../src/wt/WInteractWidget:37: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:37: error: ‘Signal’ was not declared in this scope ../src/wt/WInteractWidget:37: error: expected primary-expression before ‘int’ ../src/wt/WInteractWidget:37: error: ISO C++ forbids declaration of ‘signals’ with no type ../src/wt/WInteractWidget:37: error: expected ‘;’ before ‘int’ ../src/wt/WInteractWidget:46: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:46: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:46: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:55: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:55: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:55: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:62: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:62: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:62: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:67: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:67: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:67: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:72: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:72: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:72: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:77: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:77: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:77: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:81: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:81: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:81: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:85: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:85: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:85: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:89: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:89: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:89: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:92: error: ‘Wt’ has not been declared ../src/wt/WInteractWidget:92: error: ISO C++ forbids declaration of ‘Signal’ with no type ../src/wt/WInteractWidget:92: error: expected ‘;’ before ‘<’ token ../src/wt/WInteractWidget:94: error: expected `:' before ‘slots’ ../src/wt/WInteractWidget:95: error: expected primary-expression before ‘void’ ../src/wt/WInteractWidget:95: error: ISO C++ forbids declaration of ‘slots’ with no type ../src/wt/WInteractWidget:95: error: expected ‘;’ before ‘void’ ../src/wt/WInteractWidget:101: error: ‘DomElement’ has not been declared ../src/wt/WInteractWidget.C:8: error: expected `)' before ‘*’ token ../src/wt/WInteractWidget.C:45: error: variable or field ‘updateDom’ declared void ../src/wt/WInteractWidget.C:45: error: ‘int WInteractWidget::updateDom’ is not a static member of ‘class WInteractWidget’ ../src/wt/WInteractWidget.C:45: error: ‘DomElement’ was not declared in this scope ../src/wt/WInteractWidget.C:45: error: ‘element’ was not declared in this scope ../src/wt/WInteractWidget.C:45: error: expected primary-expression before ‘bool’ ../src/wt/WInteractWidget.C:45: error: initializer expression list treated as compound expression ../src/wt/WInteractWidget.C:46: error: expected ‘,’ or ‘;’ before ‘{’ token ../src/wt/WInteractWidget.C:69: error: no ‘void WInteractWidget::gotClick()’ member function declared in class ‘WInteractWidget’ ../src/wt/WInteractWidget.C: In member function ‘void WInteractWidget::gotClick()’: ../src/wt/WInteractWidget.C:71: error: ‘clickData’ was not declared in this scope ../src/wt/WInteractWidget.C:71: error: ‘emit’ was not declared in this scope make[2]: *** [../src/wt/WInteractWidget] Error 1 make[1]: *** [src/CMakeFiles/wt.dir/all] Error 2 make: *** [all] Error 2
Answer: This is a known issue with the version of ccmake (v 2.2 patch 3) shipped with Ubuntu Dapper. Make sure you do the
for i in `find . -name "build.make"`; do echo ".SUFFIXES:" >> $i; done
step described in the 'source download and compilation' section above.
Question: Its all built and installed, but when I try to run an example, I get a heap of errors in my apache error logs like this:
[Tue Jul 18 15:57:08 2006] [notice] FastCGI: process manager initialized (pid 14761) [Tue Jul 18 15:57:08 2006] [notice] Apache/2.0.55 (Ubuntu) mod_fastcgi/2.4.2 PHP/4.4.2-1build1 configured -- resuming normal operations [Tue Jul 18 15:57:09 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14767) Creating new session: DyOaSyj6eb5T5nVN Spawned new application: pid=14769 bind: No such file or directory SIGCHLD received Child pid is 14769 Deleting session: DyOaSyj6eb5T5nVN [Tue Jul 18 15:57:13 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14770) [Tue Jul 18 15:57:16 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14771) [Tue Jul 18 15:57:19 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14772) connect: No such file or directory Giving up on session: DyOaSyj6eb5T5nVN Creating new session: lSwANRPjGVEqcVCu Spawned new application: pid=14773 bind: No such file or directory SIGCHLD received Child pid is 14773 Deleting session: lSwANRPjGVEqcVCu [Tue Jul 18 15:57:22 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14774) [Tue Jul 18 15:57:25 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14775) [Tue Jul 18 15:57:28 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14776) connect: No such file or directory Giving up on session: lSwANRPjGVEqcVCu Creating new session: FAScLywZHXv9eIIa Spawned new application: pid=14777 bind: No such file or directory SIGCHLD received Child pid is 14777 Deleting session: FAScLywZHXv9eIIa [Tue Jul 18 15:57:31 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14778) [Tue Jul 18 15:57:34 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14779) [Tue Jul 18 15:57:37 2006] [warn] FastCGI: scheduled the start of the last (dynamic) server "/var/www/wt/hangman/hangman.fcg" process: reached dynamicMaxClassProcs (10) [Tue Jul 18 15:57:37 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" started (pid 14780) connect: No such file or directory Giving up on session: FAScLywZHXv9eIIa Creating new session: yfW8iOFppMTodz92 Spawned new application: pid=14781 bind: No such file or directory SIGCHLD received Child pid is 14781 Deleting session: yfW8iOFppMTodz92 [Tue Jul 18 15:57:43 2006] [error] [client 127.0.0.1] FastCGI: comm with (dynamic) server "/var/www/wt/hangman/hangman.fcg" aborted: (first read) idle timeout (30 sec) [Tue Jul 18 15:57:43 2006] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "/var/www/wt/hangman/hangman.fcg" connect: No such file or directory Giving up on session: yfW8iOFppMTodz92 Creating new session: veXzGFFpqTIr0W65 Spawned new application: pid=14782 bind: No such file or directory SIGCHLD received Child pid is 14782 Deleting session: veXzGFFpqTIr0W65 connect: No such file or directory Giving up on session: veXzGFFpqTIr0W65 Creating new session: ZWDDcvLjlI23NcFo Spawned new application: pid=14783 bind: No such file or directory SIGCHLD received . . . etc
Answer: This is probably because the witty run dir is not created and or writeable by the www-data user. Make sure your /usr/run/wt dir is present with the correct permissions.
Question: When I try to run the hangman example, I get 'failed to remain running' messages like this:
[Wed Jul 19 13:56:55 2006] [warn] FastCGI: (dynamic) server "/var/www/wt/hangman/hangman.fcg" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
Answer: To be answered
Question: When I try to run the hangman example I get 'Exec format error' messages like this:
[Wed Jul 19 10:07:41 2006] [error] [client 127.0.0.1] (8)Exec format error: exec of '/var/www/wt/hangman/icons/hangman1.png' failed, referer: http://localhost/wt/hangman/hangman.fcg?wtd=Vry2TLKMnkAutkeX&js=yes&ajax=yes
Answer: This is because your apache configuration is trying to treat png images as script files. Are you sure you entered the /etc/apache2/conf.d/witty settings exactly as shown in the instructions above?