One year or so ago, I contacted this list about running Gambit on Linux (I compiled the programs on Zorin/Ubuntu, and tried to run them on a choice of Linux hosting services). My programs work perfectly well in about every Scheme compiler, except Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus, Vicare, Chez, to name a few. The programs also run on Dorai's Scheme to Common Lisp compiler. I tried the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc. However, they don't run on Gambit. Although the production code is quite complex (for instance, it includes Serrano's sqlite clone), I wrote a very simple example in order to show what the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline) (newline) (display "<html><body>Teste:") (newline) (display "<h1>Hello</h1>") (newline) (display "</html></body>") (newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
One year ago, Marc Feeley was kind enough to try to run the above program in one of the five hosting services I use. It seems that he was not able to run it either. In any case, I followed each and every suggestion I received both from the list, and from private contacts. A few suggestions:
1 -- Compile gsi in order to get a completely static exec file. People proposed many compilation schemes, like LDFLAGS='-static', etc. None worked.
2 -- Compile in a machine with exactly the same libc of the hosting service.
3 -- Change hosting service. I tried: Hostgator, Mecca Hosting, Go Daddy, UFU, and many others.
4 -- Use a complete path for gsi.
etc. etc.
I hoped that after one year, and a couple of Gambit versions, somebody had solved the problem. However, I tested the simple program again, and it still does not work.
Since the program is working well in Bigloo, and SBCL, I suppose that I will not switch to Gambit (specially now that SBCL generates tiny stand alones, all using the same sbcl.core library). However, I am curious about the reasons for even simple internet Gambit programs not working on popular hosting services. I will be pleased if somebody who discovered what the problem is could share his knowledge.
Afficher les réponses par date
On Fri, Feb 08, 2013 at 01:47:14AM -0200, Eduardo Costa wrote:
One year or so ago, I contacted this list about running Gambit on Linux (I compiled the programs on Zorin/Ubuntu, and tried to run them on a choice of Linux hosting services). My programs work perfectly well in about every Scheme compiler, except Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus, Vicare, Chez, to name a few. The programs also run on Dorai's Scheme to Common Lisp compiler. I tried the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc. However, they don't run on Gambit. Although the production code is quite complex (for instance, it includes Serrano's sqlite clone), I wrote a very simple example in order to show what the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline) (newline) (display "<html><body>Teste:") (newline) (display "<h1>Hello</h1>") (newline) (display "</html></body>") (newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
I don't know what server might be complaining, but your tags are not properly nested., aand it looks as if a few are missing. For example, at the start, <body> is nested within <html>, and at thhe end, </html> is nested within </body>.
Als0, shouldn't there be some kind of tag around Content-type: text/html
Sorry if I haven't found a problem with Gambit, but it seems to me there are problems in what you're asking it to do.
-- hendrik
Hendrik Boom writes:
On Fri, Feb 08, 2013 at 01:47:14AM -0200, Eduardo Costa wrote:
One year or so ago, I contacted this list about running Gambit on Linux (I compiled the programs on Zorin/Ubuntu, and tried to run them on a choice of Linux hosting services). My programs work perfectly well in about every Scheme compiler, except Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus, Vicare, Chez, to name a few. The programs also run on Dorai's Scheme to Common Lisp compiler. I tried the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc. However, they don't run on Gambit. Although the production code is quite complex (for instance, it includes Serrano's sqlite clone), I wrote a very simple example in order to show what the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline) (newline) (display "<html><body>Teste:") (newline) (display "<h1>Hello</h1>") (newline) (display "</html></body>") (newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
I don't know what server might be complaining, but your tags are not properly nested., aand it looks as if a few are missing. For example, at the start, <body> is nested within <html>, and at thhe end, </html> is nested within </body>.
Als0, shouldn't there be some kind of tag around Content-type: text/html
Sorry if I haven't found a problem with Gambit, but it seems to me there are problems in what you're asking it to do.
There mustn't be tags around an HTTP header line, but might it have something to do about (newline) producing only \n when HTTP wants \r\n? Just a wild guess, and I don't see why that would happen only in Gambit.
Another possibility is that Gambit needs some environment variable that is not set properly when the web server tries to execute ./gsi - I assume that the script executes properly when run manually. Just another wild guess.
The mixed HTML tags should not be a server error, though in a better world they would make every major browser display an error message.
Eduardo Costa <edu500ac <at> gmail.com> writes:
One year or so ago, I contacted this list about running Gambit on
Linux (I
compiled the programs on Zorin/Ubuntu, and tried to run them on a
choice of
Linux hosting services). My programs work perfectly well in about
every
Scheme compiler, except Gambit.
[snip]
Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.
[snip]
I find this error very disturbing, and decided (for my own sanity) to drill down. I adopted Gambit-C as my primary programming environment around six months ago, because it integrates well with C, is very platform neutral(runs on iOS, Android, Unix, Linux, Windows, etc.), is performance oriented, and is actively supported. I had just been working with Gambit-C as its own web server, but didn't see why it couldn't be used under Apache as a CGI script. So, I decided to "tackle" this issue. My intention is to deploy Gambit-C with different interfaces: sockets or pipes, as an Apache CGI, as a stand-alone web service that Apache forwards to ("middleware"), and with a stand-alone GUI. I see no reason why the Apache CGI isn't working for you, except for mis-configured Apache or Linux security.
I have tried to isolate the deployment of a compiled Gambit-C application into 3 main steps:
- deploy a simple BASH script - deploy Gambit-C interpreted (gsi) script - deploy compiled Gambit-C application
I do not go into Apache configuration; only if the simple BASH script doesn't work do we need to consider this.
The error (I am presuming code 500) can come from a variety of things.
Check the Apache logs (typically /var/log/httpd/error_log). If using SELinux some additional things need to happen (assuming you are copying your script to /var/www/cgi-bin). I would start with a simple "Hello, world" shell script -
#!/bin/bash # Make sure there is an empty line after Content-type echo "Content-type: text/html" echo echo "Hello, world"
You seem to have this covered; but look at the LACK of markup in the sample! Check the error_log, and if (as I suspect) it isn't executable:
Apache runs scripts as "nobody" or "apache":
# optional ownership change chown apache:apache cgi.sh # make sure everybody can execute chmod a+x cgi.sh
If it still complains (please look at error_log), you may need some SELinux kung-fu:
# Allow Apache to execute scripts # Only need to do this once... setsebool -P httpd_enable_cgi 1
# Restore httpd_sys_script_exec_t context to cgi.sh # (if the file was copied in from elsewhere...) cd /var/www/cgi-bin restorecon cgi.sh
(commands may be in /sbin)
Now, try the cgi.sh script: http://localhost/cgi-bin/cgi.sh This shoud work, and give you a "Hello, World". If not, post error_log, etc. We may need to dig into Apache configuration, but these instructions should cover RHEL (and derivative) OSs.
If cgi.sh works, we can go to the next step:
cp cgi.sh cgi.scm
(which copies the SELinux context as well) and make it a Gambit-C file:
#!/usr/bin/gsi (display "Content-type: text/html") (newline) (newline) (display "Hello, World from gsi") (newline)
and that is pretty much all there is to it! (for recent RHEL and Fedora with SELinux enforcing). Note the utter lack of tags -- keep it simple.
and, of course, test by browsing to http://localhost/cgi-bin/cgi.scm
Hello, World from gsi
The final step is compiling the script:
gsc -exe cgi.scm
(but add -:d- to the shebang line first)
Since "cgi" was compiled IN the correct directory, it should be SELinux tagged correctly. If it was compiled "out of directory", you will need:
restorecon -v cgi
And test with http://localhost/cgi-bin/cgi
Hello, World from gsi *** ERROR -- Unbound variable: main
Now, if you leave off the -:d-, you will see it in the apache error_log:
[Mon Feb 11 22:48:38 2013] [error] [client 127.0.0.1] *** FATAL ERROR -- No controlling terminal (try using the -:d- runtime option) [Mon Feb 11 22:48:38 2013] [error] [client 127.0.0.1] Premature end of script headers: cgi
If you still have problems:
[fred@dejah cgi-bin]$ ldd cgi linux-vdso.so.1 => (0x00007fff1697b000) libutil.so.1 => /lib64/libutil.so.1 (0x0000003694000000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003ebc000000) libm.so.6 => /lib64/libm.so.6 (0x0000003687000000) libc.so.6 => /lib64/libc.so.6 (0x0000003686000000) /lib64/ld-linux-x86-64.so.2 (0x0000003685c00000)
Hopefully, you are statically linking libgambc.a (cgi will be 5mb or so). If more performance is needed, we can deal with that. Running the cgi binary manually should also work!
[fred@dejah cgi-bin]$ ./cgi Content-type: text/html
Hello, World from gsi *** ERROR -- Unbound variable: main [fred@dejah cgi-bin]$
Now, I don't know how running with the Gambit-C library as a shared ".so" would work (haven't tried, but it should be pretty much the same), because I use the gsc that is supplied with my OS.
What I find remarkable is that the "other" Scheme implementations actually worked.
Fred Weigel
Wow... that's a really thorough analysis!
Let me just add that the error message "*** ERROR -- Unbound variable: main" can be avoided by
1) adding a (define (main) 0) 2) adding a (exit) 3) removing the name "gsi" from the shebang line, for example: #! -:d-
Marc
On 2013-02-12, at 3:04 AM, Fred Weigel fred_weigel@hotmail.com wrote:
Eduardo Costa <edu500ac <at> gmail.com> writes:
One year or so ago, I contacted this list about running Gambit on
Linux (I
compiled the programs on Zorin/Ubuntu, and tried to run them on a
choice of
Linux hosting services). My programs work perfectly well in about
every
Scheme compiler, except Gambit.
[snip]
Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.
[snip]
I find this error very disturbing, and decided (for my own sanity) to drill down. I adopted Gambit-C as my primary programming environment around six months ago, because it integrates well with C, is very platform neutral(runs on iOS, Android, Unix, Linux, Windows, etc.), is performance oriented, and is actively supported. I had just been working with Gambit-C as its own web server, but didn't see why it couldn't be used under Apache as a CGI script. So, I decided to "tackle" this issue. My intention is to deploy Gambit-C with different interfaces: sockets or pipes, as an Apache CGI, as a stand-alone web service that Apache forwards to ("middleware"), and with a stand-alone GUI. I see no reason why the Apache CGI isn't working for you, except for mis-configured Apache or Linux security.
I have tried to isolate the deployment of a compiled Gambit-C application into 3 main steps:
- deploy a simple BASH script
- deploy Gambit-C interpreted (gsi) script
- deploy compiled Gambit-C application
I do not go into Apache configuration; only if the simple BASH script doesn't work do we need to consider this.
The error (I am presuming code 500) can come from a variety of things.
Check the Apache logs (typically /var/log/httpd/error_log). If using SELinux some additional things need to happen (assuming you are copying your script to /var/www/cgi-bin). I would start with a simple "Hello, world" shell script -
#!/bin/bash # Make sure there is an empty line after Content-type echo "Content-type: text/html" echo echo "Hello, world"
You seem to have this covered; but look at the LACK of markup in the sample! Check the error_log, and if (as I suspect) it isn't executable:
Apache runs scripts as "nobody" or "apache":
# optional ownership change chown apache:apache cgi.sh # make sure everybody can execute chmod a+x cgi.sh
If it still complains (please look at error_log), you may need some SELinux kung-fu:
# Allow Apache to execute scripts # Only need to do this once... setsebool -P httpd_enable_cgi 1
# Restore httpd_sys_script_exec_t context to cgi.sh # (if the file was copied in from elsewhere...) cd /var/www/cgi-bin restorecon cgi.sh
(commands may be in /sbin)
Now, try the cgi.sh script: http://localhost/cgi-bin/cgi.sh This shoud work, and give you a "Hello, World". If not, post error_log, etc. We may need to dig into Apache configuration, but these instructions should cover RHEL (and derivative) OSs.
If cgi.sh works, we can go to the next step:
cp cgi.sh cgi.scm
(which copies the SELinux context as well) and make it a Gambit-C file:
#!/usr/bin/gsi (display "Content-type: text/html") (newline) (newline) (display "Hello, World from gsi") (newline)
and that is pretty much all there is to it! (for recent RHEL and Fedora with SELinux enforcing). Note the utter lack of tags -- keep it simple.
and, of course, test by browsing to http://localhost/cgi-bin/cgi.scm
Hello, World from gsi
The final step is compiling the script:
gsc -exe cgi.scm
(but add -:d- to the shebang line first)
Since "cgi" was compiled IN the correct directory, it should be SELinux tagged correctly. If it was compiled "out of directory", you will need:
restorecon -v cgi
And test with http://localhost/cgi-bin/cgi
Hello, World from gsi *** ERROR -- Unbound variable: main
Now, if you leave off the -:d-, you will see it in the apache error_log:
[Mon Feb 11 22:48:38 2013] [error] [client 127.0.0.1] *** FATAL ERROR -- No controlling terminal (try using the -:d- runtime option) [Mon Feb 11 22:48:38 2013] [error] [client 127.0.0.1] Premature end of script headers: cgi
If you still have problems:
[fred@dejah cgi-bin]$ ldd cgi linux-vdso.so.1 => (0x00007fff1697b000) libutil.so.1 => /lib64/libutil.so.1 (0x0000003694000000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003ebc000000) libm.so.6 => /lib64/libm.so.6 (0x0000003687000000) libc.so.6 => /lib64/libc.so.6 (0x0000003686000000) /lib64/ld-linux-x86-64.so.2 (0x0000003685c00000)
Hopefully, you are statically linking libgambc.a (cgi will be 5mb or so). If more performance is needed, we can deal with that. Running the cgi binary manually should also work!
[fred@dejah cgi-bin]$ ./cgi Content-type: text/html
Hello, World from gsi *** ERROR -- Unbound variable: main [fred@dejah cgi-bin]$
Now, I don't know how running with the Gambit-C library as a shared ".so" would work (haven't tried, but it should be pretty much the same), because I use the gsc that is supplied with my OS.
What I find remarkable is that the "other" Scheme implementations actually worked.
Fred Weigel
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Am 08.02.2013 04:47, schrieb Eduardo Costa:
One year or so ago, I contacted this list about running Gambit on Linux (I compiled the programs on Zorin/Ubuntu, and tried to run them on a choice of Linux hosting services). My programs work perfectly well in about every Scheme compiler, except Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus, Vicare, Chez, to name a few. The programs also run on Dorai's Scheme to Common Lisp compiler. I tried the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc. However, they don't run on Gambit. Although the production code is quite complex (for instance, it includes Serrano's sqlite clone), I wrote a very simple example in order to show what the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline) (newline) (display "<html><body>Teste:") (newline) (display "<h1>Hello</h1>") (newline) (display "</html></body>") (newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
I think the server does not find gsi. Do it like this, works fine here:
#!/usr/bin/env gsi (display "Content-Type: text/html") (newline) (newline) (display "<h1>no Problem with gsi</h1>") (newline) (display "<p>Just go ahead.</p>") (newline)
/Str.
Am 13.02.2013 15:24, schrieb Eduardo Costa:
I don't think that the problem is not finding gsi. After all, the server finds any
other Scheme, Common Lisp, Forth, etc. but fails to work with gsi. Do you think it could be a name crash? However, I tried to compile gambit as a standalone, with another name, and it did not work. By the way, I tried the complete path, as you suggested, and it didn't work either.
From: Herr misterherr@freenet.de To: gambit-list@iro.umontreal.ca Sent: Wednesday, February 13, 2013 7:08 AM Subject: Re: [gambit-list] Difficulty with Gambit
Am 08.02.2013 04:47, schrieb Eduardo Costa:
One year or so ago, I contacted this list about running Gambit on Linux (I compiled the programs on Zorin/Ubuntu, and tried to run them on a choice of Linux hosting services). My programs work perfectly well in about every Scheme compiler, except Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus, Vicare, Chez, to name a few. The programs also run on Dorai's Scheme to Common Lisp compiler. I tried the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc. However, they don't run on Gambit. Although the production code is quite complex (for instance, it includes Serrano's sqlite clone), I wrote a very simple example in order to show what the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline)
--cut
(newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
I think the server does not find gsi. Do it like this, works fine here:
#!/usr/bin/env gsi (display "Content-Type: text/html")
My first reaction: Please reply to the list, or the gmane newsgroup.
Then I think, this is clearly an installation problem, but from here I can not tell which.
The web server executes CGI programs in a separate process, so there is little linkage to web server internals. If you can execute shell scripts in the same cgi-bin directory then apache config is okay.
I get an Internal Server Error with apache when a cgi script is not executable. This can be missing x mode bits, interpreter from #!/-line not found, or even architecture mismatch 32/64 bit (here the error on the command line is file not found). Turn off apparmor and selinux.
/Str.
On 2013-02-14, at 4:35 AM, Herr misterherr@freenet.de wrote:
Am 13.02.2013 15:24, schrieb Eduardo Costa:
I don't think that the problem is not finding gsi. After all, the server finds any
other Scheme, Common Lisp, Forth, etc. but fails to work with gsi. Do you think it could be a name crash? However, I tried to compile gambit as a standalone, with another name, and it did not work. By the way, I tried the complete path, as you suggested, and it didn't work either.
From: Herr misterherr@freenet.de To: gambit-list@iro.umontreal.ca Sent: Wednesday, February 13, 2013 7:08 AM Subject: Re: [gambit-list] Difficulty with Gambit
Am 08.02.2013 04:47, schrieb Eduardo Costa:
One year or so ago, I contacted this list about running Gambit on Linux (I compiled the programs on Zorin/Ubuntu, and tried to run them on a choice of Linux hosting services). My programs work perfectly well in about every Scheme compiler, except Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus, Vicare, Chez, to name a few. The programs also run on Dorai's Scheme to Common Lisp compiler. I tried the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc. However, they don't run on Gambit. Although the production code is quite complex (for instance, it includes Serrano's sqlite clone), I wrote a very simple example in order to show what the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline)
--cut
(newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
I think the server does not find gsi. Do it like this, works fine here:
#!/usr/bin/env gsi (display "Content-Type: text/html")
My first reaction: Please reply to the list, or the gmane newsgroup.
Then I think, this is clearly an installation problem, but from here I can not tell which.
The web server executes CGI programs in a separate process, so there is little linkage to web server internals. If you can execute shell scripts in the same cgi-bin directory then apache config is okay.
I get an Internal Server Error with apache when a cgi script is not executable. This can be missing x mode bits, interpreter from #!/-line not found, or even architecture mismatch 32/64 bit (here the error on the command line is file not found). Turn off apparmor and selinux.
Here's something else you can try. Replace your script with:
#! /bin/sh echo "Content-type: text/html" echo echo "<pre>" /usr/bin/env /usr/bin/env gsi -:d- -e '(display "test\n")' echo $? echo "</pre>"
This will allow you to see what is the content of the environment variables and if any error messages are reported by gsi.
Marc
Yeah!
Also, ought not the web server have a high-verbosity logging mode that would tell you exactly what is going on?
2013/2/14 Marc Feeley feeley@iro.umontreal.ca
On 2013-02-14, at 4:35 AM, Herr misterherr@freenet.de wrote:
Am 13.02.2013 15:24, schrieb Eduardo Costa:
I don't think that the problem is not finding gsi. After all, the
server finds any
other Scheme, Common Lisp, Forth, etc. but fails to work with gsi. Do
you think it
could be a name crash? However, I tried to compile gambit as a
standalone, with
another name, and it did not work. By the way, I tried the complete
path, as you
suggested, and it didn't work either.
From: Herr misterherr@freenet.de To: gambit-list@iro.umontreal.ca Sent: Wednesday, February 13, 2013 7:08 AM Subject: Re: [gambit-list] Difficulty with Gambit
Am 08.02.2013 04:47, schrieb Eduardo Costa:
One year or so ago, I contacted this list about running Gambit on
Linux (I compiled
the programs on Zorin/Ubuntu, and tried to run them on a choice of
Linux hosting
services). My programs work perfectly well in about every Scheme
compiler, except
Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus,
Vicare, Chez, to
name a few. The programs also run on Dorai's Scheme to Common Lisp
compiler. I tried
the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc.
However, they
don't run on Gambit. Although the production code is quite complex
(for instance, it
includes Serrano's sqlite clone), I wrote a very simple example in
order to show what
the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline)
--cut
(newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to
complete your request.
I think the server does not find gsi. Do it like this, works fine here:
#!/usr/bin/env gsi (display "Content-Type: text/html")
My first reaction: Please reply to the list, or the gmane newsgroup.
Then I think, this is clearly an installation problem, but from here I
can not tell
which.
The web server executes CGI programs in a separate process, so there is
little
linkage to web server internals. If you can execute shell scripts in the
same cgi-bin
directory then apache config is okay.
I get an Internal Server Error with apache when a cgi script is not
executable. This
can be missing x mode bits, interpreter from #!/-line not found, or even
architecture
mismatch 32/64 bit (here the error on the command line is file not
found). Turn off
apparmor and selinux.
Here's something else you can try. Replace your script with:
#! /bin/sh echo "Content-type: text/html" echo echo "<pre>" /usr/bin/env /usr/bin/env gsi -:d- -e '(display "test\n")' echo $? echo "</pre>"
This will allow you to see what is the content of the environment variables and if any error messages are reported by gsi.
Marc
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
It does.
Did you check /var/log/httpd.log or similar? On Feb 14, 2013 7:11 AM, "Mikael" mikael.rcv@gmail.com wrote:
Yeah!
Also, ought not the web server have a high-verbosity logging mode that would tell you exactly what is going on?
2013/2/14 Marc Feeley feeley@iro.umontreal.ca
On 2013-02-14, at 4:35 AM, Herr misterherr@freenet.de wrote:
Am 13.02.2013 15:24, schrieb Eduardo Costa:
I don't think that the problem is not finding gsi. After all, the
server finds any
other Scheme, Common Lisp, Forth, etc. but fails to work with gsi. Do
you think it
could be a name crash? However, I tried to compile gambit as a
standalone, with
another name, and it did not work. By the way, I tried the complete
path, as you
suggested, and it didn't work either.
From: Herr misterherr@freenet.de To: gambit-list@iro.umontreal.ca Sent: Wednesday, February 13, 2013 7:08 AM Subject: Re: [gambit-list] Difficulty with Gambit
Am 08.02.2013 04:47, schrieb Eduardo Costa:
One year or so ago, I contacted this list about running Gambit on
Linux (I compiled
the programs on Zorin/Ubuntu, and tried to run them on a choice of
Linux hosting
services). My programs work perfectly well in about every Scheme
compiler, except
Gambit. For instance, they run on Bigloo, Racket, Larceny, Ikarus,
Vicare, Chez, to
name a few. The programs also run on Dorai's Scheme to Common Lisp
compiler. I tried
the Scheme to Common Lisp compiler with SBCL, CMUCL, CLISP, ECL, etc.
However, they
don't run on Gambit. Although the production code is quite complex
(for instance, it
includes Serrano's sqlite clone), I wrote a very simple example in
order to show what
the problem is:
#! ./gsi -:d- (display "Content-type: text/html") (newline)
--cut
(newline)
The error is:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to
complete your request.
I think the server does not find gsi. Do it like this, works fine here:
#!/usr/bin/env gsi (display "Content-Type: text/html")
My first reaction: Please reply to the list, or the gmane newsgroup.
Then I think, this is clearly an installation problem, but from here I
can not tell
which.
The web server executes CGI programs in a separate process, so there is
little
linkage to web server internals. If you can execute shell scripts in
the same cgi-bin
directory then apache config is okay.
I get an Internal Server Error with apache when a cgi script is not
executable. This
can be missing x mode bits, interpreter from #!/-line not found, or
even architecture
mismatch 32/64 bit (here the error on the command line is file not
found). Turn off
apparmor and selinux.
Here's something else you can try. Replace your script with:
#! /bin/sh echo "Content-type: text/html" echo echo "<pre>" /usr/bin/env /usr/bin/env gsi -:d- -e '(display "test\n")' echo $? echo "</pre>"
This will allow you to see what is the content of the environment variables and if any error messages are reported by gsi.
Marc
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list