Create a simple Perl program called hello.pl.
Create a directory for this program. By convention, this directory is named as the cgi-bin directory though you can name it whatever you like.
It is recommended that you create the cgi-bin directory under the instance configuration directory. For example:
Copy the hello.pl file into the /var/opt/SUNWwbsvr7/cgi-bin directory.
Select Common Tasks tab > CGI Directories from the Virtual Servers Tasks list.
The CGI Settings window is displayed.
Click the New button in the CGI Directories section.
The Add CGI Directories window is displayed.
Enter the Prefix and the CGI Directory path. Choose whether the program is a CGI or a ShellCGI program.
For example (On UNIX platforms):
CGI Directory: /var/opt/SUNWwbsvr7/cgi-bin
On Windows platforms:
CGI Directory: c:\sun\webserver7\cgi-bin
The CGI directory you specified must have execute permissions.
Click Save to save the changes. Access the program from a browser window.
Open a browser window. If your server is called acme, running on port 2222), type http://acme:2222/cgi-bin/hello.pl.
Displays the message “Hello World” on the browser window.