Apache and FastCGI

From ArchWiki
Revision as of 23:09, 9 September 2005 by Cactus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This goal of this how to is to setup Apache to use external fastcgi.

Requirements

You need to fulfill the requirements before you can get fastcgi Apache running. Those requirements are:

  • apache
  • fastcgi
  • mod_fastcgi
  • twisted-web

Install

Fulfill the Requirements

Fetch pacman packages.

$ pacman -Sy fastcgi apache

Fetch mod_fastcgi

$  wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz

Extract mod_fastcgi

$ tar -xzf mod_fastcgi-2.4.2.tar.gz
$ cd mod_fastcgi-2.4.2

Modification of files

$ cp Makefile.AP2 Makefile
<edit Makefile>
builddir     = .

top_dir      = /home/httpd

top_srcdir   = ${top_dir}
top_builddir = ${top_dir}

include ${top_builddir}/build/special.mk

APXS      = apxs
APACHECTL = apachectl

#DEFS=-Dmy_define=my_value
INCLUDES=-I/usr/include/apache
LIBS=-L/usr/lib/apache/

all: local-shared-build

install: install-modules

clean:
        -rm -f *.o *.lo *.slo *.la

Build mod_fastcgi

$ make
< become root >
$ make install

Configuration

You need to load the fastcgi module now. Edit your apache httpd.conf file. Add the following:

LoadModule fastcgi_module  lib/apache/mod_fastcgi.so
<IfModule mod_fastcgi.c>
 AddHandler fastcgi-script fcg fcgi fpl
 FastCGIExternalServer /fastcgiext/extprog -host 127.0.0.1:9000
</IfModule>

More

This guide currently doesn't cover setting up the external prespawned processes. To see examples of this, check the following links:
Lighttpd_For_Both_SSL_And_Non-SSL
Fastcgi_and_lighttpd