Install, Setup and Configure CGI and Perl in Windows XP 설치, 설치 및 구성 Windows XP에서 CGI와 펄을
Prerequisite 전제 조건
Obvioulsy, a web server needs to be running on the Windows machine. Obvioulsy, 웹 서버는 윈도우 머신에서 실행해야합니다. Refer to this 참조이에 post 게시물 for instructions on how to install Apache2 in Windows. Windows에 Apache2를 설치하는 방법에 대한 지침.
Download ActivePerl 다운로드 ActivePerl
Download ActivePerl from ActivePerl에서 다운로드 http://www.activestate.com/Products/ActivePerl/?mp=1 . Click on Free Download to start the download process. 무료 다운로드를 클릭하여 다운로드 프로세스를 시작합니다. There is no need to input any contact info. 거기에 모든 연락처 정보를 입력하지 않아도됩니다. Just leave it blank and press ‘Next’ to start the download. 그냥 떠나 빈 기자와 '다음'다운로드를 시작합니다.
Then download the lastest version of Windows MSI package. 다음 Windows MSI 패키지의 최신 버전을 다운로드합니다.
Install ActivePerl ActivePerl을 설치
Start the installation by double clicking the setup file. 설치 파일을 두 번 클릭하여 설치를 시작합니다. Follows the on-screen instruction. 화면의 지시에 - 따릅니다. If you will be using Perl CGI programs and want to maintain some level of portability between both Linux machines and Windows machines, you may want to install Perl at the same location on your Windows machine as it is on most Linux machines. 펄 CGI 프로그램을 사용하면되며 원하는 두 리눅스 기계와 기계 사이에 윈도우 이동성의 수준을 유지하기 위해 일부로 대부분의 리눅스 시스템에있다, 당신은 윈도우 머신에 동일한 위치에 펄을 설치할 수있습니다.
For example, on Linux machine, Perl is located at /usr/bin/perl and so every Perl program that I write begins with #!/usr/bin/perl . 예를 들어, 리눅스 시스템에서, 펄에 위치한는 / usr / 빈 / 그래서 난 #!는 / usr / 빈과 함께 쓰기 시작 모든 Perl 프로그램 / 펄 펄. So, it’s best when install Perl on an Windows machine, instead of installing it in the default location (ie C:\perl), install it in C:\usr instead, so that the Perl executable is located at /usr/bin/perl. 그래서, 최고의 윈도우 머신에 펄을 설치할 때, 대신 기본 위치에 \ 펄), C로 설치 : \ usr 대신에, 그래서는 Perl 실행에 위치한는 / usr (예에 C : 그것을 설치 / 빈 / 펄. This allows codes written on Windows machine been moved to, without changes, to Linux machine, and have it run there, and vice versa. 이 코드는 윈도우 머신에 서면있게하려면, 변경하지 않고, 리눅스, 기계, 이동되었습니다 그리고 저기, 그리고 그 반대로 실행해야합니다.
To change the installation path, click on browse button when you’re on the installation screen that prompts you to select which features you want to install. 찾아보기 버튼을 설치하면 당신이 원하는 기능을 선택하라는 메시지를 설치 화면에 설치 경로를 변경하려면 누릅니다. Set it to C:\usr\ if needed. 설정을 C : \ usr \ 필요한 경우.
Make sure that the following options is checked (selected): 그 다음 옵션 ()을 선택한 체크되어 있는지 확인합니다 :
Add Perl to the PATH environment variable PATH 환경 변수를 Perl에 추가
Create Perl file extension association 펄 확장 파일을 만듭니다 협회
Activating CGI 활성화를 CGI
Open the httpd.conf file for editing by selecting Start > Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File. 시작을 선택하여 편집을 위해 httpd.conf 파일 열기> 프로그램 -> 아파치 HTTP 서버> 구성 아파치 서버> 아파치 httpd.conf 구성 파일을 편집합니다. Alternatively, open the httpd.conf with any text editor. 또한, 모든 텍스트 편집기를 httpd.conf를 엽니다.
In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like: 주요 디렉토리 섹션에서 옵션을 색인에 대한 검색 FollowSymLinks 대해 라인 267) (시, 그리고 추가 ExecCGI 끝까지 너무 닮았 :
Options Indexes FollowSymLinks ExecCGI 옵션 인덱스 FollowSymLinks ExecCGI
Search for the following line and remove the hash mark character (#) to uncomment this line. 다음 라인을 검색하고 해시 마크 문자를 제거 (#)이 줄을 주석 처리합니다. (You can also change .cgi to .pl, or add .pl behind .cgi if you prefer that perl extention is also treated as cgi files) For example: (당신도 변경할 수있습니다. cgi를합니다. 와줘, 또는 추가할 수있습니다. 뒤에 와줘. cgi를 선호하는 경우도 CGI 파일은 Perl 공개로) 예를 들어 처리됩니다 :
#AddHandler cgi-script .cgi # AddHandler도 cgi - 스크립트. cgi를
Should look like: 같은 모양입니다 :
AddHandler cgi-script .cgi .pl AddHandler도 cgi - 스크립트. cgi를했다. 와줘
or 또는
AddHandler cgi-script .pl AddHandler도 cgi - 스크립트. 와줘
or 또는
AddHandler cgi-script .cgi AddHandler도 cgi - 스크립트. cgi를
Save the httpd.conf configuration file, restart the Apache server. , 아파치 서버를 다시 시작해야를 httpd.conf 설정 파일을 저장합니다. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article. 테스트에 귀하의 웹 서버를 CGI 구성이 문서의 끝부분에 설명된대로 구성을 테스트합니다.
Optional: Enabling CGI in Any Directory 옵션 : 활성화를 CGI 모든 디렉토리에
If you want to use CGI outside ScriptAliased directory (ScriptAlias is usually the Apache2/cgi-bin/), comment out the following line: 경우 (ScriptAlias 대개 Apache2/cgi-bin입니다 ScriptAliased 디렉터리 외부 CGI를 사용하고자 /), 다음 줄을 주석 :
ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” ScriptAlias이 / cgi - bin / "에서 C : /의 Program Files / 아파치 Group/Apache2/cgi-bin /"
Should look like: 같은 모양입니다 :
#ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” # ScriptAlias이 / cgi - bin / "에서 C : /의 Program Files / 아파치 Group/Apache2/cgi-bin /"
Alternatively, if you want to specify just one directory to put all your cgi programs, change the path instead, but makes ure that directory exists. 또한, 만약 귀하의 모든 CGI 프로그램에 넣어 단지 하나의 디렉토리를 지정하려면, 대신 경로를 변경 디렉토리에 존재하지만 우레합니다.
Should look like (for default settings): 기본 설정 (처럼)을 찾아봐야 할것 :
ScriptAlias /cgi-bin/ “your_prefer_cgi-bin_direcotry” ScriptAlias이 / cgi - bin / "your_prefer_cgi - bin_direcotry"
Save the httpd.conf file. httpd.conf 파일을 저장합니다. Restart the Apache server. 아파치 서버를 다시 시작합니다.
Finding Perl Executable Location perl을 실행 위치 찾기
If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. 어디 perl.exe 경우, 시작에 갈 설치되어 있는지 잘 모르겠어요 -> 검색 및 perl.exe를 검색할 수있습니다. This location is the path to the perl executable that has to be put on the top of all cgi scripts. 이 위치에 대한 경로되는 모든 CGI 스크립트의 실행 펄 위에 뿌리는 것입니다. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe 경우 기본 설치 절차에 따라해야한다 경로는 C : / / 빈 / perl.exe 펄
For the path to perl.exe path, all of these format are valid: 경로 들어, 이러한 모든 형식의 유효 기간 : 경로 perl.exe로
#!c:/perl/bin/perl.exe #!에 c : /은 Perl / 빈 / perl.exe
#!c:/perl/bin/perl #!에 c : /은 Perl / 빈 / 펄
#!/perl/bin/perl.exe #! /은 Perl / 빈 / perl.exe
#!/perl/bin/perl #! /은 Perl / 빈 / 펄
Testing Your Web Server CGI Configuration 테스트를하여 웹 서버를 CGI 구성
Save the following test script in your DocumentRoot directory (if you have uncomment ScriptAlias, you can put it anywhere inside your DocumentRoot directory, or if you have set ScriptAlias to some particular directory, put the cgi in that directory only, ie Apache2/cgi-bin) as test.pl or test.cgi (depending on your configuration of the AddHandler line) and modify the first line as required to point to your ActivePerl interpreter: 귀하의 DocumentRoot 디렉토리에 다음 테스트 스크립트를 할인 (해당되는 경우 주석 ScriptAlias가 있으면 어디서든 귀하의 DocumentRoot 디렉토리 또는 ScriptAlias 설정하면 일부 특정 디렉토리 안에, 그 디렉토리에 cgi를 넣어 넣어 수있는, 즉 Apache2/cgi- 빈) test.pl 또는 test.cgi로 (AddHandler 라인의 구성에 따라 다름)과 첫 번째 라인을 수정하는대로 ActivePerl 통역을 가리킨 데 필요한 :
#!c:\perl\bin\perl.exe #!에 c : \ perl을 \ 빈 \ perl.exe
# ^^^ this must be the first line of the script! # ^ ^ ^이 스크립트의 첫 줄에 있어야합니다! ^^^ ^ ^ ^
# start code # 시작 코드
use strict; 엄격한 사용;
use CGI; CGI를 사용;
my $q = new CGI; 내 $에서 q = 새로운 CGI를;
# print header and start the markup output # 인쇄 헤더와 마크업 출력 시작
print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” ); $ q를 인쇄 -> 헤더 ( "text / html은"), $는 q -> start_html ( "안부에서 펄 CGI를!");
print $q->h2(”hello dave…”); $ q를 인쇄 -> H2를 ( "안녕하세요 데이브 ...");
print $q->end_html; $ q를 인쇄 -> end_html;
# end code # end 코드
Now go to 이제 그만 자야지 http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). (Apache2/cgi-bin에 스크립트 / http://localhost/cgi-bin/ 기본적으로 읽을 수있습니다). You should see a page that displays a level two heading with the following text: 당신은 2 페이지에 다음과 같은 텍스트와 머리글을 표시하는 수준을 볼 수있습니다 :
hello dave 안녕하세요, 데이브
If you see the above message, CGI is running. 위의 메시지를 볼 경우, CGI를 실행합니다. If you get a 500 error, go to the last entry in your Apache2/logs/error.log (or the Review Error Log in the Start menu) to see exactly what caused this error. 만약 당신이 500 에러가 났지만, 시작 메뉴에서 귀하의 Apache2/logs/error.log에서 마지막 항목 (또는 검토 오류 로그를) 정확히 무엇이 오류가 발생 볼로 이동합니다.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 중요 :이 기계는 "보증도없이있는 그대로"제공됩니다 페이지를 번역했다. Machine translation may be difficult to understand. 기계 번역을 이해하기 어려울 수있습니다. Please refer to 을 참조하시기 바랍니다 original English article 원래 영어 문서 whenever possible. 언제든 가능합니다.
Share and contribute or get technical support and help at 공유와 기여하거나 기술 지원과에 도움이 My Digital Life Forums 내 디지털 생활 포럼 .
Related Articles 관련 기사
- Easily Set Up Web Server with XAMPP 쉽게 설정할 웹 서버와 XAMPP
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 웹 서버를 설치 Windows XP에서 Apache2, php5와 MySQL4 - 제 4 부
- CPAN Missing Parameter auto_commit Message 실종 CPAN 매개 변수 auto_commit 메시지
- Enable and Display Security Tab in Windows XP Home Edition 보안 탭을 활성화 및 디스플레이 윈도우 XP 홈에서 에디션
- Install AWStats- Free Logfile Analyzer for Site Statistics AWStats - 무료 로그 파일 분석기를 설치하는 사이트의 통계에 대한
- Hack and Workaround to Clean or Fresh Install Windows Vista with Upgrade License DVD 해킹 및 해결 깨끗하고 신선한를 설치하거나 Windows Vista로 업그레 이드 라이선스를 DVD와
- Download Yahoo! 다운로드 야후! Messenger with Voice 8 Full Standalone Installer 메신저의 음성과 팔 전체 독립 실행형 설치
- Trick to Install Windows XP SP3 RC in Non-English Language Editions 윈도우 XP SP3 RC이 아닌 마술을 설치할 - 영어 버전
- Free Download: Microsoft Virtual PC 2007 with Support for Windows Vista as Guest OS 무료 다운로드 : 마이크로 소프트 버추얼 PC 2007 게스트 운영 체제로 윈도우 비스타에 대한 지원과 함께
- Disable and Remove URGE Online Store in Windows Media Player 11 (WMP11) 온라인 쇼핑몰을 해제하고 제거 URGE는 Windows Media Player 11 (WMP11)

































January 2nd, 2006 02:19 2006년 1월 2일 2시 19분
[...] As AWStats is Perl based, a Perl Interpreter need to be installed first to take anvantage of AWStats. AWStats를 기반으로 펄 [...], 통역 Perl에 처음으로 설치되도록 AWStats의 anvantage 취할 필요가있다. For instruction on how to install Perl in Windows machine, check out this article. 윈도우 머신에 설치하는 방법은 Perl에 관한 지침은이 문서 체크 아웃. [...]
July 25th, 2006 20:53 7 월 25 일 2006 20시 53분
I have installed cgi and configured apache as you said, but i got this erro: 네가 말했듯이 난 CGI와 아파치가 설치되어 구성된하지만 난이 erro 있어요 :
Internal Server Error 내부 서버 오류
The server encountered an internal error or misconfiguration and was unable to complete your request. 서버와 귀하의 요청을 완료하지 못했습니다 내부 오류 또는 잘못된 발생했습니다.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. 제발 서버 관리자는 로컬 @ 웹마 스터에게 문의하고 오류 발생의 시간을 그들을 알리는, 그리고 당신은 오류가 발생했을 수도 아무것도 할 수있습니다.
More information about this error may be available in the server error log. 이 오류에 대한 자세한 내용은 서버 오류 로그에 사용할 수있습니다.
——————————————————————————– ---------------------------
Apache/2.0.58 (Win32) PHP/5.1.4 Server at localhost Port 80 Apache/2.0.58 (는 Win32) PHP/5.1.4 Server를 로컬 포트 80시
May 10th, 2007 19:25 5 월 10 일 2007 19:25
Cool4you,guys. Cool4you, 얘들아.
June 20th, 2007 08:09 6 월 20 일 2007 8시 9분
Just for the record, the above test script throws a 500 error when used as is. 기록 해두기 위해서, 위의 테스트 스크립트로 사용할 때 500 오류를 던졌습니다. Maybe it is just a problem with firefox displaying text or something, but the quotation marks are mixed up, so that could lead to problems 아마 파이어 폭스의 텍스트 또는 뭔가를 표시하지만, 인용 부호를 혼합하는 단순한 문제는, 그래서 그 문제로 이어질 수있다
October 8th, 2007 23:05 10 월 8 일 2007 23:05
Hi all, 안녕 모두,
I really need some help on this subject =) 난 정말 어떤 도움을 필요로이 =) 대상
I have followed the steps above, and changed the quotation marks, and what I get is 9 error messages: 난, 위의 단계를 따라와 인용 부호를 변경, 그리고 난 9 오류 메시지입니다 :
Backslash found where operator expected at Z.\test.cgi line 1, near “rtf1\” 백슬래시 연산자 어디에서 Z \ test.cgi 라인 1 예상 rtf1 "근처에서 발견 \"
or …. 아니면 .... , near “ansi\” 근처에 "은 ANSI \"
or …. 아니면 .... , near “deff0″ , "근처 deff0"
or …. 아니면 .... , near “f1\” , "근처에 F1을 \"
etc.. 등.
I am a total rookie with these things, any help appreciated =) 이런 것들과 함께 총 신인, 어떤 도움을 고맙게 =)
Thanks, 감사합니다,
Johanna 요한나
November 28th, 2007 22:14 11 월 28 일 2007 22:14
I did everything you said. 그 말 다 했어. But cgi is still not running. 하지만 CGI는 아직 실행되지 않고있습니다. Please help. 제발 도와주세요.
my apache is 2.2 내 아파치 2.2입니다
September 30th, 2008 23:42 9 월 30 일 2008 23시 42분
Thanks a lot ! 고맙구나!
BTW, the error 5OO is thrown by the server if the quotes are not replaced by standard one line 11… BTW, 서버의 경우 오류가 5OO 따옴표 표준을 한 줄에 11 시까지 대체되지 않습니다 의해 throw됩니다 ...
Otherwise everythings works fine. 그렇지 않으면 제대로 작동 everythings.