Created
January 20, 2018 19:53
-
-
Save thespacedoctor/f22e81123c43e84da05d42e60a18d6bd to your computer and use it in GitHub Desktop.
[A python CGI script to test apache is working] #cgi #python #apache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# encoding: utf-8 | |
""" | |
test.py | |
======== | |
:Summary: | |
A test script to test apache installs | |
:Author: | |
@thespacedoctor | |
""" | |
################# GLOBAL IMPORTS #################### | |
import sys | |
import os | |
import cgi | |
import cgitb | |
###################################################### | |
# MAIN LOOP - USED FOR DEBUGGING OR WHEN SCRIPTING # | |
###################################################### | |
def main(): | |
""" | |
The code executed on webpage load | |
""" | |
print 'Content-Type: text/html\n\n' | |
print "<html>" | |
print "<head>" | |
print "<title>Hello - seems all is now right with the world</title>" | |
print "</head>" | |
print "<body>" | |
print "<h2>If you see this then ... </h2>" | |
print "<h4>... apache is working and running python scripts</h4>" | |
print "</body>" | |
print "</html>" | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment