--- doc/install/linux/install.pl 2021/03/11 21:00:36 1.45.2.10 +++ doc/install/linux/install.pl 2021/03/13 00:05:06 1.45.2.11 @@ -27,6 +27,7 @@ use strict; use File::Copy; use Term::ReadKey; use DBI; +use File::Spec; use Cwd(); use File::Basename(); use lib File::Basename::dirname(Cwd::abs_path($0)); @@ -75,7 +76,7 @@ if (!open(LOG,">>loncapa_install.log")) &mt('Stopping execution.')."\n"; exit; } else { - print LOG '$Id: install.pl,v 1.45.2.10 2021/03/11 21:00:36 raeburn Exp $'."\n"; + print LOG '$Id: install.pl,v 1.45.2.11 2021/03/13 00:05:06 raeburn Exp $'."\n"; } # @@ -2324,10 +2325,15 @@ sub copy_apache2_debconf { copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.conf.original"); } else { copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.conf"); - symlink("$apache2_conf_available_dir/loncapa.conf","$defaultconf"); + chdir($apache2_conf_enabled_dir); + symlink('../conf-available/loncapa.conf','loncapa.conf'); + chdir($instdir); } if (-l $defaultconf) { my $linkfname = readlink($defaultconf); + if ($linkfname ne '') { + $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,$apache2_conf_enabled_dir)); + } if ($linkfname eq "$apache2_conf_available_dir/loncapa") { unlink($defaultconf); } @@ -2345,6 +2351,9 @@ sub copy_apache2_debconf { } if (-l $defaultconf) { my $linkfname = readlink($defaultconf); + if ($linkfname ne '') { + $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,$apache2_conf_enabled_dir)); + } if ($linkfname eq "$apache2_conf_available_dir/loncapa.conf") { unless ($diffres) { $skipconf = 1; @@ -2360,7 +2369,9 @@ sub copy_apache2_debconf { if (-l $defaultconf) { unlink($defaultconf); } - symlink("$apache2_conf_available_dir/loncapa.conf","$defaultconf"); + chdir($apache2_conf_enabled_dir); + symlink('../conf-available/loncapa.conf','loncapa.conf'); + chdir($instdir); } my $stdsite = "$instdir/debian-ubuntu/ubuntu14/loncapa_site"; if ((-e $stdsite) && (-e "$apache2_sites_available_dir/loncapa")) { @@ -2375,6 +2386,9 @@ sub copy_apache2_debconf { } if (-l $defaultconfig) { my $linkfname = readlink($defaultconfig); + if ($linkfname ne '') { + $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,$apache2_sites_enabled_dir)); + } if ($linkfname eq "$apache2_sites_available_dir/loncapa") { unlink($defaultconfig); } @@ -2392,7 +2406,10 @@ sub copy_apache2_debconf { } if (-l $defaultsite) { my $linkfname = readlink($defaultsite); - if ($linkfname eq "$apache2_conf_available_dir/loncapa.conf") { + if ($linkfname ne '') { + $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,$apache2_sites_enabled_dir)); + } + if ($linkfname eq "$apache2_sites_available_dir/loncapa.conf") { unless ($diffres) { $skipsite = 1; } @@ -2404,11 +2421,16 @@ sub copy_apache2_debconf { print_and_log(&mt('Copying loncapa [_1] site file to [_2] and pointing [_3] to it from sites-enabled.',"'apache2'","'/etc/apache2/sites-available'","'loncapa.conf symlink'")."\n"); copy("$instdir/debian-ubuntu/ubuntu14/loncapa_site","$apache2_sites_available_dir/loncapa.conf"); chmod(0444,"$apache2_sites_available_dir/loncapa.conf"); - symlink("$apache2_sites_available_dir/loncapa.conf","$defaultsite"); + chdir($apache2_sites_enabled_dir); + symlink('../sites-available/loncapa.conf','loncapa.conf'); + chdir($instdir); } - if (-l defaultconfig) { + if (-l $defaultconfig) { my $linkfname = readlink($defaultconfig); - if ($linkfname eq "$apache2_sites_available_dir/000-default") { + if ($linkfname ne '') { + $linkfname = Cwd::abs_path(File::Spec->rel2abs($linkfname,$apache2_sites_enabled_dir)); + } + if ($linkfname eq "$apache2_sites_available_dir/000-default.conf") { unlink($defaultconfig); } }