Recent

Author Topic: FreeSpider 1.1.0 released  (Read 60874 times)

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #60 on: October 07, 2010, 12:20:46 pm »
no, you could use any alias name instead of cgi-bin
It seems that your default root directory can execute CGI applications.
If you are using forms, then you can use something like this:

Code: [Select]
<form action="/demo.cgi" method=POST>

could you post here some the code please to trace what is the problem.
Also I need the error that you got in browser and the URL at that time.

Motaz


« Last Edit: October 07, 2010, 12:23:02 pm by motaz »

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: FreeSpider 1.1.0 released
« Reply #61 on: October 08, 2010, 03:21:37 pm »
I am not sure whether nginx works differently or not but I get am getting a 404 file not found error, so I suspect that without the /cgi-bin/ nginx is looking for a directory name like /spidersample.cgi/hello etc.

Perhaps nginx requires directives to treat spidersample.cgi as the executable rather than try to locate something else below it.

When I use /spidersample.cgi?hello I get the same page as /spidersample.cgi alone but the ?hello is obviously not processed. I will inquire and get back to you.

no, you could use any alias name instead of cgi-bin
It seems that your default root directory can execute CGI applications.
If you are using forms, then you can use something like this:

Code: [Select]
<form action="/demo.cgi" method=POST>

could you post here some the code please to trace what is the problem.
Also I need the error that you got in browser and the URL at that time.

Motaz



Lazarus 3.0/FPC 3.2.2

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: FreeSpider 1.1.0 released
« Reply #62 on: October 09, 2010, 12:02:56 am »
There is something else I forgot to ask.

If the URL is entered in this form /spidersample.cgi?hello, shouldn't work? the /hello etc appear to be hard coded, but aren't they just a nicer way of expressing /spidersample.cgi?hello  ?

edit: I have suspect that the URL handling code may be depending on some builtin or some rewrite rule present in the default Apache configuration, which is why it is failing on nginx. The above ought to work, but the /path appears to be hardcoded in the TSpiderAction.

no, you could use any alias name instead of cgi-bin
It seems that your default root directory can execute CGI applications.
If you are using forms, then you can use something like this:

Code: [Select]
<form action="/demo.cgi" method=POST>

could you post here some the code please to trace what is the problem.
Also I need the error that you got in browser and the URL at that time.

Motaz



« Last Edit: October 09, 2010, 08:43:41 am by vfclists »
Lazarus 3.0/FPC 3.2.2

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #63 on: October 09, 2010, 10:38:07 am »
Quote
If the URL is entered in this form /spidersample.cgi?hello, shouldn't work? the /hello etc appear to be hard coded, but aren't they just a nicer way of expressing /spidersample.cgi?hello  ?

?hello is a query parameter, you should use like spidersample.cgi?name=motaz&address=Khartoum
but /hello means path, which can be accessed using SpiderAction component:
you could use path + query parameters like this:

spidersample.cgi/hello?name=motaz&Address=Khartoum
if you omit action name (/hello) then all your requests will go to main SipderCGI OnRequest event.



If you want not to hard code application name you could use this function which extracts actual executable name:

Code: [Select]
ExtractFileName(ParamStr(0));
« Last Edit: October 09, 2010, 10:58:31 am by motaz »

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: FreeSpider 1.1.0 released
« Reply #64 on: October 09, 2010, 11:24:11 am »
I have been doing some reading and it appears that my nginx rules are not up to scratch regarding the handling of PATH_INFO, working out the $script_filename and few other things besides. I will do some more reading, try it out and get back to you.

I need to switch to nginx because of very low memory usage compared with Apache so I need to do more work to make things compatible

Regards

/vfclists

Quote
If the URL is entered in this form /spidersample.cgi?hello, shouldn't work? the /hello etc appear to be hard coded, but aren't they just a nicer way of expressing /spidersample.cgi?hello  ?

?hello is a query parameter, you should use like spidersample.cgi?name=motaz&address=Khartoum
but /hello means path, which can be accessed using SpiderAction component:
you could use path + query parameters like this:

spidersample.cgi/hello?name=motaz&Address=Khartoum
if you omit action name (/hello) then all your requests will go to main SipderCGI OnRequest event.



If you want not to hard code application name you could use this function which extracts actual executable name:

Code: [Select]
ExtractFileName(ParamStr(0));
Lazarus 3.0/FPC 3.2.2

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: FreeSpider 1.1.0 released
« Reply #65 on: October 09, 2010, 09:20:22 pm »
I had to change some configuration settings in the nginx.conf file, and the links are working correctly

What is happening now is the content is generated twice, so the same content is repeated one on top of the other. Even after adding Response.Content.Clear at the top of OnRequest event. It is still doubled up. The second repeat is preceded by

EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
CONTENT-TYPE: TEXT/HTML

This happens with both Apache and Nginx

The version I am using is 1.2.3 on Ubuntu 8.04

Another point concerning compilation is that smart linking is turned on in the Project's compiler options, and it is causing high memory usage and the swap file gets filled up

Can it also be debugged while running?

Quote
If the URL is entered in this form /spidersample.cgi?hello, shouldn't work? the /hello etc appear to be hard coded, but aren't they just a nicer way of expressing /spidersample.cgi?hello  ?

?hello is a query parameter, you should use like spidersample.cgi?name=motaz&address=Khartoum
but /hello means path, which can be accessed using SpiderAction component:
you could use path + query parameters like this:

spidersample.cgi/hello?name=motaz&Address=Khartoum
if you omit action name (/hello) then all your requests will go to main SipderCGI OnRequest event.



If you want not to hard code application name you could use this function which extracts actual executable name:

Code: [Select]
ExtractFileName(ParamStr(0));
Lazarus 3.0/FPC 3.2.2

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #66 on: October 10, 2010, 06:32:42 am »
Quote
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
CONTENT-TYPE: TEXT/HTML
make sure you have set Compiler's option target to <b>NoGUI</b>

Quote
I have been doing some reading and it appears that my nginx rules are not up to scratch regarding the handling of PATH_INFO, working out the $script_filename and few other things besides. I will do some more reading, try it out and get back to you

I've tested FreeSpider with apache in Windows and Linux. Apache is supporting CGI protocol without problem and without doing any additional configuration.
Since you have the source, you could modify PATH_INFO environmental variable by script_filename.

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: FreeSpider 1.1.0 released
« Reply #67 on: October 10, 2010, 08:27:04 pm »
Quote
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
EnumFontFamiliesEx is not yet implemented for this widgetset
CONTENT-TYPE: TEXT/HTML
make sure you have set Compiler's option target to <b>NoGUI</b>
The NoGUI section is already set. The main point is that the content is displayed twice.

Quote
I've tested FreeSpider with apache in Windows and Linux. Apache is supporting CGI protocol without problem and without doing any additional configuration.
Since you have the source, you could modify PATH_INFO environmental variable by script_filename.

This part is working fine, I had to make some changes in the nginx configuration.
Lazarus 3.0/FPC 3.2.2

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #68 on: October 11, 2010, 06:42:25 am »
CONTENT-TYPE: TEXT/HTML shouldn't appear in web browser. It is part of header. Since you have get it in browser, that means there are additions before header.

about Nginx, if I had a time, I could test it, then port FreeSpider to work with it.

motaz

  • Sr. Member
  • ****
  • Posts: 495
    • http://code.sd
Re: FreeSpider 1.1.0 released
« Reply #69 on: October 21, 2010, 09:00:52 am »
vfclists,
When I get last version of Lazarus from Trunk, I get EnumFontFamiliesEx is not yet implemented for this widgetset" error.
Then I removed some units from spidersample application, then it works.
I'll upload modified spidersample, you can download it or update the main project file by this:

Code: [Select]
program spidersample;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes, Interfaces
  { you can add units after this }, main, MemDSLaz;

begin
  DataModule1:= TDataModule1.Create(nil) ;
end.


 

TinyPortal © 2005-2018