Open ericvh opened 14 years ago
I believe web.go doesn't work with unix sockets, which is a common configuration for fastcgi in hosted environments. I investigated some potential problems in the unix socket package, but that didn't lead to anything. Ill try to take another look.
Thanks for reporting
Looking into it now...
The reason it doesn't work is that Apache expects the Go program to have a traditional CGI interface -- the input it passed via STDIN and the output is through STDOUT.
After today's commit, which gives web.go the ability to control logging, this shouldn't be too difficult to support.
Why doesn't that work? Is there an error message?
I've been trying to switch my default Apache+PHP configuration to Apache+web.go but without any success so far.
My FCGI starter script looks like this
#!/bin/sh
umask 022
exec /usr/bin/hello
I'm not sure how the communication works in such a configuration as there's no port specified anywhere. I just know that this would work with PHP. The only thing I get when I send a request to Apache is the status code 500 along with the following entry in my log file:
[Fri Dec 16 14:26:23 2011] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Fri Dec 16 14:26:23 2011] [error] [client 1.2.3.4] Premature end of script headers: php5-fcgi-starter
Any ideas on this?
Many shared hosting services (ie. dreamhost for me) don't allow you to specify an external fcgi by address:port and instead using fd 0 as the listen socket for the FastCGI. It would be cool if web.go supported this mode of operation unlocking relatively cheap hosting of go applications.