Hi motaz, thanks for the explanation. Now mostly everything is clear now. In Mac OS X Leopard (also in Snow Leopard) the Apache2 configuration is a little bit different than the other Unixes. So in the configuration file which is /etc/httpd.conf there are statements like this.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"
#
# "/Library/WebServer/CGI-Executables" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/Library/WebServer/CGI-Executables">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Briefly I changed the source code as you mentioned.
{$IFDEF UNIX}
ExePath = '/cgi-bin/spidersample.cgi';
{$ENDIF}
When calling the application from
http://127.0.0.1/cgi-bin/spidersample.cgi, links are working as usual. I hope this give an idea.
P.S. Is there any special IFDEF for MacOSX?
Thanks.