1: How to make a domain coordinator on
2: a newly installed LON-CAPA system
3:
4: Scott Harrison
5: April 17, 2001
6: 05/28/2001
7:
8: There are 17 steps to this procedure. (Eventually
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: [This should be updated with the usermod command... the
45: instructions for step #4 (this step) are only good
46: for non-shadow passwd systems.]
47:
48: You will need to change 1 line in /etc/group
49: Assuming USERNAME=dc103
50: (your values are different)
51: Change this line in /etc/group
52: dc103:x:NUMBER:
53: to be
54: dc103:x:NUMBER:www
55:
56: 5. Login as the new user
57: Command: [prompt %] su USERNAME
58: Example: [prompt %] su dc103
59:
60: 6 (as USERNAME). Create a public_html directory for the new user.
61: (This step does not need to be done. Only if new user will
62: also be an "author" on the system.)
63: Command: [prompt %] install -d /home/USERNAME/public_html
64: Example: [prompt %] install -d /home/dc103/public_html
65:
66: 7. (as USERNAME). Set permissions for /home/dc103 and /home/dc103/public_html
67: # to be readable and writeable by www.
68: # See immediately below for newer instructions:
69: # Command: [prompt %] chmod g+rwx /home/USERNAME
70: # [prompt %] chmod g+rwx /home/USERNAME/public_html
71: # Example: [prompt %] chmod g+rwx /home/dc103
72: # [prompt %] chmod g+rwx /home/dc103/public_html
73: New instructions:
74: (This step does not need to be done. Only if the new user will
75: also be an author on the system.)
76: As root, make /home world executable (chmod a+x /home)
77: As dc103 (or whatever the domain coordinator name is,
78: chmod g+x /home/dc103
79: chmod g+srw /home/dc103/public_html
80:
81: 8. login as user=www
82: Command: [prompt %] su www
83: Password: WWWPASSWORD
84:
85: 9. (as www). cd /home/httpd/lonUsers
86:
87: 10. (as www) Create user directory for your new user.
88: Let U equal first letter of USERNAME
89: Let S equal second letter of USERNAME
90: Let E equal third letter of USERNAME
91: Command: [prompt %] install -d DOMAIN/U/S/E/USERNAME
92: Example: [prompt %] install -d 103/d/c/1/dc103
93:
94: 11. (as www) Enter the newly created user directory.
95: Command: [prompt %] cd DOMAIN/U/S/E/USERNAME
96: Example: [prompt %] cd 103/d/c/1/dc103
97:
98: 12. (as www). Set your password mechanism to 'unix'
99: Command: [prompt %] echo "unix:" > passwd
100:
101: 13. (as www). Create and run the following script with the arguments
102: Create the file described below "script.pl" or whatever name you want
103: (it is in CVS:loncapa/doc/rolesmanip.pl).
104:
105: Command: [prompt %] perl script.pl DOMAIN USERNAME
106: Example: [prompt %] perl script.pl 103 dc103
107:
108: #!/usr/bin/perl
109:
110: # quick temporary script
111: # brought up-to-date by Scott Harrison, 03/01/2001
112:
113:
114: print "Usage: rolesmanip.pl DOMAIN USERNAME\n" unless @ARGV;
115:
116: my $domain=shift @ARGV;
117: my $name=shift @ARGV;
118:
119: my ($l1,$l2,$l3)=split(//,substr($name,0,3));
120:
121: use GDBM_File;
122: my %hash;
123: tie(%hash,'GDBM_File',
124: "/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.db",
125: &GDBM_WRCREAT,0640);
126:
127: $hash{'/'.$domain.'/_dc'}='dc';
128: open OUT, ">/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.hist";
129: map {
130: print OUT $_.' : '.$hash{$_}."\n";
131: } keys %hash;
132: close OUT;
133:
134: untie %hash;
135:
136: 14. login as root
137: Command: [prompt %] su
138:
139: 15. Restart the lon processes (/etc/rc.d/init.d/loncontrol restart)
140: 16. Restart the httpd processes (/etc/rc.d/init.d/httpd restart)
141: 17. You may further define the domain coordinator user (i.e. dc103)
142: by going to http://MACHINENAME/adm/createuser.
143:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>