2010. 6. 22. 10:03
반응형

1. Perl 설치하기(아래 두개중 하나 선택)

  • ActivePerl : http://www.activestate.com/store/activeperl/download/
  • strawberry : http://strawberryperl.com/


2. mod_perl.so 설치하기(mod_perl.so 파일을 Apache의 module 디렉토리로 설치하는 과정)

      1. ActivePerl 5.8xx 버전일 경우

  • Apache2.0 일때, 명령 프롬프트에 ppm install http://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd 입력
  • Apache2.2 일때, 명령 프롬프트에 ppm install http://theoryx5.uwinnipeg.ca/ppms/mod_perl-2.0.ppd 입력

      2. ActivePerl 5.10xx 버전일 경우

  • Apache2.2 일때, 명령 프롬프트에 ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/mod_perl.ppd 입력


3. Apache 와 연결

  • httpd.conf의 내용 수정
  1. LoadModule cgi_module modules/mod_cgi.so 의 앞에 주석(#)을 생략
  2. <Directory "C:/APM_Setup/htdocs"> 와 같은 DocumentRoot 디렉토리 내 Option 에 ExecCGI 을 추가
  3. 확장자 pl 을 DirectoryIndex 에 등록 DirectoryIndex index.php index.html index.htm index.pl
  4. ScriptInterpreterSource registry 의 앞에 주석(#)을 생략함으로써 #!c:/perl/bin/perl.exe 와 같이 파일내에 perl 경로를 지정하지 않아도 실행가능하도록 설정
  5. AddHandler cgi-script .cgi .pl 로 설정


4. 웹으로 Perl 프로그램을 테스트

httpd.conf에서 MIME-type을 pl과 cgi 모두 적어줬지만

일반적으로 Perl 프로그램을 웹으로 실행하려면 확장자를 cgi 로 하기로 약속되어있다.

#!c:/perl/bin/perl

print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<TITLE> Perl test</TITLE>\n";
print "</head>\n";
print "<body bgcolor=#ffffff>\n";
print "<br>웹브라우즈로 실행되는 Perl프로그램입니다.\n";
print "\n";
print "</body></html>\n";

반응형

'Servers' 카테고리의 다른 글

JBoss Configuration 및 User admin guide  (1) 2011.02.07
oracle instant client 설치하기  (2) 2010.10.01
tomcat jndi 설정  (1) 2010.04.21
apache weblogic 연동  (1) 2010.04.21
weblogic 개발모드 세팅  (1) 2010.04.21
Posted by seongsland