Upgrade perl apache

Table of Contents

Installing Perl V 5.8.6 and Apache V 2.0.52 under Windows XP
Upgrading Apache and Perl
Downloading and installing
Perl's Configuration
The Environment
Rebooting
Getting Back to Where You Were
Editing c:\apache2\conf\httpd.conf
Patching Time::Local
Firewall hell
Native Perl modules
Your Perl modules
Starting Apache
mod_perl (Old instructions)
Resources
Author
Licence

Upgrade perl apache

Installing Perl V 5.8.6 and Apache V 2.0.52 under Windows XP

Version: 1.02 of this document. 13-Apr-2005.

This section of the document explains installing Perl and Apache for the first time, under Windows. Later sections deal with upgrading.

I assume you are logged on as a Windows user with administrative rights.

Each choice documented below is based on what I think is the most appropriate alternative for my operating environment (which includes development machines and a farm of single-user production machines).

Install Perl and Apache

The file used in this document was Perl-5.8-win32-bin.exe as of 29-Dec-2004.

Go to http://www.apache.org/dyn/closer.cgi/perl/win32-bin/ and choose a mirror.

  • Download these files:
    • Perl-5.8-win32-bin.readme
    • Perl-5.8-win32-bin.exe
    • apxs_win32.readme
    • apxs_win32.tar.gz

    These files are compiled by Randy Kobes, and do not use the Windows registry.

    Read the Readmes.

  • Double-click Perl-5.8-win32-bin.exe
  • Click Next
  • Click I Agree
  • Type (as Destination Folder): d:\

    Install it into d:\, not the default which is a sub-directory. Using d:\ results in creating d:\apache2 and d:\perl, which is presumably what you want.

  • Click Install

    Time passes.

  • Click Next
  • Ensure 'Configure the Perl/Apache2 Win32 binary' is selected
  • Click Finish
  • A 'Configure' dialog opens...

    Fill in the details as appropriate. Typical values:

    • User name: ron
    • Hostname: savage.net.au
    • Email: ron@savage.net.au

    And yes, this hostname is not the same as the value for the env var DOMAIN.

    See below for an explanation of this discrepancy.

    This value of hostname will be written into several places within d:\apache2\conf\httpd.conf.

    See below for a discussion of httpd.conf.

  • Click Configure
  • Click OK
  • Click Yes

    This builds the HTML.

    Time passes...

  • Click Yes

    This part configures the interface to CPAN - The Comprehensive Perl Archive Network.

    The installer will try to download some files. If FTP fails, it does not matter at this stage.

  • As instructed on screen, type: o conf init
  • For all prompts down to and including 'Policy on building prerequisites ... [ask]', type: [Enter]

    The following depend on having installed some-GNU-tools.zip, as above.

  • For 'Where is your gzip program [...]', type: gzip
  • For '...tar', type: tar
  • For '...unzip', type: unzip
  • For '...nmake', type: nmake
  • For '...lynx', type: [1 space]
  • For '...wget', type: [1 space]
  • For '...ncftpget', type: [1 space]
  • For '...ncftp', type: [1 space]
  • For '...ftp', type: ftp
  • For '...gpg', type: gpg
  • For '...less', type: more
  • For 'What is your favorite shell?', type: [Enter]
  • For 'Your choice: []', type: [Enter]
  • For 'Your choice: []', type: [Enter]
  • For 'Your choice: [UNINST=1]', type: [Enter]
  • For 'Timeout... [0]', type: [Enter]
  • For 'Your ftp_proxy', type: [Enter] or whatever
  • For 'Your http_proxy', type: [Enter] or whatever
  • For 'Your no_proxy', type: [Enter]
  • For 'Enter another URL or RETURN to quit: []', type: [Enter]
  • At the 'cpan' prompt, type: q
  • Click OK

Having installed Perl and Apache on d:\, create a copy of perl.exe in d:\usr\bin\.

The point of d:\usr\bin\perl.exe is so your CGI scripts under Apache/Windows can use, on the she-bang line:

	#!/usr/bin/perl

in exactly the same way as they can under Unix.

  • Make directory: d:\usr\
  • Make directory: d:\usr\bin\
  • Copy d:\perl\bin\perl.exe to d:\usr\bin\

Fix the PATH

We'll do that now so when the Perl/Apache installed asks for programs like gzip and their paths, we can just say 'gzip' rather than 'd:\bin\gzip.exe'.

  • Click Start/Control Panel
  • Double-click System
  • Click Advanced
  • Click Environment Variables
  • Scroll down until 'Path' is visible under System Variables
  • Click Path
  • Click Edit
  • Click Home

    This moves the cursor to the start of the edit field.

  • Type: d:\perl\bin;d:\apache2\bin;

    Yes, include the ';' at the end to separate this path component from what was there previously.

  • Click OK
  • Click OK
  • Click OK
  • Click [X] to close the Control Panel

The Apache add-on APXS

  • Unpack apxs_win32.tar.gz into d:\temp

    Follow the instructions in the apxs_win32.readme.txt, as follows:

  • cd apxs
  • Run: perl Configure.pl
  • For 'Use "d:\Apache2"...[yes], type: [Enter]

    This will create 2 files: d:\apache2\bin\ap*.

  • cd ..
  • Run: rd /q /s apxs

Patching the Perl module Apache::TestConfigData

  • Patch d:\perl\site\lib\Apache\TestConfigData.pm

    This file probably has d: hard-coded on line 7. Change it to suit your setup.

    This is needed for when you try to install a new version of Apache::Test.

Upgrading a beta version of the Perl module Data::Dumper

Unfortunately, the Perl just installed incorporates a developer version of this module, and other Perl modules will not install properly if the module is not replaced. So we do that now.

Firstly, cross-check: Open the file d:\perl\lib\Data\Dumper.pm with Notepad.

If line 7 contains a version number containing an underscore, such as:

$VERSION = '2.121_02';

then

Installing various Perl modules manually

The installer program I wrote requires various modules which are not shipped with Perl.

So, here we install those modules manually.

The versions listed here are just the ones I used. Download later ones if possible.

  • CGI.pm-3.07

    Use old style installation (see below).

  • HTML-Template-2.7

    Use old style installation.

  • IPC-Run3-0.01

    Use old style installation.

  • PAR-Dist-0.07

    Use old style installation.

  • Module-Signature-0.44

    Use old style installation.

    This asks about importing the author's keys. Type: [Enter].

  • ExtUtils-CBuilder-0.10

    Use new style installation (see below).

  • Module-Build-0.2608

    Use new style installation.

  • Mail-Sender-0.8.10

    Use old style installation.

    This asks about specifying defaults. Type: n

  • Local-Run3-1.00

    Use style installation.

  • Local-Build-1.03

    Use new style installation.

Old Style Installation

Assume X-Y-N.NN.tgz, and that the current directory is \perl-modules.

  • gunzip X-Y-N.NN.tgz
  • tar mxvf X-Y-N.NN.tar
  • cd X-Y-N.NN
  • perl Makefile.PL
  • nmake
  • nmake test
  • nmake install
  • cd ..

New Style Installation

Assume X-Y-N.NN.tgz, and that the current directory is \perl-modules.

  • gunzip X-Y-N.NN.tgz
  • tar mxvf X-Y-N.NN.tar
  • cd X-Y-N.NN
  • perl Build.PL
  • perl Build
  • perl Build test
  • perl Build install
  • cd ..

The Environment

Ensure you've set these environment variables for Apache:

  • DOMAIN=www.ronnie.net.au

    Ie use something, anything!

    I don't use savage.net.au here because the latter is a real domain name, and my local copy of Apache is not hosting the real savage.net.au.

    I use a dummy value here (www.ronnie.net.au), and a real value (savage.net.au) above when the configuration program is running.

  • HOME=d:\
  • NAME=RSavage

    Ie use your name without spaces.

  • TERM=dumb

Upgrading Apache and Perl

Version 1.00 of this document: 9-Jan-2005.

These instructions are for installing/upgrading Perl, Apache and mod_perl, for MS Windows.

The versions in question have been compiled by Randy Kobes.

Current versions:

  • Perl V 5.8.6
  • Apache V 2.0.52
  • mod_perl V 1.99_20

Instructions cover both installing and upgrading. This just means skip the backup and rename instructions when installing for the first time.

Warning: Apache is now so large, ie full of features, that this version cannot be started on a Pentium II running at 266 MHz under Win2K. It just times out. You have been warned.

Downloading and installing

  • Download

    Go to http://www.apache.org/dyn/closer.cgi/perl/win32-bin/ and choose a mirror.

    Download these files:

    • Perl-5.8-win32-bin.readme
    • Perl-5.8-win32-bin.exe
    • apxs_win32.readme
    • apxs_win32.tar.gz

    Read the Readmes.

  • Stop and uninstall Apache
    	shell>apache -k stop
    	shell>apache -k uninstall

    Warning: Rebooting will be necessary to remove old DLLs from memory. Don't reboot just yet. Rather, edit the environment (see below) and then reboot.

  • Rename the old versions

    Q: Why rename rather than delete? Because below we will copy old files into the new installation.

    Rename c:\apache2 to c:\apache2-old.

    Rename c:\perl to c:\perl-old.

    Rename c:\usr\bin\perl.exe c:\usr\bin\perl-old.exe.

    The point of c:\usr\bin\perl is so your CGI scripts under Apache/Windows can use, on the she-bang line:

    	#!/usr/bin/perl
  • Run the installer

    Run the Perl-5.8-win32-bin.exe you downloaded.

    Warning: When the Config dialog box comes up, immediately click on the title bar to give the dialog box the focus. If you don't, when you click elsewhere, the dialog will vanish.

    Install it into c:\, not the default which is a sub-directory. Using c:\ results in creating c:\apache2 and c:\perl, which is presumably what you want.

    Fill in the details as appropriate. Typical values:

    • User name: ron
    • Hostname: savage.net.au
    • Email: ron@savage.net.au

    And yes, this hostname is not the same as the value for the env var DOMAIN.

    See below for an explanation of this discrepancy.

    This value of hostname will be written into several places within c:\apache2\conf\httpd.conf.

    See below for a discussion of httpd.conf.

    So now, click on Configure, and then on Yes to build the HTML.

    Time passes...

  • Update perl.exe in c:\usr\bin\

    Copy c:\perl\bin\perl.exe to c:\usr\bin\.

  • Unpack apxs_win32.tar.gz

    Into c:\temp, say, and follow the instructions in the Readme.

    This will update c:\apache2\bin\ap* and c:\apache2\build\config_vars.mk.

  • Patch c:\perl\site\lib\Apache\TestConfigData.pm

    This file probably has d: hard-coded on line 7. Change it to c: (ie to suit your setup).

    This is needed for when you try to install a new version of Apache::Test.

Perl's Configuration

The installation instructions will tell you to check various files.

The one you may need to clean up is c:\perl\lib\CPAN/Config.pm.

The Environment

If you selected the option to add directories to the PATH, you will need to reboot for this to be effective.

But before rebooting, ensure you've set these environment variables too:

  • DOMAIN=www.ronnie.net.au

    Ie use something, anything!

    I don't use savage.net.au here because the latter is a real domain name, and my local copy of Apache is not hosting the real savage.net.au.

    I use a dummy value here (www.ronnie.net.au), and a real value (savage.net.au) above when the configuration program is running.

  • HOME=c:\
  • NAME=RSavage

    Ie use your name without spaces.

  • TERM=dumb

Rebooting

Reboot to activate the system environment variables and to remove DLLs from memory. Note:

  • The following will not work
    	shell>apache -k stop
    	shell>apache -k start

    Ie will not make the env variables available for CGI scripts.

  • The following will not work
    	shell>apache -k stop
    	shell>apache -k uninstall
    	shell>apache -k install
    	shell>apache -k start
  • The following will not work
    	shell>apache -k stop
    	shell>apache -k uninstall
    	Log off Windows as admin
    	Log on Windows as admin
    	shell>apache -k install
    	shell>apache -k start

You must reboot.

Restarting Apache is explained below.

Getting Back to Where You Were

Firstly, you may want to clean up the new installation before re-installing your files.

In particular, I delete everything in these directories:

  • c:\apache2\cgi-bin\
  • c:\apache2\htdocs\
  • c:\apache2\logs\
  • c:\apache2\perl\

Secondly, of all the files you retained by renaming the old versions of Perl and Apache, these are the most important ones you must carefully extract data from and copy into the new installation:

  • c:\pache2-old\conf\httpd.conf

    This file is discussed separately below.

  • c:\apache2-old\conf\perl.conf
  • c:\apache2-old\conf\startup.pl

Editing c:\apache2\conf\httpd.conf

Note: A lot of lines in httpd.conf have trailing spaces, so if you configure your editor the way I do mine, to delete these, quite a few petty differences will be highlighted between the old and new versions of this file.

  • ServerAdmin

    Line 213 is ServerAdmin ron@savage.net.au. I leave this as is.

  • savage.net.au

    All other references to savage.net.au I change to 127.0.0.1.

  • Allow from all

    These 2 lines:

    	Order allow,deny
    	Allow from all

    occur often within httpd.conf.

    They allow people external to my PC access to my files. I change all these to:

    	Order deny,allow
    	Deny from all
    	Allow from 127.0.0.1
  • Status and Info

    I uncomment all lines referring to these:

    	<Location /server-status>
    	<Location /server-info>

    This includes not just the 2 blocks of options starting with these 2 lines, but also these 2 lines earlier on in the file:

    	LoadModule info_module modules/mod_info.so
    	LoadModule info_module modules/mod_status.so

    This includes changing the 2 lines which read Allow from .@@DomainName@@ to read Allow from 127.0.0.1.

  • Apache::Reload

    I add lines like these to the end of httpd.conf:

    	PerlModule Apache::Reload
    	PerlInitHandler Apache::Reload
    	PerlSetVar ReloadAll Off
    	PerlSetVar ReloadModules "Local::* Local::Mail::*"

Patching Time::Local

You have to patch line 152 of c:\perl\lib\Time\Local.pm, to change the token $MinInt to 0.

Firewall hell

Some ppd files, used by ppm, run extra Perl scripts. If your firewall disallows this, as mine does, you can download the modules mentioned next, edit the ppd files, and run ppm locally.

Native Perl modules

Some Perl modules may have been updated since the current version of Perl-5.8-win32-bin.exe was created.

  • modulereport

    To check if modules on CPAN are more recent than those included in this Perl package, download modulereport-1.91.tgz from http://www.webdragon.net/. modulereport requires direct access to CPAN.

  • Digest::MD5

    This module is used by Apache or mod_perl, so you will need to upgrade it before installing Apache.

    If you try to upgrade it with Apache running, you'll get the error:

    	Unable to unlink .../MD5.dll
  • PPMs

    Here's how you would upgrade DBI, for example:

    	shell>ppm install --location=http://theoryx5.uwinnipeg.ca/ppms DBI

    If you wish to set the repository within the ppm shell, set it to (I have not used this):

    	http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58

    ActiveState's repository is:

    	http://www.activestate.com/ppmpackages/5.8-windows/

Your Perl modules

Now for the bad news: You need to re-install all the Perl modules you use but which do not come with Perl.

Starting Apache

	shell>apache -k install
	shell>apache -k start

Note: The latter command might tie up a DOS box. If it does, just open another DOS box and type:

	shell>apache -k stop

The next alternative is cleaner (you'll still need to run the '-k install' line).

Under Windows XP you can do this to start Apache (almost identical instructions apply to WinNT and Win2k):

  • Go to /Start/Control Panel/Administrative tools/Services
  • Right-click on Apache2, and slide the highlight down to Start. Release the button

mod_perl (Old instructions)

Upgrading mod_perl involves stopping and starting Apache, which should be obvious when you think about it.

What follows are old instructions, kept here just in case you need them :-).

If you don't need them, skip down to Resources.

All instructions in this block assume we are in \temp\mod_perl.

  • Go to http://theoryx5.uwinnipeg.ca/ppms/
  • Download mod_perl.ppd
  • Go to http://theoryx5.uwinnipeg.ca/ppms/scripts/
  • Download install_modperl
  • Download mod_perl.so
  • Go to http://theoryx5.uwinnipeg.ca/ppms/x86/
  • Download mod_perl.tar.gz
  • Edit mod_perl.ppd:
    	Delete line 8: INSTALL...
    	Patch line 9: CODEBASE HREF="./mod_perl.tar.gz"
  • Edit install_modperl:
    	Comment out line 15: #getstore($remote, $file);
  • Stop Apache
  • Uninstall Apache
  • Run install_modperl
    	shell>perl install_modperl
    	This outputs a lot of stuff. Read it carefully
  • Run ppm:
    	Edit \Perl\site\lib\ppm.xml to fix the BUILDDIR option on line 4, if necessary:
    	BUILDDIR="C:\Temp"
    	Edit \Perl\site\lib\PPM.pm to comment out lines 455 .. 457 (God knows why,
    	but if you don't, ppm will abort with 'Unable to remove directory'), if necessary:
    	# if ($options{'CLEAN'} && !-f "$install_dir/install.ppm") {
    	# File::Path::rmtree($install_dir,0,0);
    	# }
    	Edit \Perl\site\lib\ppm.xml to remove mod_perl
    	shell>ppm install --location=. mod_perl

Resources

This document: http://savage.net.au/Perl/html/upgrade-perl-apache.html.

General Apache instructions: http://perl.apache.org/docs/index.html

Porting Apache instructions: http://perl.apache.org/docs/2.0/user/compat/compat.html

Alternate Apache installation instructions: http://beaucox.com/mason/mason-with-apmp2-mini-HOWTO.htm

Upgrading MySQL: http://savage.net.au/Perl/html/upgrade-mysql.html

MS VC++ V 6: http://savage.net.au/Perl/html/install-ms-vc++-v6.html.

Various tools I use: http://savage.net.au/Perl/html/install-various-tools.html.

Author

Ron Savage.

Home page: http://savage.net.au/index.html

This POD was converted to HTML by /Perl.html#fancy-pom2.pl

  • Version: 1.01 01-Jun-2006

    This version disguises my email address.

  • Version: 1.00 18-Feb-2002

    Original version.

Licence

Australian Copyright © 2002 Ron Savage. All rights reserved.

	All Programs of mine are 'OSI Certified Open Source Software';
	you can redistribute them and/or modify them under the terms of
	The Artistic License, a copy of which is available at:
	http://www.opensource.org/licenses/index.html
 
Top of page