in reply to how to run cgi script

Read the manual of your HTTP Server, how to permit CGI scripts. For apache read here: Apache Tutorial: Dynamic Content with CGI.
Boris