반응형
* 설정
/etc/httpd/conf.d/python.conf
<Directory /usr/local/apache/htdocs>
Options +ExecCGI
AddHandler cgi-script .py
</Directory>
* 테스트
vi /usr/local/apache/htdocs/test.py
#!/usr/bin/env python
print "Content-type: text/html\n"
print "Hello World!"
#chmod 755 /usr/local/apache/htdocs/test.py
반응형