Page is a not externally linkable
andreasfriedrich - 5:00 pm on Dec 12, 2002 (gmt 0)
#!/usr/bin/perl
#
#-----------------------------------------------------------------------------#
#
# Copyright (c) 2002 Andreas Friedrich. All rights reserved.
#
# This script prepares the system to run Apache, PHP and MySQL
# directly from CD-ROM.
#
# It relies on the correct setting of the TEMP and windir environment
# variables.
#
#-----------------------------------------------------------------------------#
#
use Cwd;
use File::Copy;
use File::Path;
#
use strict;
#
my ($cwd) = cwd =~ /^([a-zA-Z]:)/;
my $tmp = $ENV{TEMP};
my $win = $ENV{windir};
#
print $tmp, "\n", $cwd;
#
mkpath "$tmp/Apache";
#
open 'IN', "<$cwd/Apache/conf/httpd.conf"
or die "Couldnīt open $cwd/Apache/conf/httpd.conf: $!\n";
open 'OUT', ">$tmp/Apache/httpd.conf"
or die "Couldnīt open $tmp/httpd.conf: $!\n";
#
while (<IN>) {
s!%%DRIVE%%!$cwd!g;
s!%%LOGS%%!$tmp/Apache!g;
print OUT;
}
#
close 'IN';
close 'OUT';
#
copy "$cwd/php-4.2.3-Win32/php4ts.dll", "$win/php4ts.dll"
or die "Couldnīt copy $cwd/php-4.2.3-Win32/php4ts.dll to $win/php4ts.dll: $!\n";
#
system "start MySQL/bin/mysqld-opt.exe --skip-innodb";
system "start Apache/Apache.exe -f $tmp/Apache/httpd.conf";
system "start $cwd/start.html";