질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

아파치 cgi 설정관련.... 에러.. [내공부탁]

작성자 정보

  • 김성진 작성
  • 작성일

컨텐츠 정보

본문

안녕하세요. 레드핫 리눅스9를 얼마전에 세팅해서 사용하고 있습니다.
참고로 제 시스템 커널 버전은 2.4.20-8smp 이고요
php 4.2.2, Apache 2.0.40, perl 5.8.0 을 사용하고 있습니다.

문제는 cgi로 작성된 소스가 웹상에서 제대로 실행되지 않고 있습니다.
물론 shell상태에서는 미리 작성한(아래 test.cgi) cgi source를 가지고 실행이 됩니다. (perl test.cgi)
하지만 웹상에서 해당 cgi를 로딩하면 "http://xxx.xxx.xxx.xxx/test.cgi" 아래와 같은 메시지가 나타납니다.

[error] [client xxx.xxx.xxx.xxx] malformed header from script. Bad header=660 11 0 : test.cgi
[error] [client xxx.xxx.xxx.xxx] unable to include potential exec "include/top.html" in parsed file file /var/www/error/HTTP_INTERNAL_SERVER_ERROR.html.var
[error] [client xxx.xxx.xxx.xxx] unable to include potential exec "include/spacer.html" in parsed file file /var/www/error/HTTP_INTERNAL_SERVER_ERROR.html.var
[error] [client xxx.xxx.xxx.xxx] unable to include potential exec "include/bottom.html" in parsed file file /var/www/error/HTTP_INTERNAL_SERVER_ERROR.html.var

test.cgi 내용입니다
$soozza=660;
$min=$soozza / 60;
$sec=$soozza % 60;

print "$soozza $min $sec ";

참고로 아파치 상태에서 cgi 관련 설정은 아래처럼 했습니다.

DocumentRoot "/home/webadmin/public_html"
<Directory />
 Options FollowSymLinks
 Options ExecCGI
 AllowOverride None
</Directory>

<Directory "/home/webadmin/public_html">
 Oprions Indexes FollowSymLinks
 Options ExecCGI
# Options ExecCGI Includes MultiViews
 AllowOverride None
 Order allow, deny
 Allow from all
</Directory>
<Directory /home/*/public_html>
 AllowOverride FileInfo AuthConfig Limit
 Options MultiViews Indexes SymLinksIFOwnerMatch IncludesNoExec
 Options ExecCGI
 <Limit GET POST OPTIONS>
  Order allow, deny
  Allow from all
 </Limit>
 <LimitExcept GET POST OPTIONS>
  Order deny, allow
  Deny from all
 </LimitExcept>
</Directory>

DefaultType test/plain

ScriptAlias /cgi-bin/   "/var/www/cgi-bin/"
ScriptAlias /webadmin/  "/home/webadmin/public_html"

<Directory "/home/webadmin/public_html/cgi-bin">
 AllowOverride None
 Options ExecCGI
 Order allow, deny
 Allow from all
</Directory>

AddHandler cgi-script .cgi .pl

이상입니다. 저도 서버쪽 일은 미숙한지라.... 책과 웹을보며 이리저리 세팅했습니다.
미숙한부분 지적해주시고... 좀 가르쳐 주세여 ㅠㅠ

 

 

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,043 명
  • 현재 강좌수 :  35,853 개
  • 현재 접속자 :  90 명