Steps to Run Your First CGI Program:

  1. Create the following directories in your home directory:
    % cd
    % mkdir -p cgi
    
  2. Change the permissions of some directories:
    % cd
    % chmod 711 . 
    % chmod 711 cgi
    
  3. Write your first CGI program in directory ~/cgi
    % cd ~/cgi
    % cat > hello
    #!/usr/bin/perl
    
    $date = qx (date);
    
    print << "EOT"
    Content-type: text/html
    
    <html>
    <body>
    <center> 
    <h1>Hello World!</h1> 
    The current time is $date
    </center>
    </body>
    </html>
    EOT
    ctr+D <--- type control+D here
    
    % chmod 755 hello
    
  4. Open a netscape browser window, and type the following URL in location line:
    http://kirk.cs.wichita.edu:6550/cgi/xyz/hello
    
    where xyz is your account name. Type the return key and you will see the "hello world" string displayed on the screen.