On 5/26/2011 11:44, silvioprog wrote:
2011/5/26 ABorka<[email protected]>:
1. Specify a port number in your project main file (.lpr)
...<snip>...
  Application.Title:='My FCGI Application';
  Application.Port:=2015;//Port the FCGI application is listening on
  Application.Initialize;
  Application.Run;
...<snip>...

2. In your apache config file (ex: httpd.conf) put something like
LoadModule fastcgi_module "C:/path to the dll/mod_fastcgi-2.4.6-AP22.dll"
<IfModule mod_fastcgi.c>
  ScriptAlias /myfcgi "C:/path to your fcgi application/yourfcgi.exe"
  <Directory "C:/path to your fcgi application">
    SetHandler fastcgi-script
    Order allow,deny
    Allow from all
  </Directory>
  FastCgiExternalServer "C:/path to your fcgi application/yourfcgi.exe" -host
127.0.0.1:2015 -idle-timeout 30 -flush
</IfModule>

Note, the port number in the .conf file and in your app must match

3. Restart your Apache
4. Start up your FCGI application in a command prompt window or from Lazarus
if you want to run in debug mode
5. Open your web browser and go try to call your FCGI application
(ex: http://127.0.0.1:8080/myfcgi/ActionName )

AB

Yes, I followed all these steps, but error again.

My steps:

1. Stop Apache;
2. Download the "mod_fastcgi-2.4.6-AP22.dll" and copy to
"C:\xampp\apache\modules";
3. Adds in the "C:\xampp\apache\conf\httpd.conf":
   LoadModule fastcgi_module 
"C:/xampp/apache/modules/mod_fastcgi-2.4.6-AP22.dll"
   <IfModule mod_fastcgi.c>
    ScriptAlias /myfcgi "C:/xampp/htdocs/fcgi/test.fcgi"
    <Directory "C:/xampp/htdocs/fcgi">
      SetHandler fastcgi-script
      Order allow,deny
      Allow from all
    </Directory>
    FastCgiExternalServer "C:/xampp/htdocs/fcgi/test.fcgi" -host
127.0.0.1:2015 -idle-timeout 30 -flush
   </IfModule>
4. Start Apache;
5. Open CMD, and run command "C:\xampp\htdocs\fcgi\test.fcgi";
6. Open the link "http://127.0.0.1:8080/fcgi/test.fcgi"; (tested
"http://127.0.0.1:2015/fcgi/test.fcgi"; too, without success);

The result of steps above:
"Not found
The requested URL /fcgi/test.fcgi was not found on this server".

I send my new demo (source and .fcgi) here: http://www.sendspace.com/file/hk29na

My Apache is:

Apache Version  Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o
mod_fastcgi/2.4.6 PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
Apache API Version      20051115
Hostname:Port   localhost:80
Max Requests    Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts        Connection: 300 - Keep-Alive: 5
Virtual Server  No
Server Root     C:/xampp/apache
Loaded Modules  core mod_win32 mpm_winnt http_core mod_so mod_actions
mod_alias mod_asis mod_auth_basic mod_auth_digest mod_authn_default
mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host
mod_authz_user mod_autoindex mod_cgi mod_dav_lock mod_dir mod_env
mod_headers mod_include mod_info mod_isapi mod_log_config mod_mime
mod_negotiation mod_proxy mod_proxy_ajp mod_rewrite mod_setenvif
mod_ssl mod_status mod_fastcgi mod_php5 mod_perl

AB, thanks for your step by step. :)


Try

http://127.0.0.1:8080/myfcgi/index

instead, because that is why we did the ScriptAlias, so the calling URL is simpler.

AB


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to