Installing Apache on Windows

Installing Apache on Windows is as easy as installing any other program. As noted earlier in this appendix, the Apache Web server does not run on Windows 9x systems. There are instructions for installing Apache on Windows 95, but in my experience it does not run. However, there is no harm in trying-I have had reports from others who had no problems at all.

  1. To download the latest version of Apache for Windows, go to http://

  2. From this page, click the 'from here' link under the 'Download!' section of the page. This brings you to a directory listing. You need to click the 'binaries' folder, then the 'win32' folder to get to the Windows software.

  3. Download the latest stable version. There are at least two choices: one for the Microsoft installer and one that is a regular .exe file. Either works.

  4. Once you have the file downloaded, execute it by double-clicking it if it is an .exe file or by right-clicking and choosing Install from the pop-up menu if it is a Microsoft Installer file.

    Figure A-8 shows the first screen for installing the Apache Web server. This screen is simply informational.

    click to expand
    Figure A-8: Apache Installation Wizard

  5. Click the Next button to continue the installation.

    Figure A-9 shows the license agreement for the Apache Web server. You must accept the terms to continue the installation.

    click to expand
    Figure A-9: Apache License Agreement

  6. Click the Next button to continue the installation.

    Figure A-10 shows the 'Read This First' screen, which shows you the latest information about the Apache Web server you are installing.

    click to expand
    Figure A-10: Apache Installation 'Read This First'

  7. Click the Next button to continue the installation.

    Figure A-11 shows the Server Information screen. This screen gathers information about your system so that it can properly configure the Web server.

    click to expand
    Figure A-11: Apache Server Information screen

  8. Enter the information that pertains to the server you are installing Apache on, and click the Next button to continue the installation.

    Figure A-12 shows the Setup Type screen. The default is best here, so leave the choice on 'Complete.'

    click to expand
    Figure A-12: Apache Setup Type screen

  9. Click the Next button to continue the installation.

    Figure A-13 shows the Installation Destination Folder screen, which shows you where the Apache software will be installed and gives you the option of changing this location.

    click to expand
    Figure A-13: Apache Installation Destination Folder screen

  10. Click the Next button to continue the installation.

    The installer copies the software to its destination folder and starts the Apache Web server service. If all goes well, you will get a screen telling you that the Installation Wizard completed.

Next, we have to edit one of the configuration files so that the Web server knows what to do with Perl CGI programs.

If you did a default install of Apache, the configuration files will be installed in the C:\Program Files\Apache Group\Apache\conf subdirectory. The file we want to edit is httpd.conf.

Make sure that the line that reads

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"

is not commented out. This line, unless commented out, causes the files in the listed directory to be executed as CGI scripts.

Also, look for, and add if needed, a line that reads:

AddHandler cgi-script .cgi .pl

This line causes files ending with .cgi or .pl to be treated as CGI scripts.

Next, you need to go into your 'Administrative Tools' area, listed in the Control Panel, to stop and restart the Apache service.

You may need to make a change to your programs to get them to work. For example, the first line of a Perl program usually starts with #!/usr/bin/perl, but now you need to change it to the location on your system (something like #!C:/perl/bin/perl). This format works with Apache but might not work with other Web servers; make sure you check the documentation.

Perl Database Programming
Perl Database Programming
ISBN: 0764549561
EAN: 2147483647
Year: 2001
Pages: 175 © 2008-2017.
If you may any questions please contact us: