[SOLVED] Brook, Linux and apache2 lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- iru · 2014-09-05 01:46 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 ---------------------------------------------------------------------- iru · 2014-09-05 01:53 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 · 2014-09-05 05:56 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 · 2014-09-05 07:21 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