ActivePerl
둘러보기로 가기
검색하러 가기
Perl 언어인 ActivePerl을 정리한다.
- 홈페이지 : http://www.activestate.com/Products/activeperl/index.mhtml, http://www.perl.org/
- 다운로드 : http://www.activestate.com/activeperl/
- 라이센스 : free ActivePerl distribution
- 플랫폼 : Windows, Linux, Mac OS X, Solaris, AIX and HP-UX
설치 가이드
ActivePerl 설치
- ActivePerl 설치
- 다운로드 사이트에서 ActivePerl-5.10.0.1003-MSWin32-x86-285500.msi 을 다운로드 한다.
- ActivePerl-5.10.0.1003-MSWin32-x86-285500.msi를 실행하여 ActivePerl을 설치한다.
- 명령행에서 "perl -version"을 실행하여 정상적으로 설치 되었는지 확인 한다.
Apache HTTP Server 연동
- Apache HTTP Server가 설치되어 있지 않으면 설치 한다.
- Apache HTTP Server 2.2.11과 CGI 연계 설정
- Apache Perl Module 설치
- Windows 명령행에서 "ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/mod_perl.ppd" 실행 한다.
- $APACHE_HOME/modules/ 에 mod_perl.so 모듈이 설치 되어야 한다.
- $APACH_HOME/conf/httpd.conf
- LoadModule cgi_module modules/mod_cgi.so 에서 주석(#) 생략
- <Directory "c:/www"> 와 같은 DocumentRoot 디렉토리 내 Options 에 ExecCGI 을 추가
- 확장자 pl 을 DirectoryIndex 에 등록 DirectoryIndex index.php index.html index.jsp index.pl
- ScriptInterpreterSource registry 의 앞에 주석(#)을 생략함으로써 #!c:/perl/bin/perl.exe 와 같이 파일내에 perl 경로를 지정하지 않아도 실행가능하도록 설정
- AddHandler cgi-script .cgi .pl 로 설정
###--- 아래 Sample은 httpd.conf에서 해당 부분만 발췌한 것 입니다. LoadModule cgi_module modules/mod_cgi.so LoadFile "$PERL_HOME/bin/perl510.dll" LoadModule perl_module modules/mod_perl.so <Directory "C:/www"> Options Indexes FollowSymLinks +ExecCGI ### ScriptInterpreterSource Registry-Strict </Directory> <IfModule dir_module> DirectoryIndex index.html index.php index.jsp index.pl index.cgi </IfModule> <IfModule mime_module> AddHandler cgi-script .cgi .pl </IfModule>
- c:/www/testperl.cgi 프로그램을 작성하고 http://localhost/testperl.cgi 를 호출하여 정상적으로 동작하는지 테스트 한다.
#!c:/app/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";
- 참고 문헌
사용자 가이드
- ActivePerl 버전 확인
perl -version
참고 문헌
- CAPN, CPAN 검색 : Comprehensive Perl Archive Network
- 윈도우에서 Perl 사용하기
- mod_perl
- Strawberry Perl