--- doc/install/linux/install.pl 2021/03/11 20:59:34 1.69 +++ doc/install/linux/install.pl 2021/03/13 00:04:36 1.70 @@ -29,6 +29,7 @@ use Term::ReadKey; use Socket; use Sys::Hostname::FQDN(); use DBI; +use File::Spec; use Cwd(); use File::Basename(); use lib File::Basename::dirname(Cwd::abs_path($0)); @@ -77,7 +78,7 @@ if (!open(LOG,">>loncapa_install.log")) &mt('Stopping execution.')."\n"; exit; } else { - print LOG '$Id: install.pl,v 1.69 2021/03/11 20:59:34 raeburn Exp $'."\n"; + print LOG '$Id: install.pl,v 1.70 2021/03/13 00:04:36 raeburn Exp $'."\n"; } # @@ -3216,10 +3217,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); } @@ -3237,6 +3243,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; @@ -3252,7 +3261,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")) { @@ -3267,6 +3278,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); } @@ -3284,7 +3298,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; } @@ -3296,11 +3313,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); } }