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