Re: httpd slowcgi notes

2014-11-11 Thread Quentin Rameau
Hi,

> server "local-fastcgi" {
> listen on egress port 80
> fastcgi
> }

have you tried specifying the fastcgi socket ?



Re: httpd slowcgi notes

2014-11-10 Thread Jean-Francois Simon

Hi All,

With httpd as of 5.6 I do not understand how to make cgi script work eg 
just bgokg installed by default at address /cgi-bin/bgplg


==httpd.conf==

prefork 2

server "local" {
listen on egress port 80
}

server "local-fastcgi" {
listen on egress port 80
fastcgi
}

==EOF==

/etc/rc.d/httpd start
/etc/rc.d/slowcgi -f start

Resulting in "Not Found /cgi-bin/bgplg"
Whereas the httpd server normally serves other html files of the htdocs 
directlry, except /bgplg


Could you help me with the miss here ?

Regards

J.F.



httpd slowcgi notes

2014-11-09 Thread Elijah Buck
Hello,

I've upgraded my 5.4 server to 5.5 and then 5.6 and have switched
from nginx to httpd. This is all excellent.

I wanted to share how I made httpd work for me. I host a simple
static site, but also need '301 Moved Permanently' support, which
httpd does not seem to support at this time. However, httpd does
support FastCGI, so I use a small Perl CGI script called via slowcgi
to set the 301 redirect header.

It is a bit underdocumented that the 'root' httpd option can be
used to tell slowcgi which script to execute.

##httpd.conf##

ext_addr="egress"
server "www.example.com" {
listen on $ext_addr port 80
}
server "old.example.com" {
listen on $ext_addr port 80
fastcgi socket "/run/slowcgi.sock"
root "/cgi-bin/redir.pl"
}


##redir.pl##

#!/usr/bin/perl -Tw
use CGI;
my $q = CGI->new();
print $q->redirect(
  -location => 'http://www.example.com',
  -status => '301 Moved Permanently',
);

You will also have to setup perl in the chroot and start slowcgi.

Cheers,
Elijah