Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
» Sitemap
Free Newsletters:

News Via RSS Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles

SQL etc

Posted Oct 19, 1998

Introduction to Databases for the Web: Pt. 3 - Page 3

By Selena Sol

Getting the Pieces

So now that we understand what it is that we are building, let's continue by assembling the tools and raw material.

As I said before, we are going to demonstrate this process on a Windows 95 machine. I chose to demonstrate on a Windows box because I know that even if you are a UNIX developer, you have access to a Windows machine that you can use to develop a test site. Of course, most likely, you develop on a Windows system. Either way, everything we go over can be performed on any platform, just with different software packages. I will try to point out where things might be different as we go along.

Installing Perl

The first thing you will need to do is download Perl 5. You can do this easily, by going to www.perl.com There are two versions of Perl available and the differences are explained at www.perl.com. However, I use Gurusamy Sarathy's binary version of Perl for extra module support.

If you are using UNIX, you can download the .tar.gz (Note if you are using UNIX it is almost assuredly already installed and/or installable by your systems administrator. You probably should not do it yourself).

If you are using Windows or Macintosh, download the ZIP file. In any case, unzip utilities for all the platforms are available at www.shareware.com.

When you have downloaded the zipped file, you should uncompress it on your local hard drive. On Windows, I tend to extract it into a directory like c:\Perl\Perl5.004\. But the directory you use does not really matter much.

Windows Explorer example

Note for Windows and UNIX users, you might want to add the Perl executable to your path, but it is not necessary for this tutorial. In case, you want to add it to your path, here is an example of the line I use in my autoexec.bat file. In UNIX you would typically define the PATH in .login, though it is better to install Perl in a standard directory that is already defined in your PATH such as "/usr/local/bin".

Autoexec.bat example

Okay, once Perl is installed, try running a simple Perl program to make sure everything is hunky dory. Here is the program I use:

print "hello world";

Test Perl Script

Installing a Web Server: Sambar

Now that you have Perl installed and running, it is time to download a Web Server that you can use locally to test CGI scripts.

But how can I run a web server on my computer that is not hooked up to the web?

Well, you "can" run a web server locally, but it will only be useful for testing and development. That is, you will create a network composed of one computer and then use your web browser to access the web server!

You can easily pick up a free web server for any operating system you are using. For UNIX and Windows I recommend Apache. You can also use the Sambar Web Server for Windows. In the case of this tutorial, I downloaded Sambar from www.sambar.com because it is so incredibly easy to install. However, which Web Server you choose will not make a difference for this tutorial. They will all work like Sambar for our purposes.

Once you download the self-extracting executable file from www.sambar.com, you run the setup program and the server is installed. There is not much else to it. The server is fairly featureless, but for testing purposes that can be just what the doctor ordered.

Once that is done, try running Sambar! You should see the status window. Once that is done, you can try connecting to your personal web server. Just use your IP address in the location field in Netscape or Internet Explorer or use "localhost". You can see in the following image, that my Netscape document request is being registered and handled by Sambar.

[Sambar and Netscape]

SQL etc Archives

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Latest Forum Threads
SQL etc Forum
Topic By Replies Updated
MySQL rollback UAL225 0 August 21st, 09:56 PM
Complex Search Query Galway 0 May 20th, 10:04 PM
change collation at once supercain 2 May 15th, 06:18 AM
SQL Features, tools and utilities question Neomite 1 April 10th, 09:13 AM