在linux上查找httpd.conf文件
find / -name httpd.conf -print
在“Options Indexes FollowSymLinks ”这句的在后面加上”ExecCGI “。
在”AddHandler cgi-script .cgi “,去掉前面的#,再在后面加上 .py。
重启apache
/etc/init.d/httpd restart
在 /var/www/html 目录下创建 test.py
#!/usr/local/bin/python3
print("Content-type: text/html")
print("")
print("<html><head></head><body>")
print("Hello World")
print("</body></html>")