[fossil-users] Problem with Fossil and CGI
Hello I'm trying to get Fossil to work with CGI using Hiawatha webserver. I'm using the following CGI script: #!/usr/bin/fossil repository: /var/www/fossil/test.fossil When I access it /fossil.cgi I, my browser now says it is at /fossil.cgi/index and I get an 404. The following test cgi script works fine #!/bin/bash echo Content-Type: text/plain echo echo Hello world wide web. fossil server test.fossil works fine. I'm using fossil version [9816a66a52] 2010-01-27 15:52:57 UTC Thanks ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Problem with Fossil and CGI
On Sat, Nov 20, 2010 at 7:36 AM, Richard Hipp d...@sqlite.org wrote: 2010/11/20 Søren Enevoldsen senevoldse...@gmail.com Hello I'm trying to get Fossil to work with CGI using Hiawatha webserver. I'm using the following CGI script: #!/usr/bin/fossil repository: /var/www/fossil/test.fossil When I access it /fossil.cgi I, my browser now says it is at /fossil.cgi/index and I get an 404. The following test cgi script works fine #!/bin/bash echo Content-Type: text/plain echo echo Hello world wide web. Please add: env | sort to the bottom of the test.cgi script and post the output. Thanks. Also, please send the output of the test.cgi as modified above but accessed using http://whatever/test.cgi/index.html fossil server test.fossil works fine. I'm using fossil version [9816a66a52] 2010-01-27 15:52:57 UTC Thanks ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Problem with Fossil and CGI
The output I get is: -- Hello world wide web. DOCUMENT_ROOT=/var/www/html GATEWAY_INTERFACE=CGI/1.1 HTTPS=off HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING=gzip,deflate HTTP_ACCEPT_LANGUAGE=da,en-us;q=0.7,en;q=0.3 HTTP_HOST=www.my-domain.dk HTTP_RETURN_CODE=200 HTTP_SCHEME=http HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 6.0; da; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729) PWD=/var/www/html REDIRECT_STATUS=200 REMOTE_ADDR=my-ip REQUEST_METHOD=GET REQUEST_URI=/test.cgi SCRIPT_FILENAME=/var/www/html/test.cgi SCRIPT_NAME=/test.cgi SERVER_ADDR=0.0.0.0 SERVER_NAME=www.my-domain.dk SERVER_PORT=80 SERVER_PROTOCOL=HTTP/1.1 SERVER_SOFTWARE=Hiawatha v7.4 SHLVL=1 _=/usr/bin/env - Richard Hipp wrote: On Sat, Nov 20, 2010 at 7:36 AM, Richard Hipp d...@sqlite.org mailto:d...@sqlite.org wrote: 2010/11/20 Søren Enevoldsen senevoldse...@gmail.com mailto:senevoldse...@gmail.com Hello I'm trying to get Fossil to work with CGI using Hiawatha webserver. I'm using the following CGI script: #!/usr/bin/fossil repository: /var/www/fossil/test.fossil When I access it /fossil.cgi I, my browser now says it is at /fossil.cgi/index and I get an 404. The following test cgi script works fine #!/bin/bash echo Content-Type: text/plain echo echo Hello world wide web. Please add: env | sort to the bottom of the test.cgi script and post the output. Thanks. Also, please send the output of the test.cgi as modified above but accessed using http://whatever/test.cgi/index.html fossil server test.fossil works fine. I'm using fossil version [9816a66a52] 2010-01-27 15:52:57 UTC Thanks ___ fossil-users mailing list fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org mailto:d...@sqlite.org -- D. Richard Hipp d...@sqlite.org mailto:d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Problem with Fossil and CGI
I'm browsing it on a computer running Windows, the server is Linux. Maybe Firefox decides that the line-feed should be preceeded by a carriage return? Not that it matter for this script. Stephan Beal wrote: 2010/11/20 Søren Enevoldsen senevoldse...@gmail.com mailto:senevoldse...@gmail.com The following test cgi script works fine #!/bin/bash echo Content-Type: text/plain echo echo Hello world wide web. i wouldn't expect this to work at all unless you're on a Windows machine: HTTP specifies carriage-return/line-feed, not just line-feed (which is what echo spits out). -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Problem with Fossil and CGI
Thank you very much for your help. It was indeed not configured correctly. An option, EnablePathInfo was disabled by default. Enabling it seems to have solved. Richard Hipp wrote: 2010/11/20 Søren Enevoldsen senevoldse...@gmail.com mailto:senevoldse...@gmail.com From http://www.my-domain.dk/test.cgi/index I get and 404 error just like fossil.cgi gives me. That shows that either Hiawatha is not doing CGI correctly or that you have Hiawatha configured incorrectly. For the URL above, it should run the script at test.cgi then set the PATH_INFO environment variable to /index Richard Hipp wrote: 2010/11/20 Søren Enevoldsen senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com The output I get is: And, what output do you get for http://.../test.cgi/index; ? -- Hello world wide web. DOCUMENT_ROOT=/var/www/html GATEWAY_INTERFACE=CGI/1.1 HTTPS=off HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING=gzip,deflate HTTP_ACCEPT_LANGUAGE=da,en-us;q=0.7,en;q=0.3 HTTP_HOST=www.my-domain.dk http://www.my-domain.dk http://www.my-domain.dk HTTP_RETURN_CODE=200 HTTP_SCHEME=http HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 6.0; da; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729) PWD=/var/www/html REDIRECT_STATUS=200 REMOTE_ADDR=my-ip REQUEST_METHOD=GET REQUEST_URI=/test.cgi SCRIPT_FILENAME=/var/www/html/test.cgi SCRIPT_NAME=/test.cgi SERVER_ADDR=0.0.0.0 SERVER_NAME=www.my-domain.dk http://www.my-domain.dk http://www.my-domain.dk SERVER_PORT=80 SERVER_PROTOCOL=HTTP/1.1 SERVER_SOFTWARE=Hiawatha v7.4 SHLVL=1 _=/usr/bin/env - Richard Hipp wrote: On Sat, Nov 20, 2010 at 7:36 AM, Richard Hipp d...@sqlite.org mailto:d...@sqlite.org mailto:d...@sqlite.org mailto:d...@sqlite.org mailto:d...@sqlite.org mailto:d...@sqlite.org mailto:d...@sqlite.org mailto:d...@sqlite.org wrote: 2010/11/20 Søren Enevoldsen senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com mailto:senevoldse...@gmail.com Hello I'm trying to get Fossil to work with CGI using Hiawatha webserver. I'm using the following CGI script: #!/usr/bin/fossil repository: /var/www/fossil/test.fossil When I access it /fossil.cgi I, my browser now says it is at /fossil.cgi/index and I get an 404. The following test cgi script works fine #!/bin/bash echo Content-Type: text/plain echo echo Hello world wide web. Please add: env | sort to the bottom of the test.cgi script and post the output. Thanks. Also, please send the output of the test.cgi as modified above but accessed using http://whatever/test.cgi/index.html fossil server test.fossil works fine. I'm using fossil version [9816a66a52] 2010-01-27 15:52:57 UTC Thanks ___ fossil-users mailing list fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org mailto:fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org mailto:d...@sqlite.org
Re: [fossil-users] Problem with Fossil and CGI
The developer of Hiawatha suggested that using URL rewriting might be a better method than PATH_INFO. What is your thoughts on that? ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] Problem with Fossil and CGI
On 11/20/2010 11:01 AM, Søren Enevoldsen wrote: The developer of Hiawatha suggested that using URL rewriting might be a better method than PATH_INFO. What is your thoughts on that? PATH_INFO is a very, very common requirement for CGI programs. In Apache and Lighttpd (at least) it 'just works'. Even in Hiawatha it worked fine once you turned it on. It's true that (e.g.) PHP frameworks tend to rely on URL rewriting for prettier URLs, but URL rewriting is done differently on every server. For integrating a CGI program into just about any web setup with minimal configuration changes, PATH_INFO wins easily. -- Joshua Paine LetterBlock: Web applications built with joy http://letterblock.com/ 301-576-1920 ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users