Annotation of doc/how_to_domain_coordinator.txt, revision 1.10
1.1 harris41 1: How to make a domain coordinator on
2: a newly installed LON-CAPA system
3:
4: Scott Harrison
5: April 17, 2001
1.4 harris41 6: 05/28/2001
1.1 harris41 7:
1.8 harris41 8: There are 17 steps to this procedure. (Eventually
1.7 harris41 9: this procedure will be replaced with interfaces.
10: Till then, enjoy the UNIX command line.)
11:
12: You need to decide on three pieces of information
13: to create a domain coordinator.
14:
15: * USERNAME (kermit, albert, joe, etc)
16: * DOMAIN (should be the same as lonDefDomain in /etc/httpd/conf/access.conf)
17: * PASSWORD (don't tell me)
18:
19: The examples in these instructions will be based
20: on three example pieces of information:
21: * USERNAME=dc103
22: * DOMAIN=103
23: * PASSWORD=sesame
24:
25: You will also need to know your "root" password
26: and your "www" password.
27:
28: 1. login as root on your Linux system
29: [prompt %] su
30:
31: 2 (as root). add the user
32: Command: [prompt %] /usr/sbin/adduser USERNAME
33: Example: [prompt %] /usr/sbin/adduser dc103
34:
35: 3 (as root). enter in a password
36: Command: [prompt %] passwd USERNAME
37: New UNIX password: PASSWORD
38: Retype new UNIX passwd: PASSWORD
39: Example: [prompt %] passwd dc103
40: New UNIX password: sesame
41: Retype new UNIX passwd: sesame
42:
43: 4 (as root). Make www a member of the new user group.
44: You will need to change 1 line in /etc/group
45: Assuming USERNAME=dc103
46: (your values are different)
1.3 harris41 47: Change this line in /etc/group
48: dc103:x:NUMBER:
49: to be
50: dc103:x:NUMBER:www
1.7 harris41 51:
52: 5. Login as the new user
53: Command: [prompt %] su USERNAME
54: Example: [prompt %] su dc103
55:
1.8 harris41 56: 6 (as USERNAME). Create a public_html directory for the new user.
1.10 ! harris41 57: (This step does not need to be done. Only if new user will
! 58: also be an "author" on the system.)
1.7 harris41 59: Command: [prompt %] install -d /home/USERNAME/public_html
60: Example: [prompt %] install -d /home/dc103/public_html
61:
1.8 harris41 62: 7. (as USERNAME). Set permissions for /home/dc103 and /home/dc103/public_html
1.10 ! harris41 63: # to be readable and writeable by www.
! 64: # See immediately below for newer instructions:
! 65: # Command: [prompt %] chmod g+rwx /home/USERNAME
! 66: # [prompt %] chmod g+rwx /home/USERNAME/public_html
! 67: # Example: [prompt %] chmod g+rwx /home/dc103
! 68: # [prompt %] chmod g+rwx /home/dc103/public_html
! 69: New instructions:
! 70: (This step does not need to be done. Only if the new user will
! 71: also be an author on the system.)
! 72: As root, make /home world executable (chmod a+x /home)
! 73: As dc103 (or whatever the domain coordinator name is,
! 74: chmod g+x /home/dc103
! 75: chmod g+srw /home/dc103/public_html
1.7 harris41 76:
1.8 harris41 77: 8. login as user=www
1.7 harris41 78: Command: [prompt %] su www
79: Password: WWWPASSWORD
80:
1.8 harris41 81: 9. (as www). cd /home/httpd/lonUsers
1.7 harris41 82:
1.8 harris41 83: 10. (as www) Create user directory for your new user.
1.7 harris41 84: Let U equal first letter of USERNAME
85: Let S equal second letter of USERNAME
86: Let E equal third letter of USERNAME
87: Command: [prompt %] install -d DOMAIN/U/S/E/USERNAME
88: Example: [prompt %] install -d 103/d/c/1/dc103
89:
1.8 harris41 90: 11. (as www) Enter the newly created user directory.
1.7 harris41 91: Command: [prompt %] cd DOMAIN/U/S/E/USERNAME
92: Example: [prompt %] cd 103/d/c/1/dc103
93:
1.8 harris41 94: 12. (as www). Set your password mechanism to 'unix'
1.7 harris41 95: Command: [prompt %] echo "unix:" > passwd
96:
1.8 harris41 97: 13. (as www). Create and run the following script with the arguments
1.9 harris41 98: Create the file described below "script.pl" or whatever name you want
99: (it is in CVS:loncapa/doc/rolesmanip.pl).
1.7 harris41 100:
101: Command: [prompt %] perl script.pl DOMAIN USERNAME
102: Example: [prompt %] perl script.pl 103 dc103
1.1 harris41 103:
104: #!/usr/bin/perl
105:
106: # quick temporary script
107: # brought up-to-date by Scott Harrison, 03/01/2001
108:
109:
110: print "Usage: rolesmanip.pl DOMAIN USERNAME\n" unless @ARGV;
111:
112: my $domain=shift @ARGV;
113: my $name=shift @ARGV;
114:
115: my ($l1,$l2,$l3)=split(//,substr($name,0,3));
116:
117: use GDBM_File;
118: my %hash;
119: tie(%hash,'GDBM_File',
120: "/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.db",
121: &GDBM_WRCREAT,0640);
122:
123: $hash{'/'.$domain.'/_dc'}='dc';
124: open OUT, ">/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.hist";
125: map {
126: print OUT $_.' : '.$hash{$_}."\n";
127: } keys %hash;
128: close OUT;
129:
130: untie %hash;
1.7 harris41 131:
1.8 harris41 132: 14. login as root
1.7 harris41 133: Command: [prompt %] su
134:
1.8 harris41 135: 15. Restart the lon processes (/etc/rc.d/init.d/loncontrol restart)
136: 16. Restart the httpd processes (/etc/rc.d/init.d/httpd restart)
137: 17. You may further define the domain coordinator user (i.e. dc103)
1.5 harris41 138: by going to http://MACHINENAME/adm/createuser.
139:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>