Today in lab we checked blogs, we restarted servers if needed. To restart your server: a) go into silo b) from the command line type: ~/apache/bin/apachectl restart Next we talked about crontab: crontab -l crontab -r crontab -e http://kb.iu.edu/data/afiz.html So let's setup a crontab entry so the server restarts every six hours: crontab -e Then add this: 49 6,12,18,0 * * * ~/apache/bin/apachectl restart Next we start writing programs: a) log into silo b) choose a folder to go into c) create program with pico, make it executable, run it We wrote this (in Python): -bash-3.2$ cat eleven #!/usr/bin/python print "Welcome to this program." who = raw_input("Name: ") age = raw_input("Age: ") print "Well,", print who, print "you will be", print int(age) + 1, print "years old next year." And this in Perl: -bash-3.2$ cat twelve #!/usr/bin/perl print "Welcome to this program.\n"; print "Name: "; $who = ; chop($who); print "Age: "; $age = ; print "Well, "; print $who; print " you will be "; print $age + 1; print " years old next year."; -bash-3.2$ Now we want to write a web script that acts like these: We chose Python: #!/usr/bin/python import time print "Content-type: text/html\n\n" print "Howdy", time.localtime() But here's the final version: #!/usr/bin/python import cgi trumpet = cgi.FieldStorage() if trumpet.has_key("who"): who = trumpet["who"].value if trumpet.has_key("age"): age = trumpet["age"].value print "Content-type: text/html\n\n" print "Well,", who, "you will be", int(age) + 1, "years old next year" This assumes we call it like this: http://silo.cs.indiana.edu:8346/cgi-bin/flute?who=Michael&age=46