[LON-CAPA-cvs] cvs: doc(version_2_11_X) /install/linux install.pl
raeburn
raeburn at source.lon-capa.org
Fri Mar 12 19:05:06 EST 2021
raeburn Sat Mar 13 00:05:06 2021 EDT
Modified files: (Branch: version_2_11_X)
/doc/install/linux install.pl
Log:
- For 2.11
Backport 1.70
Index: doc/install/linux/install.pl
diff -u doc/install/linux/install.pl:1.45.2.10 doc/install/linux/install.pl:1.45.2.11
--- doc/install/linux/install.pl:1.45.2.10 Thu Mar 11 21:00:36 2021
+++ doc/install/linux/install.pl Sat Mar 13 00:05:06 2021
@@ -27,6 +27,7 @@
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 @@
&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 @@
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 @@
}
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 @@
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 @@
}
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 @@
}
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 @@
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);
}
}
More information about the LON-CAPA-cvs
mailing list