Hi Wt folks,

I'm having difficulty getting the examples for FastCGI version of Wt to
run correctly.

I already built the wthttpd version, and it works properly.

Here are the steps I took to build and install fcgid.

First some system info:

  Debian Etch, x86-32 bit
  Apache 2.2.3
  Wt 2.2.2
  Boost 1.37
  CMake 2.4-patch 5
  gcc 4.1.2

I installed the libfcgi package.
I added the fcgid module to Apache using

#a2enmod fcgid

I set /etc/apache2/mods-available/fcgid.conf to:

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


I added a file called wt to the /etc/apache2/sites-available/
and placed this within the file:

       <Directory /var/www/wt/>
               #Order Deny,Allow
               Allow from all
               # Enable CGIs to be executed
               Options ExecCGI
       </Directory>

I enabled this site with:

#a2ensite wt

Within Wt/build I ran cmake with the following:

$cmake ../ -DBOOST_COMPILER=gcc41 -DBOOST_VERSION=1_37
-DBOOST_DIR=/home/matthew/Programming/Libraries/boost_build
-DCONNECTOR_FCGI=ON -DWEBUSER=www-data -DWEBGROUP=www-data
-DDEPLOYROOT=/var/www/wt -DRUNDIR=/usr/wt/run

I made the project and examples and installed:

$make
#make install
$make -C examples

The whole make problem occurred error free.  The libraries are installed
and the examples are built.

To test, I deployed the hello application (using the deploy shell script).

I renamed the hello.wt to hello.fcg, as that was what the Apache script
handler was set for (...yes, I will probably update that in the future
to include .wt also).

I added a symlink from /var/www/hello/wt to /usr/local/share/Wt/resources
        
I changed permission for the following:

#chown www-data.www-data /usr/wt/run -R
#chown www-data.www-data /var/www/wt -R

I reloaded and restarted Apache:

#/etc/init.d/apache2 reload
#/etc/init.d/apache2 restart

When I point browser to run the app:

  http://myserver/wt/hello/hello.fcg

I get an Internal Server Error page.

The following Apache info may help to diagnose.  The error says that the
Document root is not valid.

>From the mail archives, I see that another user had a similar issue, but
with the wthttpd version.

Thanks for any help you might have.

Matt.

-------

>From the Apache log:

127.0.1.1 - - [10/Jan/2009:20:44:37 +0100] "GET /wt/hello/hello.fcg
HTTP/1.1" 500 636 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.1.14) Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-0etch1)"

>From the Apache error log:

[Sat Jan 10 20:44:38 2009] [notice] mod_fcgid: server
/var/www/wt/hello/hello.fcg(24608) started
stat: No such file or directory
exception: Error: Document root ("") not valid.
[Sat Jan 10 20:44:39 2009] [error] [client 127.0.1.1] Premature end of
script headers: hello.fcg
[Sat Jan 10 20:44:44 2009] [notice] mod_fcgid: process
/var/www/wt/hello/hello.fcg(24608) exit(communication error), terminated
by calling exit(), return code: 1


>From the Apache server-info page:

Server Settings

Server Version: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch11
Server Built: Jan 27 2008 18:13:21
Module Magic Number: 20051115:3
Hostname/port: peavydeb40-01:80
Timeouts: connection: 300    keep-alive: 300
MPM Name: Prefork
MPM Information: Max Daemons: 150 Threaded: no Forked: yes
Server Architecture: 32-bit
Server Root: /etc/apache2
Config File: /etc/apache2/apache2.conf
Server Built With: -D APACHE_MPM_DIR="server/mpm/worker" -D
APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses
enabled) -D APR_USE_SYSVSEM_SERIALIZE -D
SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D
AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="" -D
SUEXEC_BIN="/usr/lib/apache2/suexec" -D
DEFAULT_PIDLOG="/var/run/apache2.pid" -D
DEFAULT_ERRORLOG="logs/error_log" -D
AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types" -D
SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"

....

Module Name: mod_fcgid.c
Content handlers: yes
Configuration Phase Participation: Create Directory Config, Create
Server Config, Merge Server Configs
Request Phase Participation: Content Handlers
Module Directives:
    IdleTimeout - an idle fastcgi application will be killed after
IdleTimeout
    IdleScanInterval - scan interval for idle timeout process
    BusyTimeout - a fastcgi application will be killed after handling a
request for BusyTimeout
    BusyScanInterval - scan interval for busy timeout process
    ShutdownTimeout - a fastcgi application requested exit will be
killed forcely after ShutdownTimeout
    ErrorScanInterval - scan interval for exited process
    ZombieScanInterval - scan interval for zombiz process
    ProcessLifeTime - fastcgi application lifetime
    SocketPath - fastcgi socket file path
    SpawnScoreUpLimit - Spawn score up limit
    SpawnScore - Score of spawn
    TerminationScore - Score of termination
    MaxProcessCount - Max total process count
    DefaultMaxClassProcessCount - Max process count of one class of
fastcgi application
    DefaultMinClassProcessCount - Min process count of one class of
fastcgi application
    OutputBufferSize - CGI output buffer size
    IPCConnectTimeout - Connect timeout to fastcgi server
    IPCCommTimeout - Communication timeout to fastcgi server
    DefaultInitEnv - an environment variable name and optional value to
pass to FastCGI.
    FCGIWrapper - The CGI wrapper setting
    PHP_Fix_Pathinfo_Enable - Set 1, if cgi.fix_pathinfo=1 in php.ini
Current Configuration:
    In file: /etc/apache2/mods-enabled/fcgid.conf
       3: SocketPath /var/lib/apache2/fcgid/sock
       4: IdleTimeout -1
       5: ProcessLifeTime -1
       6: MaxProcessCount 1
       7: DefaultMaxClassProcessCount 1
       8: DefaultMinClassProcessCount 1         

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to