Recent

Author Topic: FreeSpider 1.1.0 released  (Read 60869 times)

davesimplewear

  • Sr. Member
  • ****
  • Posts: 321
    • Davids Freeware
Re: FreeSpider 1.1.0 released
« Reply #15 on: February 23, 2010, 07:36:22 am »
where is the spider example program, I tried what is listed in your help file, but there is a permissions  problem with Linux, because the web server is root access.
All things considered insanity seems the best option

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #16 on: February 23, 2010, 08:55:29 am »
This is the link to SpiderSample http://motaz.freevar.com/spidersample.zip

in Linux you can produce the executable in your home directory then, go to terminal su to root (or sudo) then copy the file to /cgi-bin directory
or your can give others in /cgi-bin write access

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: FreeSpider 1.1.0 released
« Reply #17 on: February 23, 2010, 09:20:05 am »

Thats right, it is spidersample without extension. But I added the .cgi extension (spidersample.cgi).
So executing the spidersample.cgi application has not any problem, after executing the application, the links give the previously mentioned problem.
Thanks.

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #18 on: February 23, 2010, 09:53:20 am »
please remove the .cgi extension, because inside application sample hello is exist under this link: /cgi-bin/spidersample/hello


motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #19 on: February 23, 2010, 09:57:01 am »
To Zahir
Thanks for the link, but SourceFourge has granted project managers the rights to restrict or allow such countries, so that Lazarus team can allow our countries to download.

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: FreeSpider 1.1.0 released
« Reply #20 on: February 23, 2010, 09:58:53 am »
Here is the output of the spidersample.cgi execution and the error occurs when the link clicked.
Thanks.

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #21 on: February 23, 2010, 11:14:49 am »
You should remove .cgi from executable name

davesimplewear

  • Sr. Member
  • ****
  • Posts: 321
    • Davids Freeware
Re: FreeSpider 1.1.0 released
« Reply #22 on: February 23, 2010, 12:49:06 pm »
it compiled, did the localhost/spider example and get:
Quote
Not Found

The requested URL /cgi-bin/spiderexample was not found on this server.
Apache/2.2.12 (Ubuntu) Server at localhost Port 80
Ok thats because it is saved to /usr/lib/cgi-bin and webserver is /var/www/cgi-bin where can I change the path to save it to the right place?

Regards
Dave
All things considered insanity seems the best option

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #23 on: February 23, 2010, 01:04:29 pm »
you should change path from Project/Project Options/Target file Name
write on it /var/www/cgi-bin/spidersample

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: FreeSpider 1.1.0 released
« Reply #24 on: February 23, 2010, 01:44:33 pm »

motaz, why should I remove the .cgi extension?
Could you please explain what is the difference between these two? (with .cgi and without)
Thanks.

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #25 on: February 23, 2010, 02:02:06 pm »
because in FreeSpider sample (spidersample) assume that the executable name is spidersample, so that when you click on Hello World link it will send this query:

/cgi-bin/spidersample/hello

If you don't want to change .cgi extension, then you should add const part of main unit code by this :

Code: [Select]
  ExePath = '/cgi-bin/spidersample.cgi';

then const part will be like this:

Code: [Select]
const

{$IFDEF UNIX}
  ExePath = '/cgi-bin/spidersample';
{$ENDIF}

{$IFDEF WINDOWS}
  ExePath = '/cgi-bin/spidersample.exe';
{$ENDIF}
 
  ExePath = '/cgi-bin/spidersample.cgi';


motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #26 on: February 23, 2010, 02:05:54 pm »
or you can remove all const part and replace it only by:

Code: [Select]
const
   ExePath = '/cgi-bin/spidersample.cgi';

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: FreeSpider 1.1.0 released
« Reply #27 on: February 23, 2010, 02:34:23 pm »

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.


motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #28 on: February 23, 2010, 03:04:16 pm »
Good to know that it finally work.

did you check it without .cgi extension?
.cgi extension is for perl extension, but FPC/FreeSpider produces an executable that uses CGI protocol.

About the compiler directive for Mac, I've searched the documentation about Mac directive, but I didn't found it. May be FPC/Lazarus team can answer this question.

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: FreeSpider 1.1.0 released
« Reply #29 on: February 23, 2010, 07:51:20 pm »

I executed the spidersample without .cgi extension.
Here is the trick, in the apache configuration file I comment the following line which is AddHandler. I hope this could be the solution.
Thanks.

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
#AddHandler cgi-script .cgi

 

TinyPortal © 2005-2018