--- doc/install/linux/install.pl 2011/05/16 14:00:09 1.13 +++ doc/install/linux/install.pl 2011/05/26 13:33:30 1.17 @@ -72,7 +72,7 @@ if (!open(LOG,">>loncapa_install.log")) &mt('Stopping execution.')."\n"; exit; } else { - print LOG '$Id: install.pl,v 1.13 2011/05/16 14:00:09 raeburn Exp $'."\n"; + print LOG '$Id: install.pl,v 1.17 2011/05/26 13:33:30 raeburn Exp $'."\n"; } # @@ -600,11 +600,11 @@ sub chkapache { my ($distro,$instdir) = @_; my $fixapache = 1; if ($distro =~ /^(debian|ubuntu)/) { - if (!-e "$instdir/debian-ubuntu/apache2.conf") { + if (!-e "$instdir/debian-ubuntu/loncapa") { $fixapache = 0; print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n"; - } elsif ((-e "/etc/apache2/sites-available/loncapa") && (-e "$instdir/debian-ubuntu/apache2.conf")) { - if (open(PIPE, "diff --brief $instdir/debian-ubuntu/apache2.conf /etc/apache2/sites-available/loncapa |")) { + } elsif ((-e "/etc/apache2/sites-available/loncapa") && (-e "$instdir/debian-ubuntu/loncapa")) { + if (open(PIPE, "diff --brief $instdir/debian-ubuntu/loncapa /etc/apache2/sites-available/loncapa |")) { my $diffres = ; close(PIPE); chomp($diffres); @@ -653,11 +653,21 @@ sub chkapache { } } } else { - if (!-e "$instdir/centos-rhes-fedora-sl/httpd.conf") { + my $configfile = 'httpd.conf'; + if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) { + if ($1 > 5) { + $configfile = 'new/httpd.conf'; + } + } elsif ($distro =~ /^fedora(\d+)$/) { + if ($1 > 10) { + $configfile = 'new/httpd.conf'; + } + } + if (!-e "$instdir/centos-rhes-fedora-sl/$configfile") { $fixapache = 0; print &mt('Warning: No LON-CAPA Apache configuration file found for installation check.')."\n"; - } elsif ((-e "/etc/httpd/conf/httpd.conf") && (-e "$instdir/centos-rhes-fedora-sl/httpd.conf")) { - if (open(PIPE, "diff --brief $instdir/centos-rhes-fedora-sl/httpd.conf /etc/httpd/conf/httpd.conf |")) { + } elsif ((-e "/etc/httpd/conf/httpd.conf") && (-e "$instdir/centos-rhes-fedora-sl/$configfile")) { + if (open(PIPE, "diff --brief $instdir/centos-rhes-fedora-sl/$configfile /etc/httpd/conf/httpd.conf |")) { my $diffres = ; close(PIPE); chomp($diffres); @@ -689,10 +699,10 @@ sub chksrvcs { close(PIPE); if ($daemonrunning) { if ($service eq 'memcached') { - my $cmd = '/usr/sbin/memcached'; - if ($distro =~ /^centos|fedora|scientific|rhes/) { - $cmd = '/usr/bin/memcached'; - } + my $cmd = '/usr/bin/memcached'; + if ($distro =~ /^(suse|sles)/) { + $cmd = '/usr/sbin/memcached'; + } unless ($daemonrunning =~ m{^www[^/]+\Q$cmd -m 400 -v\E$}) { $stopsrvcs{$service} = 1; } @@ -1255,7 +1265,7 @@ if ($callsub{'apache'}) { } elsif ($distro =~ /^(debian|ubuntu)/) { ©_apache2_debconf($instdir); } else { - ©_httpd_conf($instdir); + ©_httpd_conf($instdir,$distro); } } else { print_and_log(&mt('Skipping configuration of Apache web server.')."\n"); @@ -1689,18 +1699,28 @@ sub get_mysql_version { ########################################################### sub copy_httpd_conf { - my ($instdir) = @_; + my ($instdir,$distro) = @_; + my $configfile = 'httpd.conf'; + if ($distro =~ /^(?:centos|rhes|scientific)(\d+)$/) { + if ($1 > 5) { + $configfile = 'new/httpd.conf'; + } + } elsif ($distro =~ /^fedora(\d+)$/) { + if ($1 > 10) { + $configfile = 'new/httpd.conf'; + } + } print_and_log(&mt('Copying the LON-CAPA [_1] to [_2].',"'httpd.conf'", "'/etc/httpd/conf/httpd.conf'")."\n"); copy "/etc/httpd/conf/httpd.conf","/etc/httpd/conf/httpd.conf.original"; - copy "$instdir/centos-rhes-fedora-sl/httpd.conf","/etc/httpd/conf/httpd.conf"; + copy "$instdir/centos-rhes-fedora-sl/$configfile","/etc/httpd/conf/httpd.conf"; chmod(0444,"/etc/httpd/conf/httpd.conf"); print_and_log("\n"); } ######################################################### ## -## Ubuntu/Debian -- copy our apache2 configuration file to +## Ubuntu/Debian -- copy our loncapa configuration file to ## sites-available and set the symlink from sites-enabled. ## ######################################################### @@ -1716,7 +1736,7 @@ sub copy_apache2_debconf { if (-e "$apache2_sites_available_dir/loncapa") { copy("$apache2_sites_available_dir/loncapa","$apache2_sites_available_dir/loncapa.original"); } - copy("$instdir/debian-ubuntu/apache2.conf","$apache2_sites_available_dir/loncapa"); + copy("$instdir/debian-ubuntu/loncapa","$apache2_sites_available_dir/loncapa"); chmod(0444,"$apache2_sites_available_dir/loncapa"); symlink("$apache2_sites_available_dir/loncapa","$apache2_sites_enabled_dir/000-default"); my $apache2_mods_enabled_dir = '/etc/apache2/mods-enabled';