實戰(zhàn) FastCGI_2. 安裝 FastCGI之5
發(fā)表時間:2024-06-11 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]2.5 安裝 FCGI 模塊 for Perl 如果要使用 Perl 來撰寫 FastCGI 的程序,必須安裝 FCGI.pm 這個模塊,安裝的方法如下: 1. 下載 FCGI-0.45.tar.gz 并且解開 $ gunzip -c FCGI-0.45.tar.gz tar xvf - ...
2.5 安裝 FCGI 模塊 for Perl
如果要使用 Perl 來撰寫 FastCGI 的程序,必須安裝 FCGI.pm 這個模塊,安裝的方法如下:
1. 下載 FCGI-0.45.tar.gz 并且解開
$ gunzip -c FCGI-0.45.tar.gz tar xvf -
2. 編譯及安裝
$ perl Makefile.PL
$ make
$ make install
3. 測試
$ cp echo.fpl /usr/local/www/fcgi-bin
$ lynx http://localhost/fcgi-bin/echo.fpl
如果順利的話,應(yīng)該會看到如下的結(jié)果:
FastCGI echo (Perl)
Request number 1
No data from standard input.
Request environment:
DOCUMENT_ROOT=/usr/local/apache/htdocs
FCGI_ROLE=RESPONDER
GATEWAY_INTERFACE=CGI/1.1
HTTP_ACCEPT=text/html, text/plain, application/applefile, application/x-metamai
l-patch, sun-deskset-message, mail-file, default, postscript-file, audio-file,
x-sun-attachment, text/enriched, text/richtext, application/andrew-inset, x-be2
, application/postscript, message/external-body, message/partial, application/p
gp, application/pgp, video/mpeg, video/*, image/*, audio/*, audio/mod, text/sgm
l, video/mpeg, image/jpeg, image/tiff, image/x-rgb, image/png, image/x-xbitmap,
image/x-xbm, image/gif, application/postscript, */*;q=0.01
HTTP_ACCEPT_ENCODING=gzip, compress
HTTP_ACCEPT_LANGUAGE=en
HTTP_HOST=localhost
HTTP_NEGOTIATE=trans
HTTP_USER_AGENT=Lynx/2.8.1pre.9 libwww-FM/2.14
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/sbin:/opt/kde/bin:/home/m
yhsu/bin:/usr/X11R6/bin:/usr/sbin:/opt/kde/bin:/usr/X11R6/bin:/usr/sbin:/opt/kd
e/bin
QUERY_STRING=
REMOTE_ADDR=127.0.0.1
REMOTE_PORT=1427
REQUEST_METHOD=GET
REQUEST_URI=/fcgi-bin/echo.fpl
SCRIPT_FILENAME=/usr/local/www/fcgi-bin/echo.fpl
SCRIPT_NAME=/fcgi-bin/echo.fpl
SERVER_ADMIN=myhsu@localhost.localdomain
SERVER_NAME=localhost.localdomain
SERVER_PORT=80
SERVER_PROTOCOL=HTTP/1.0
SERVER_SIGNATURE=
Apache/1.3.6 Server at localhost.localdomain Port 80
SERVER_SOFTWARE=Apache/1.3.6 (Unix) mod_fastcgi/2.2.2
UNIQUE_ID=N1VIbX8AAAEAAAQnKKo
More on its way ... wait a few seconds
Initial environment:
同樣的,如果持續(xù)結(jié) http://localhost/fcgi-bin/echo.fpl 可以看到 Request Number 不斷增加,表示 echo.fpl 已經(jīng)被激活而且持續(xù)執(zhí)行著。
至此,一個可供執(zhí)行 FastCGI 程序的網(wǎng)站服務(wù)器以及撰寫 FastCGI 程序的開發(fā)環(huán)境已經(jīng)建置完成,接下來就只等著新的程序放上去啰。