티스토리 뷰

Developer

Apache CGI 연동

rocksea 2012. 3. 19. 16:25

목적 - http를 이용하여 cgi script를 호출한다.


httpd.conf

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
</IfModule>


<Directory "/usr/local/apache2/cgi-bin">
    Options +ExecCGI
    AddHandler cgi-script .cgi

    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

./cgi-bin/test.cgi

#!/bin/sh
print "Content-type: text/plain; charset=iso-8859-1\n\n";
echo "<html><head><title></title></head><body>SUCCESS!!</body>"



http://domain/test.cgi 를 호출하여 확인.

by rocksea


'Developer' 카테고리의 다른 글

redmine  (0) 2012.03.26
Jboss Clustering  (0) 2012.03.19
Apache2.2 + SSL 설치  (0) 2012.03.15
Binary Search ( 이진검색 ) Code  (0) 2012.03.09
Name Server Install & Zone file Setting  (0) 2012.03.09
댓글