[絵] HTTPリクエスト(GET,POST) CGI起動 ブラウザ -> ウェブサーバ -> CGIプログラム <- <- HTTPリプライ UNIX標準出力(Apacheの場合) |
% gtar zxvf fcgi-devel-kit.tar.Z ; gtar zxvf latest.tar.gz % cd perl5.002 % mv perl.c perl.c.orig ; mv proto.h proto.h.orig ; mv Configure Configure.orig % cp -r ../fcgi-devel-kit/perl-5/perl5.002/* ./ ; cp -r ../fcgi-devel-kit/perl-5/common/* ./ % setenv FCGIDIR /path/to/fcgi-devel-kit |
% ./Configure -Dcc='gcc -B/usr/ccs/bin/' -Dextralibs="$FCGIDIR/libfcgi/libfcgi.a" -Dprefix=/usr/local/perl5-fcgi -Dccflags="-I$FCGIDIR/include -include $FCGIDIR/include/fcgi_stdio.h" |
% mkdir sfio97 ; cd sfio97 % gtar zxvf /path/to/src/of/sfio97.src.unix.tar.gz ; cd src/lib/sfio % setenv PATH /path/to/sfio97/bin:$PATH |
% make CC=gcc |
% su # mkdir /usr/local/include/sfio ; cp sfio97/include/* /usr/local/include/sfio # mkdir /usr/local/lib/sfio ; cp sfio97/lib/* /usr/local/lib/sfio |
% ./Configure -Duseperlio -Dusesfio -Dcc='gcc -B/usr/ccs/bin/' |
Directories to use for library searches? [/usr/local/lib /lib /usr/lib /usr/ccs/lib] /usr/local/lib/sfio /usr/local/lib /lib /usr/lib /usr/ccs/lib Any additional cc flags? [-I/usr/local/include] -I/usr/local/include/sfio -I/usr/local/include Any additional ld flags (NOT including libraries)? [ -L/usr/local/lib] -L/usr/local/lib/sfio -L/usr/local/lib Use the experimental PerlIO abstraction layer? [y] y perl5 can use the sfio library, but it is experimental. You seem to have sfio available, do you want to try using it? [y] y % make ; make test ; su # make install |
ftp://ftp.lab.kdd.co.jp/lang/perl/CPAN/authors/id/SKIMO/FCGI-0.31.tar.gz % tar zxvf FCGI-0.31.tar.gz % cd FCGI-0.31 % perl Makefile.PL % make ; su # make install |
% tar zxvf apache-fastcgi.tar.Z % cd apache-fastcgi % cp src/mod_fastcgi.c $apache/src/ |
Module fastcgi_module mod_fastcgi.o |
AddHandler fastcgi-script .fcgi |
AppClass /usr/etc/httpd/cgi-bin/echo.fcgi |
% gtar zxvf apache_1.2.4.tar.gz |
# Module rewrite_module mod_rewrite.o ↓ Module rewrite_module mod_rewrite.o |
% $apache/src/Configure % make ; su # make install |
RewriteEngine on |
RewriteLog logs/rewrite_log RewriteLogLevel 2 |
% $apache/src/httpd -f $apache/conf/httpd.conf |
http://www.hogehoge.or.jp/~foo/bar/zoo.html -> http://www.naninani.or.jp/~foo/bar/zoo.html http://www.hogehoge.or.jp/~foo/boo.html -> http://www.naninani.or.jp/~foo/boo.html |
RewriteEngine on RewriteOptions inherit Options +FollowSymLinks RewriteRule (.+) http://www.naninani.or.jp/~foo/$1 [R,L] |
RewriteCond http://www.naninani.or.jp/~foo/%{REQUEST_URI} -U RewriteRule (.+) http://www.naninani.or.jp/~foo/$1 [R,L] RewriteRule (.+) - [PT] |
RewriteCond http://www.naninani.or.jp/~foo/%{REQUEST_URI} -U |
RewriteRule (.+) - [PT] |
RewriteCond http://www.naninani.or.jp/~foo/%{REQUEST_URI} !-U RewriteRule (.+) http://www.hogehoge.or.jp/~foo/$1 [R,L] RewriteRule (.+) - [PT] |
=head1 NAME INSTALL - Apache mod_perl installation instructions =head1 DESCRIPTION How to build, test, configure and install mod_perl =head1 PREREQUSITES =over 3こんな感じの見ためを持つのはperldocコマンドで見る。