version 1.80, 2015/01/03 03:00:18
|
version 1.83, 2016/07/29 17:26:44
|
Line 33 http://www.lon-capa.org/
|
Line 33 http://www.lon-capa.org/
|
<target dist='default'>/</target> |
<target dist='default'>/</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
$|=1; |
$|=1; |
|
use strict; |
print(<<END); |
print(<<END); |
|
|
|
|
Line 53 END
|
Line 54 END
|
<file> |
<file> |
<target dist='default'>loncom/hosts.tab</target> |
<target dist='default'>loncom/hosts.tab</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
|
my $lonCluster; |
unless (-l "<TARGET />") { |
unless (-l "<TARGET />") { |
print(<<END); |
print(<<END); |
|
|
=============================================================================== |
=============================================================================== |
Which cluster option would you like to have installed? |
Which cluster option would you like to have installed? |
IMPORTANT: to take advantage of the cluster options 1) and 3), |
IMPORTANT: to take advantage of the cluster options 1) and 3), |
you must contact lon-capa\@lon-capa.org. |
you must contact loncapa\@loncapa.org. |
|
|
1) PRODUCTION - you want to eventually connect this machine to the |
1) PRODUCTION - you want to eventually connect this machine to the |
LON-CAPA content sharing network. This setting is for |
LON-CAPA content sharing network. This setting is for |
schools, colleges, and universities, that currently |
schools, colleges, and universities, that currently |
are running - or in the future will run - courses |
are running - or in the future will run - courses. |
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
not be connected to other LON-CAPA machines for now |
not be connected to other LON-CAPA machines for now. |
3) DEVELOPMENT - you want to do software (not content!) development with |
3) DEVELOPMENT - you want to do software (not content!) development with |
this workstation and eventually link it with the |
this workstation and eventually link it with the |
workstations of other LON-CAPA software developers. |
workstations of other LON-CAPA software developers. |
Line 81 END
|
Line 83 END
|
|
|
# get input |
# get input |
# if valid then process, otherwise loop |
# if valid then process, otherwise loop |
$flag=0; |
my $flag=0; |
while (!$flag) { |
while (!$flag) { |
print "ENTER 1, 2, 3, or 4:\n"; |
print "ENTER 1, 2, 3, or 4:\n"; |
my $choice=<>; |
my $choice=<>; |
Line 131 unless (-e "<TARGET />") {
|
Line 133 unless (-e "<TARGET />") {
|
print(<<END); |
print(<<END); |
WELCOME TO LON-CAPA! |
WELCOME TO LON-CAPA! |
|
|
If you have questions, please visit http://install.lon-capa.org |
If you have questions, please visit http://install.loncapa.org |
or contact helpdesk\@lon-capa.org. |
or contact helpdesk\@loncapa.org. |
|
|
=============================================================================== |
=============================================================================== |
The following 7 values are needed to configure LON-CAPA: |
The following 7 values are needed to configure LON-CAPA: |
* Machine Role |
* Machine Role |
* LON-CAPA Domain Name |
* LON-CAPA Domain Name |
* LON-CAPA Machine ID Name, and |
* LON-CAPA Machine ID Name |
* Server Administration E-mail Address. |
* Server Administration E-mail Address |
* LON-CAPA Domain's Primary Library Server Machine ID |
* LON-CAPA Domain's Primary Library Server Machine ID |
* Web Server Protocol |
* Web Server Protocol |
* Internet Domain Name of Your Institution |
* Internet Domain Name of Your Institution |
Line 160 close(OUT);
|
Line 162 close(OUT);
|
**** Machine Role **** |
**** Machine Role **** |
Library server (recommended if first-time installation of LON-CAPA): |
Library server (recommended if first-time installation of LON-CAPA): |
Servers that are repositories of authoritative educational resources. |
Servers that are repositories of authoritative educational resources. |
These servers also provide the construction space by which instructors |
These servers also provide the authoring spaces in which content |
assemble their classroom online material. |
creators (e.g., faculty instructors) create their learning content. |
Access server: |
Access server: |
Servers that load-balance high-traffic delivery of educational resources |
Servers that load-balance high-traffic delivery of educational resources |
over the world-wide web. |
over the world-wide web. |
Line 206 if ($hostname=~/([^\.]*)\.([^\.]*)$/) {
|
Line 208 if ($hostname=~/([^\.]*)\.([^\.]*)$/) {
|
print(<<END); |
print(<<END); |
|
|
**** Domain **** |
**** Domain **** |
[This does NOT need to correspond to internet address domains. |
[This does NOT need to correspond to an internet address domain. |
Please make this name short AND descriptive of your organization. |
Please make this name short AND descriptive of your organization. |
Domain names are close to impossible to change later!!! |
Domain names are close to impossible to change later!!! |
Good examples might be "msu" or "bionet" or "vermontcc". |
Good examples might be "msu" or "bionet" or "vermontcc". |
Bad examples are "physics" (too general) |
Bad examples are "physics" (too general) |
or "michiganstateuniversity" (too long) |
or "michiganstateuniversity" (too long) |
or "msuedu" (internet domain, just make it "msu") |
or "msuedu" (just make it "msu", or else make it msu.edu) |
or "msuphysics" (only if there is a good reason to limit to department |
or "msuphysics" (only if there is a good reason to limit to department |
- we don't know of one) |
- we don't know of one) |
or "mydomain" (what is that?) |
or "mydomain" (what is that?) |
Line 220 if ($hostname=~/([^\.]*)\.([^\.]*)$/) {
|
Line 222 if ($hostname=~/([^\.]*)\.([^\.]*)$/) {
|
have to actually work together with your colleagues. You can still run |
have to actually work together with your colleagues. You can still run |
multiple library servers within the same domain. |
multiple library servers within the same domain. |
If this domain is eventually going to be part of the main production |
If this domain is eventually going to be part of the main production |
cluster, you MUST contact the LON-CAPA group at MSU (loncapa@loncapa.org) |
cluster, you MUST contact the LON-CAPA group at MSU (loncapa\@loncapa.org) |
to have a domain name assigned, and then use it exactly as given. This is |
to have a domain name assigned, and then use it exactly as given. This is |
also true for test installs that might eventually turn into production setups. |
also true for test installs that might eventually turn into production setups. |
Stop now if you didn't do so.] |
The short domain name needs to be unique, if your aim is to join a cluster |
|
containing existing domains. Stop now if you have not yet contacted the |
|
MSU LON-CAPA group.] |
END |
END |
|
|
# get domain name |
# get domain name |
Line 380 This should be the LON-CAPA machine ID o
|
Line 384 This should be the LON-CAPA machine ID o
|
domain. If you only have a single library server in your domain, then |
domain. If you only have a single library server in your domain, then |
the Primary Library server ID will be the machine ID of that server. |
the Primary Library server ID will be the machine ID of that server. |
This server will be where domain data which are not associated with any |
This server will be where domain data which are not associated with any |
specific home library server will be stored (e.g., e-mail broadcast by |
specific home library server will be stored (e.g., configurations that |
administrators to users in the domain). |
apply to all nodes in the domain). |
END |
END |
if (defined($primaryLibServer)) { |
if (defined($primaryLibServer)) { |
print(<<END); |
print(<<END); |
Line 522 while (!$flag) {
|
Line 526 while (!$flag) {
|
|
|
The internet domain name used for servers at your institution |
The internet domain name used for servers at your institution |
should be provided. This will be similar to: ustate.edu or |
should be provided. This will be similar to: ustate.edu or |
topcollege.ac.uk or my.hostingcompany.com, i.e., the part of |
topcollege.ac.uk or myhostingcompany.com, i.e., the part of |
a server hostname which indicates to which organization the |
a server hostname which indicates to which organization the |
server belongs. |
server belongs. |
|
|
Line 546 END
|
Line 550 END
|
|
|
# update loncapa.conf |
# update loncapa.conf |
my $confdir = '/etc/httpd/conf/'; |
my $confdir = '/etc/httpd/conf/'; |
if ('<DIST />' eq 'sles10' || '<DIST />' eq 'sles11' || '<DIST />' eq 'sles12' || '<DIST />' eq 'suse10.1' || '<DIST />' eq 'suse10.2' || '<DIST />' eq 'suse10.3' || '<DIST />' eq 'suse11.1' || '<DIST />' eq 'suse11.2' || '<DIST />' eq 'suse11.3' || '<DIST />' eq 'suse11.4' || '<DIST />' eq 'suse12.1' || '<DIST />' eq 'suse12.2' || '<DIST />' eq 'suse12.3' || '<DIST />' eq 'suse13.1' || '<DIST />' eq 'suse13.2' || '<DIST />' eq 'debian5' || '<DIST />' eq 'debian6' || '<DIST />' eq 'ubuntu6' || '<DIST />' eq 'ubuntu8' || '<DIST />' eq 'ubuntu10' || '<DIST />' eq 'ubuntu12' || '<DIST />' eq 'ubuntu14') { |
if ('<DIST />' eq 'sles10' || '<DIST />' eq 'sles11' || '<DIST />' eq 'sles12' || '<DIST />' eq 'suse10.1' || '<DIST />' eq 'suse10.2' || '<DIST />' eq 'suse10.3' || '<DIST />' eq 'suse11.1' || '<DIST />' eq 'suse11.2' || '<DIST />' eq 'suse11.3' || '<DIST />' eq 'suse11.4' || '<DIST />' eq 'suse12.1' || '<DIST />' eq 'suse12.2' || '<DIST />' eq 'suse12.3' || '<DIST />' eq 'suse13.1' || '<DIST />' eq 'suse13.2' || '<DIST />' eq 'debian5' || '<DIST />' eq 'debian6' || '<DIST />' eq 'ubuntu6' || '<DIST />' eq 'ubuntu8' || '<DIST />' eq 'ubuntu10' || '<DIST />' eq 'ubuntu12' || '<DIST />' eq 'ubuntu14' || '<DIST />' eq 'ubuntu16') { |
$confdir = '/etc/apache2/'; |
$confdir = '/etc/apache2/'; |
} |
} |
my $filename='loncapa.conf'; |
my $filename='loncapa.conf'; |
Line 579 my %perlvar;
|
Line 583 my %perlvar;
|
unless ($perlvar{'lonReceipt'} and $perlvar{'lonReceipt'}!~/\{\[\[\[\[/) { |
unless ($perlvar{'lonReceipt'} and $perlvar{'lonReceipt'}!~/\{\[\[\[\[/) { |
my $lonReceipt=''; |
my $lonReceipt=''; |
srand(time ^ $$ ^ unpack "%L*", `ps axww | gzip`); |
srand(time ^ $$ ^ unpack "%L*", `ps axww | gzip`); |
my @alnum=(0..9,a..z); |
my @alnum=(0..9,"a".."z"); |
foreach my $i (1..20) { |
foreach my $i (1..20) { |
$lonReceipt.=$alnum[int(rand(36))]; |
$lonReceipt.=$alnum[int(rand(36))]; |
} |
} |
Line 603 END
|
Line 607 END
|
</file> |
</file> |
<file> |
<file> |
<target dist='default'>/etc/httpd/conf/</target> |
<target dist='default'>/etc/httpd/conf/</target> |
<target dist='sles10 sles11 sles12 suse10.1 suse10.2 suse10.3 suse11.1 suse11.2 suse11.3 suse11.4 suse12.1 suse12.2 suse12.3 suse13.1 suse13.2 debian5 debian6 ubuntu6 ubuntu8 ubuntu10 ubuntu12 ubuntu14'>/etc/apache2/</target> |
<target dist='sles10 sles11 sles12 suse10.1 suse10.2 suse10.3 suse11.1 suse11.2 suse11.3 suse11.4 suse12.1 suse12.2 suse12.3 suse13.1 suse13.2 debian5 debian6 ubuntu6 ubuntu8 ubuntu10 ubuntu12 ubuntu14 ubuntu16'>/etc/apache2/</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
sub securesetting { |
sub securesetting { |
my (%perlvar)=@_; |
my (%perlvar)=@_; |
Line 656 my ($securestatus,$securenum);
|
Line 660 my ($securestatus,$securenum);
|
unless ($perlvar{'lonReceipt'} and $perlvar{'lonReceipt'}!~/\{\[\[\[\[/) { |
unless ($perlvar{'lonReceipt'} and $perlvar{'lonReceipt'}!~/\{\[\[\[\[/) { |
my $lonReceipt=''; |
my $lonReceipt=''; |
srand(time ^ $$ ^ unpack "%L*", `ps axww | gzip`); |
srand(time ^ $$ ^ unpack "%L*", `ps axww | gzip`); |
my @alnum=(0..9,a..z); |
my @alnum=(0..9,"a".."z"); |
foreach my $i (1..20) { |
foreach my $i (1..20) { |
$lonReceipt.=$alnum[int(rand(36))]; |
$lonReceipt.=$alnum[int(rand(36))]; |
} |
} |
Line 736 my %perlvarstatic;
|
Line 740 my %perlvarstatic;
|
} |
} |
} |
} |
|
|
while(!$primaryLibServ && (@hosts_file || @domain_files)) { |
while(!$primaryLibServer && (@hosts_files || @domain_files)) { |
my $file = shift(@domain_files); |
my $file = shift(@domain_files); |
open(IN,'<'.$file); |
open(IN,'<'.$file); |
while(my $line = <IN>) { |
while(my $line = <IN>) { |
Line 765 my %perlvarstatic;
|
Line 769 my %perlvarstatic;
|
# implement editing logic below, interactively |
# implement editing logic below, interactively |
# update loncapa.conf until 14 is entered |
# update loncapa.conf until 14 is entered |
|
|
$flag=0; |
my $flag=0; |
|
|
while (!$flag) { |
while (!$flag) { |
print(<<END); |
print(<<END); |
Line 790 END
|
Line 794 END
|
|
|
my @error; |
my @error; |
foreach my $v ($perlvar{'lonDefDomain'},$perlvar{'lonHostID'}) { |
foreach my $v ($perlvar{'lonDefDomain'},$perlvar{'lonHostID'}) { |
if (length($v)>35) { $error.="\nName $v too long"; } |
if (length($v)>35) { push(@error,"Name $v too long"); } |
if (length($v)<2) { $error.="\nName $v too short"; } |
if (length($v)<2) { push(@error,"Name $v too short"); } |
if ($v=~/capa/i) { |
if ($v=~/capa/i) { |
if ($v!~/^oucapa\d+$/ && |
if ($v!~/^oucapa\d+$/ && |
($v!~/^capa\d+$/ && $perlvar{'lonDefDomain'} eq 'uwsp')) { |
($v!~/^capa\d+$/ && $perlvar{'lonDefDomain'} eq 'uwsp')) { |
Line 993 POSSIBLE CHOICES:
|
Line 997 POSSIBLE CHOICES:
|
3) allow insecure connections to this machine but only allow connections |
3) allow insecure connections to this machine but only allow connections |
to machines that support secure connections |
to machines that support secure connections |
4) allow insecure connections |
4) allow insecure connections |
ENTER NEW VALUE (currenly $securenum): |
ENTER NEW VALUE (currently $securenum): |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
Line 1008 END
|
Line 1012 END
|
} |
} |
($securestatus,$securenum)=&securesetting(%perlvar); |
($securestatus,$securenum)=&securesetting(%perlvar); |
} |
} |
elsif (($choice==14) && (!$error)) { |
elsif (($choice==14) && (!@error)) { |
$flag=1; |
$flag=1; |
} |
} |
else { |
else { |
Line 1035 END
|
Line 1039 END
|
<perlscript mode='fg'> |
<perlscript mode='fg'> |
unless (-l "<TARGET />") { |
unless (-l "<TARGET />") { |
my $hostname=`hostname -f`;chomp($hostname); |
my $hostname=`hostname -f`;chomp($hostname); |
$date=`date -I`; chomp($date); |
my $date=`date -I`; chomp($date); |
$lonHostID=$perlvar{'lonHostID'}; |
my $lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=~s/[^\w\-.]//g; |
$lonHostID=~s/[^\w\-.]//g; |
$lineexistflag=0; |
my $lineexistflag=0; |
$hostidexistflag=0; |
my $hostidexistflag=0; |
$line2insert=<<END; |
my $line2insert=<<END; |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$protocol:$intdom |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$protocol:$intdom |
END |
END |
if (!$domainTabExtras) { |
if (!$domainTabExtras) { |
$domainTabExtras=':::::'; |
$domainTabExtras=':::::'; |
} |
} |
$domaininsert="$perlvar{'lonDefDomain'}:$domainDescription:$domainTabExtras:$primaryLibServer\n"; |
my $domaininsert="$perlvar{'lonDefDomain'}:$domainDescription:$domainTabExtras:$primaryLibServer\n"; |
if ($lonCluster eq 'standalone') { |
if ($lonCluster eq 'standalone') { |
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
die('file generation error'); |
die('file generation error'); |
Line 1125 END
|
Line 1129 END
|
} |
} |
} |
} |
$lineexistflag=0; |
$lineexistflag=0; |
|
my $domainexistflag=0; |
if ($flag==1) { |
if ($flag==1) { |
`rm -f ../domain.tab`; |
`rm -f ../domain.tab`; |
`rm -f ../dns_domain.tab`; |
`rm -f ../dns_domain.tab`; |
Line 1154 END
|
Line 1159 END
|
close(OUT); |
close(OUT); |
`ln -s new_${lonCluster}_domain.tab ../domain.tab`; |
`ln -s new_${lonCluster}_domain.tab ../domain.tab`; |
# email appropriate message |
# email appropriate message |
`echo "REPLACEdom:$lonCluster:$lonHostID:$date:$domaninsert" | mail -s "REPLACEdom:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org`; |
`echo "REPLACEdom:$lonCluster:$lonHostID:$date:$domaininsert" | mail -s "REPLACEdom:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org`; |
} |
} |
elsif ($domainexistflag and $lineexistflag) { |
elsif ($domainexistflag and $lineexistflag) { |
`grep -v "$perlvar{'lonDefDomain'}:" ../${lonCluster}_domain.tab > ../new_${lonCluster}_domain.tab`; |
`grep -v "$perlvar{'lonDefDomain'}:" ../${lonCluster}_domain.tab > ../new_${lonCluster}_domain.tab`; |