If you're just starting out you may find some of the above excellent advice about setting up Apache on your own computer a bit daunting. One way to get your feet wet with CGI is to run the scripts on your webhost's server. Presumably you have or will have an ISP who can let you run your CGI scripts. So when you are sure the scripts run (tested at the command line), just upload them into the cgi-enabled directory on your web space (your ISP will tell you what you have to do to make this work). There are many ISPs that allow this, and offer it free or for very little. For example,
cubesoft is American and good,
uklinux is British and ditto.
§
George Sherston