Recent

Author Topic: [SOLVED] Brook, Linux and apache2  (Read 3125 times)

iru

  • Sr. Member
  • ****
  • Posts: 321
[SOLVED] Brook, Linux and apache2
« on: September 05, 2014, 03:46:51 am »
Gentlefolk,

Environment: Mint 17 Linux, FPC 2.6.4, LAZ 1.2.4, Brook 3.0, Apache2.4.7, FireFox 28.0.

Accessing /var/www/html/index.html via FireFox (localhost/index.html) works correctly. Page displayed.

Using the "demo/chat" project.

Chat compiles clean. Save the executable "chat.bf" in /var/www/html. Permissions let everybody get at the file.

When I access "chat.bf" in FireFox with "localhost/chat.bf" I get a prompt form asking about saving "chat.bf".
Same result when I use the "Opera" browser.

I have read "wiki.freepascal.org/CGI-Web_Programming, httpd.apache.org/docs/current/howto/cgi.html and wiki.apache.org/httpd/FAQ and various forum entries on Brook. There is a FAQ which addresses this "trigger a save window with netscape". Something to do with a mime type of application/octet-stream or text/plain violating the HTTP standard.
Tried some of the suggested solutions to the best of my knowledge/ability. No change.

The "chat.bf" seems OK. If I execute REQUEST_METHOD=GET ./chat.bf I get the following response
X-Powered-By: Brook framework and FCL-Web.
Status: 302 Found
Content-Type:  text/html; charset=uft-8
Location: /login

Which to me (with limited knowledge) indicates "chat.bf" is OK.

A version of "chat.bf" on the embedded server works OK.

What is the problem? Where do I look? What debug can I invoke?

Any help appreciated, Ian



« Last Edit: September 05, 2014, 07:57:11 am by iru »

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: Brook, Linux and apache2
« Reply #1 on: September 05, 2014, 03:53:42 am »
Gentlefolk,

Woops, the screen rolled down and I see the forum entry "FCGI (FastCGI) step by step, using fpweb/fcl-web for Windows/Linux" which addresses lots of things which may help me.

Some more reading and fiddling.....

Ian

iru

  • Sr. Member
  • ****
  • Posts: 321
Re: Brook, Linux and apache2
« Reply #2 on: September 05, 2014, 07:56:22 am »
Gentlefolk,

Worked my way through the forum entry "FCGI (FastCGI) step by step, using fpweb/fcl-web for Windows/Linux" which addresses lots of things.

Slowly the error messages changed as I changed the apache config: Apache config errors, internal system errors, end of header, you do not have permission,............

Realised there are  differences between CGI and FastCGI. Created a FastCGI project, compiled and saved off the executable.

It works!!!!! No errors or stray "save" forms anywhere.

Ian.



Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [SOLVED] Brook, Linux and apache2
« Reply #3 on: September 05, 2014, 09:21:29 am »
CGI should also work in Apache. You just have to configure or check your current configuration from which directory Apache will execute CGI. Put it in a wrong dir, and Apache will think you want to download the file, because of the mimetype.COMPILER

 

TinyPortal © 2005-2018