version 1.69, 2021/03/11 20:59:34
|
version 1.70, 2021/03/13 00:04:36
|
Line 29 use Term::ReadKey;
|
Line 29 use Term::ReadKey;
|
use Socket; |
use Socket; |
use Sys::Hostname::FQDN(); |
use Sys::Hostname::FQDN(); |
use DBI; |
use DBI; |
|
use File::Spec; |
use Cwd(); |
use Cwd(); |
use File::Basename(); |
use File::Basename(); |
use lib File::Basename::dirname(Cwd::abs_path($0)); |
use lib File::Basename::dirname(Cwd::abs_path($0)); |
Line 3216 sub copy_apache2_debconf {
|
Line 3217 sub copy_apache2_debconf {
|
copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.conf.original"); |
copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.conf.original"); |
} else { |
} else { |
copy("$apache2_conf_available_dir/loncapa","$apache2_conf_available_dir/loncapa.conf"); |
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) { |
if (-l $defaultconf) { |
my $linkfname = readlink($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") { |
if ($linkfname eq "$apache2_conf_available_dir/loncapa") { |
unlink($defaultconf); |
unlink($defaultconf); |
} |
} |
Line 3237 sub copy_apache2_debconf {
|
Line 3243 sub copy_apache2_debconf {
|
} |
} |
if (-l $defaultconf) { |
if (-l $defaultconf) { |
my $linkfname = readlink($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") { |
if ($linkfname eq "$apache2_conf_available_dir/loncapa.conf") { |
unless ($diffres) { |
unless ($diffres) { |
$skipconf = 1; |
$skipconf = 1; |
Line 3252 sub copy_apache2_debconf {
|
Line 3261 sub copy_apache2_debconf {
|
if (-l $defaultconf) { |
if (-l $defaultconf) { |
unlink($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"; |
my $stdsite = "$instdir/debian-ubuntu/ubuntu14/loncapa_site"; |
if ((-e $stdsite) && (-e "$apache2_sites_available_dir/loncapa")) { |
if ((-e $stdsite) && (-e "$apache2_sites_available_dir/loncapa")) { |
Line 3267 sub copy_apache2_debconf {
|
Line 3278 sub copy_apache2_debconf {
|
} |
} |
if (-l $defaultconfig) { |
if (-l $defaultconfig) { |
my $linkfname = readlink($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") { |
if ($linkfname eq "$apache2_sites_available_dir/loncapa") { |
unlink($defaultconfig); |
unlink($defaultconfig); |
} |
} |
Line 3284 sub copy_apache2_debconf {
|
Line 3298 sub copy_apache2_debconf {
|
} |
} |
if (-l $defaultsite) { |
if (-l $defaultsite) { |
my $linkfname = readlink($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) { |
unless ($diffres) { |
$skipsite = 1; |
$skipsite = 1; |
} |
} |
Line 3296 sub copy_apache2_debconf {
|
Line 3313 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"); |
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"); |
copy("$instdir/debian-ubuntu/ubuntu14/loncapa_site","$apache2_sites_available_dir/loncapa.conf"); |
chmod(0444,"$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); |
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); |
unlink($defaultconfig); |
} |
} |
} |
} |