Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcgi support doesn't work on shared hosting services #30

Open
ericvh opened this issue Jun 29, 2010 · 5 comments
Open

fcgi support doesn't work on shared hosting services #30

ericvh opened this issue Jun 29, 2010 · 5 comments

Comments

@ericvh
Copy link
Contributor

ericvh commented Jun 29, 2010

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.

@hoisie
Copy link
Owner

hoisie commented Jun 30, 2010

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

@hoisie
Copy link
Owner

hoisie commented Oct 17, 2010

Looking into it now...

@hoisie
Copy link
Owner

hoisie commented Oct 19, 2010

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.

@hoisie
Copy link
Owner

hoisie commented Oct 20, 2010

Why doesn't that work? Is there an error message?

@Remo
Copy link

Remo commented Dec 16, 2011

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants