CGI Programming (Part 1)Who is this for This is for those who would like to have basic knowledge on CGI programming and requirements on running CGI scripts. What you need to know Perl programming Basic Windows or Linux operation Introduction CGI is an acronym for Common Gateway Interface. It is a method of passing data from a web browser to a database, document or other processes for processing. The result will also be displayed on the web browser. A CGI script is written in any language and Perl is used more often when coding CGI scripts. Components needed to Make CGI work CGI scripts reside in a server. A server is a program that manages incoming requests from clients. A client is another program that sends requests to the server for processing. The client can be on the same machine or in another machine over the network. The most popular server is the Apache Web Server. Apache has versions for Linux and Windows (Yes there is a Windows version). For Windows 98, you have the Personal Web Server (PWS). You can also run your CGI scripts in the PWS. Setting up an Apache Server in Linux If you are running Linux, you probably have an Apache distribution in your CD. If not, you can download it from the Apache Web site (http://www.apache.org/dist).Once you have downloaded the distribution, proceed to install it. To install, you have to configure the compiler options and then compile the source code. Once installed, you can configure it to process CGI Scripts. Installing Apache in Windows Like the Linux distribution, you can download the Apache Web server from their website (http://httpd.apache.org/dist/binaries/wi... Once downloaded, you can just run the downloaded file and it will install the Web Server for you. You do not have to change any of the configuration to run CGI scripts. The installation program will create an Apache Web Server folder in your Start->Programs folder. The items in the Apache Web Server folder allows you to start and shutdown the installed Apache server. Try starting the Apache Server. It should start a DOS Window and display this message: Apache/1.3.14 (Win32) running... You CGI scripts would, by default, be read from the C:\Apace\CGI-BIN directory. Setting up the Personal Web Server in Windows If you do not want to use Apache, you can use the Microsoft Personal Web Server (PWS) in Windows. PWS is in the Windows 98 CD and you can install it from there. Once installed, you have to do some tweaking to run Perl CGI scripts. Click Start->Run and then type regedit. This starts the Registry
The copyright of the article CGI Programming (Part 1) in Perl is owned by Philip Yuson. Permission to republish CGI Programming (Part 1) in print or online must be granted by the author in writing.
Go To Page: 1 2 Articles in this Topic Discussions in this Topic |