我有一个非常简单的Python脚本,我想在我的Apache 2服务器上运行:
#!/usr/bin/python print "Content-Type: text/html" print print "<html><head><title>Hello</title></head><body></body></html>"
我怎样才能简单地得到这个和我的Apache服务器? 我不想做任何事情,我只想要一些有用的东西。
这是一个CGI脚本。 在服务器上启用CGI,调用脚本whatever.py ,把它放在cgi-bin/目录下,然后转到http://somehost.ex/cgi-bin/whatever.py 。