PYTHON

python으로 cgi만들기

고요한하늘... 2006. 5. 11. 17:25

 

cgitest.py를 생성

********************* cgitest.py *********************

 

#!/usr/bin/python

print "Content-Type: text/plain\n\n"
print "hellow, python!"

********************* cgitest.py *********************

 

[linux] chmod +x cgitest.py

 

http.conf 수정

********************* http.conf *********************

 [Directory "/디렉토리/"]
         AllowOverride All
         Options ExecCGI
         Order allow,deny
         Allow from all

 [/Directory] 
 

[Directory "/디렉토리/"]
         AddHandler python-program .pyc .py
         PythonHandler mod_python.cgihandler
         PythonDebug Off
         AllowOverride Options FileInfo AuthConfig

 [/Directory] 

********************* http.conf *********************

 

* tag가 안먹는 관계로 "<"대신 "["를 사용했습니다.

 

 

http://ip/cgi-bin/cgitest.py로 테스트

'PYTHON' 카테고리의 다른 글

anydbm  (0) 2006.08.25
main  (0) 2006.08.18
참고할 만한 python 사이트  (0) 2006.08.05
외부 프로그램 실행  (0) 2006.05.19
swig (Simplified Wrapper and Interface Generator )  (0) 2006.05.10