version 1.82, 2016/07/29 16:44:36
|
version 1.84, 2016/07/30 00:38:14
|
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; |
use strict; |
|
|
print(<<END); |
print(<<END); |
|
|
|
|
Line 61 unless (-l "<TARGET />") {
|
Line 62 unless (-l "<TARGET />") {
|
=============================================================================== |
=============================================================================== |
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 128 my $domainTabExtras;
|
Line 129 my $domainTabExtras;
|
my $primaryLibServer; |
my $primaryLibServer; |
my $protocol; |
my $protocol; |
my $intdom; |
my $intdom; |
|
my $desiredhostname; |
my @libservers = (); |
my @libservers = (); |
unless (-e "<TARGET />") { |
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 8 values are needed to configure LON-CAPA: |
* Machine Role |
* Machine Role |
* LON-CAPA Domain Name |
* LON-CAPA Domain Name |
* LON-CAPA Machine ID Name |
* LON-CAPA Machine ID Name |
Line 145 The following 7 values are needed to con
|
Line 147 The following 7 values are needed to con
|
* 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 |
|
* Hostname |
=============================================================================== |
=============================================================================== |
|
|
In addition, a Support E-mail Address can also be included. If |
In addition, a Support E-mail Address can also be included. If |
Line 162 close(OUT);
|
Line 165 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 208 if ($hostname=~/([^\.]*)\.([^\.]*)$/) {
|
Line 211 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 225 if ($hostname=~/([^\.]*)\.([^\.]*)$/) {
|
Line 228 if ($hostname=~/([^\.]*)\.([^\.]*)$/) {
|
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 280 END
|
Line 285 END
|
} |
} |
} |
} |
|
|
|
|
# get domain description |
# get domain description |
# accept if valid, if not valid, tell user and repeat |
# accept if valid, if not valid, tell user and repeat |
$flag=0; |
$flag=0; |
Line 382 This should be the LON-CAPA machine ID o
|
Line 386 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 524 while (!$flag) {
|
Line 528 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 545 END
|
Line 549 END
|
} |
} |
} |
} |
|
|
|
# get hostname |
|
# accept if valid, if not valid, tell user and repeat |
|
$flag=0; |
|
my $posshostname; |
|
if (($hostname =~ /^[A-Za-z0-9\-]+$/) && ($intdom ne '')) { |
|
$posshostname = $hostname.'.'.$intdom; |
|
} |
|
if (($hostname =~ /^[A-Za-z0-9\-]+\.[A-Za-z0-9\-]+/) && |
|
($hostname =~ /^[A-Za-z0-9.\-]+$/)) { |
|
$posshostname = $hostname; |
|
} |
|
while (!$flag) { |
|
print(<<END); |
|
|
|
****** Hostname of the server/VM ***** |
|
|
|
The hostname of the server/VM is required. This will be similar to: |
|
somename.ustate.edu or somename.department.ustate.edu, and would be |
|
the web address which users would point their web browsers at to |
|
access the server. |
|
|
|
END |
|
|
|
if ($posshostname) { |
|
print "ENTER HOSTNAME OF SERVER [$posshostname]:\n"; |
|
} else { |
|
print "ENTER HOSTNAME OF SERVER:\n"; |
|
} |
|
|
|
my $choice=<>; |
|
chomp($choice); |
|
if (($choice =~ /^[A-Za-z0-9\-]+\.[A-Za-z0-9\-]+/) && |
|
($choice =~ /^[A-Za-z0-9.\-]+$/)) { |
|
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
|
print(OUT 'hostname'."\t".$choice."\n"); |
|
close(OUT); |
|
$desiredhostname=$choice; |
|
$flag=1; |
|
} elsif (($choice eq '') && ($posshostname ne '')) { |
|
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
|
print(OUT 'hostname'."\t$posshostname\n"); |
|
close(OUT); |
|
$desiredhostname = $posshostname; |
|
$flag = 1; |
|
} else { |
|
print "Invalid input (only letters, numbers, - and . allowed, with at least one .).\n"; |
|
} |
|
} |
|
|
# update loncapa.conf |
# update loncapa.conf |
my $confdir = '/etc/httpd/conf/'; |
my $confdir = '/etc/httpd/conf/'; |
Line 708 my %perlvarstatic;
|
Line 760 my %perlvarstatic;
|
} |
} |
} |
} |
|
|
if (!$protocol) { |
if ((!$protocol) || (!$desiredhostname)) { |
foreach my $file (@hosts_files) { |
foreach my $file (@hosts_files) { |
open(IN,'<'.$file); |
open(IN,'<'.$file); |
while(my $line = <IN>) { |
while(my $line = <IN>) { |
if ($line =~ /^\Q$perlvar{'lonHostID'}\E:\Q$perlvar{'lonDefDomain'}\E\:(?:access|library)\:[^:]+\:(https?)/) { |
if ($line =~ /^\Q$perlvar{'lonHostID'}\E:\Q$perlvar{'lonDefDomain'}\E\:(?:access|library)\:([^:]+)\:(https?)/) { |
$protocol = $1; |
if (!$desiredhostname) { |
chomp($protocol); |
$desiredhostname = $1; |
|
} |
|
if (!$protocol) { |
|
$protocol = $2; |
|
chomp($protocol); |
|
} |
last; |
last; |
} |
} |
} |
} |
Line 765 my %perlvarstatic;
|
Line 822 my %perlvarstatic;
|
} |
} |
|
|
# implement editing logic below, interactively |
# implement editing logic below, interactively |
# update loncapa.conf until 14 is entered |
# update loncapa.conf until 15 is entered |
|
|
my $flag=0; |
my $flag=0; |
|
|
Line 782 This is now the current configuration of
|
Line 839 This is now the current configuration of
|
6) Support E-mail Address: $perlvar{'lonSupportEMail'} |
6) Support E-mail Address: $perlvar{'lonSupportEMail'} |
7) Web Server Protocol (http or https): $protocol |
7) Web Server Protocol (http or https): $protocol |
8) Internet Domain Name: $intdom |
8) Internet Domain Name: $intdom |
9) Role: $perlvar{'lonRole'} |
9) Hostname: $desiredhostname |
10) Cache Expiration Time: $perlvar{'lonExpire'} |
10) Role: $perlvar{'lonRole'} |
11) Server Load: $perlvar{'lonLoadLim'} |
11) Cache Expiration Time: $perlvar{'lonExpire'} |
12) User Load: $perlvar{'lonUserLoadLim'} |
12) Server Load: $perlvar{'lonLoadLim'} |
13) Allow only secure connections: $securestatus |
13) User Load: $perlvar{'lonUserLoadLim'} |
14) Everything is correct up above |
14) Allow only secure connections: $securestatus |
|
15) Everything is correct up above |
END |
END |
|
|
my @error; |
my @error; |
Line 853 if (!defined($primaryLibServer)) {
|
Line 911 if (!defined($primaryLibServer)) {
|
|
|
if (@error) { print "\n*** ERRORS: \n\t".join("\n\t",@error)."\n"; } |
if (@error) { print "\n*** ERRORS: \n\t".join("\n\t",@error)."\n"; } |
print(<<END); |
print(<<END); |
ENTER A CHOICE OF 1-13 TO CHANGE, otherwise ENTER 14: |
ENTER A CHOICE OF 1-14 TO CHANGE, otherwise ENTER 15: |
END |
END |
my $choice=<>; |
my $choice=<>; |
chomp($choice); |
chomp($choice); |
Line 945 END
|
Line 1003 END
|
} |
} |
elsif ($choice==9) { |
elsif ($choice==9) { |
print(<<END); |
print(<<END); |
9) Role: $perlvar{'lonRole'} |
9) Hostname of Server/VM |
|
ENTER NEW VALUE: |
|
|
|
END |
|
my $choice2=<>; |
|
chomp($choice2); |
|
$desiredhostname=$choice2; |
|
} |
|
|
|
elsif ($choice==10) { |
|
print(<<END); |
|
10) Role: $perlvar{'lonRole'} |
ENTER NEW VALUE (this should be either 'access' or 'library' |
ENTER NEW VALUE (this should be either 'access' or 'library' |
if in doubt select 'library'): |
if in doubt select 'library'): |
END |
END |
Line 953 END
|
Line 1022 END
|
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonRole'}=$choice2; |
$perlvar{'lonRole'}=$choice2; |
} |
} |
elsif ($choice==10) { |
elsif ($choice==11) { |
print(<<END); |
print(<<END); |
10) Cache Expiration Time: $perlvar{'lonExpire'} |
11) Cache Expiration Time: $perlvar{'lonExpire'} |
ENTER NEW VALUE (in seconds, 86400 is a reasonable value): |
ENTER NEW VALUE (in seconds, 86400 is a reasonable value): |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonExpire'}=$choice2; |
$perlvar{'lonExpire'}=$choice2; |
} |
} |
elsif ($choice==11) { |
elsif ($choice==12) { |
print(<<END); |
print(<<END); |
11) Server Load: $perlvar{'lonLoadLim'} |
12) Server Load: $perlvar{'lonLoadLim'} |
ENTER NEW VALUE: |
ENTER NEW VALUE: |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonLoadLim'}=$choice2; |
$perlvar{'lonLoadLim'}=$choice2; |
} |
} |
elsif ($choice==12) { |
elsif ($choice==13) { |
print(<<END); |
print(<<END); |
12) User Load: $perlvar{'lonUserLoadLim'} |
13) User Load: $perlvar{'lonUserLoadLim'} |
Numer of users that can login before machine is 'overloaded' |
Numer of users that can login before machine is 'overloaded' |
ENTER NEW VALUE (integer value, 0 means there is no limit): |
ENTER NEW VALUE (integer value, 0 means there is no limit): |
END |
END |
Line 981 END
|
Line 1050 END
|
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonUserLoadLim'}=$choice2; |
$perlvar{'lonUserLoadLim'}=$choice2; |
} |
} |
elsif ($choice==13) { |
elsif ($choice==14) { |
print(<<END); |
print(<<END); |
13) Allow only secure connections: $securestatus |
14) Allow only secure connections: $securestatus |
The Lon-CAPA communication daemons lonc and lond can be configured to |
The Lon-CAPA communication daemons lonc and lond can be configured to |
allow only secure connections by default. |
allow only secure connections by default. |
|
|
Line 995 POSSIBLE CHOICES:
|
Line 1064 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 1010 END
|
Line 1079 END
|
} |
} |
($securestatus,$securenum)=&securesetting(%perlvar); |
($securestatus,$securenum)=&securesetting(%perlvar); |
} |
} |
elsif (($choice==14) && (!@error)) { |
elsif (($choice==15) && (!@error)) { |
$flag=1; |
$flag=1; |
} |
} |
else { |
else { |
print "Invalid input.\n"; |
print "Invalid input.\n"; |
} |
} |
} |
} |
|
|
open(OUT,">$confdir$filename") or |
open(OUT,">$confdir$filename") or |
die("Cannot output to $confdir$filename\n"); |
die("Cannot output to $confdir$filename\n"); |
foreach my $key (keys %perlvar) { |
foreach my $key (keys %perlvar) { |
Line 1036 END
|
Line 1106 END
|
<target dist='default'>loncom/hosts.tab</target> |
<target dist='default'>loncom/hosts.tab</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
unless (-l "<TARGET />") { |
unless (-l "<TARGET />") { |
my $hostname=`hostname -f`;chomp($hostname); |
if ($desiredhostname eq '') { |
|
my $hostname=`hostname -f`;chomp($hostname); |
|
$desiredhostname = $hostname; |
|
} |
my $date=`date -I`; chomp($date); |
my $date=`date -I`; chomp($date); |
my $lonHostID=$perlvar{'lonHostID'}; |
my $lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=~s/[^\w\-.]//g; |
$lonHostID=~s/[^\w\-.]//g; |
my $lineexistflag=0; |
my $lineexistflag=0; |
my $hostidexistflag=0; |
my $hostidexistflag=0; |
my $line2insert=<<END; |
my $line2insert=<<END; |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$protocol:$intdom |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$desiredhostname:$protocol:$intdom |
END |
END |
if (!$domainTabExtras) { |
if (!$domainTabExtras) { |
$domainTabExtras=':::::'; |
$domainTabExtras=':::::'; |
Line 1053 END
|
Line 1126 END
|
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
die('file generation error'); |
die('file generation error'); |
print(OUT $line2insert); |
print(OUT $line2insert); |
print OUT ("^$hostname:$protocol\n"); |
print OUT ("^$desiredhostname:$protocol\n"); |
close(OUT); |
close(OUT); |
open(OUT,'>../'.$lonCluster.'_dns_hosts.tab') or |
open(OUT,'>../'.$lonCluster.'_dns_hosts.tab') or |
die('file generation error'); |
die('file generation error'); |