Installing Apache
To get a later version of the Apache web server software go to: http://www.apache.org/
In Apache Projects
box click on # HTTP Server. You will see a display similar to that on the right.
On the next page under "Apache 2.2.11 Released" click on "Download" to get the latest version.
Under: "Apache HTTP Server 2.2.11 is the best available version"
Select: Win32 Binary (MSI Installer): apache_2.2.11-win32-x86-no_ssl-r2.msi [PGP] [MD5]
Download the installation file to a temp folder or the PERLHW folder on your C: drive. Start the installation by double clicking on the self-extracting installation file that uses Microsoft Installer.
.
This version was originally for Windows 98 and Windows NT.
If you have a MAC you will have to use Tripod.com for your assignments.
You will have to answer a few questions during the installation. When prompted fill in the answers indicated below:
Now go to c:\program files\Apache Software Foundation\Apache2.2
and create two shortcuts: one to httpd.exe in the "bin" directory of the Apache 2.2 folder and one to the Apache 2.2 folder in the Apache Software Foundation group.
Place both shortcuts on the desktop. You will use one to start Apache and the other to access the cgi-bin and htdocs folders. Htdocs is used to hold your web pages and cgi-bin is used to hold your Perl scripts.
In order to use Apache as a web server you must have it running before you open it your browser. Double click on the httpd shortcut that you created. Apache should open in a DOS window and you should see the message "HTTPD" on the title bar.
You will not see a DOS prompt.
Minimize the window if it remains open.
To test Apache with a browser open your browser and enter:
http://localhost/
You should see the Apache welcome screen that has the message It Works!. If there is no welcome page check the error log. If you see a “make_sock” error message go to apaches web site and update “Winsock 2”.
Now create the following simple html file. Call it first.html
<html>
<head>
<title>
Get First
</title>
</head>
<body >
Apache test HTML file<br>
<A HREF="../cgi-bin/first.cgi"> Get First</A>
</body>
</html>
Go to the htdocs folder in Apache and copy first.html into your folder.
Now copy first.cgi into the Apache cgi-bin folder. Change the "shebang line from: #!/usr/bin/perl to:
#!C:\ActivePerl\Perl\bin\perl.exe since this should be the location of your Perl interpreter. If you installed PERL in a different location, use that location. Notice that the perl.exe file name is included in the path name.
Return to your browser and enter: http://localhost/first.html You should see first.html. If you get a "file not found" message, check the name. Make sure that you are using ".htm" or ".html" depending on your file name extension.
Now click on the link to "Get First ". and you should see the output from first.cgi. You can also run first.cgi directly by entering:
http://localhost/cgi-bin/first.cgi
Other
To start Apache from the Start menu button click on.
Start|programs|apache HTTP server|start apache in console
(Use ^C to exit). You can minimize the DOS window while Apache is running.
To view errors, click on:
Start|programs|apache…|review server log file| review server log files|review error log
Open using Notepad. Edit out old errors as needed.
To edit configuration file click on:
Start|programs|apache…|Configure Apache Server|Edit …HTTPD.conf Configuration file.
Settings you should check:
Configuration Setting
Listen: 80
ServerName localhost:80