File:  [LON-CAPA] / doc / Attic / how_to_domain_coordinator.txt
Revision 1.7: download - view: text, annotated - select for diffs
Fri Jun 1 19:02:15 2001 UTC (22 years, 11 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
significant changes to reduce ambiguity and confusion -Scott

    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 16 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: 5 (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: 6. (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+rw /home/USERNAME
   63:             [prompt %] chmod g+rw /home/USERNAME/public_html
   64:    Example: [prompt %] chmod g+rw /home/dc103
   65:             [prompt %] chmod g+rw /home/dc103/public_html
   66: 
   67: 7. login as user=www
   68:    Command: [prompt %] su www
   69:             Password: WWWPASSWORD
   70: 
   71: 8 (as www). cd /home/httpd/lonUsers
   72: 
   73: 9. (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: 10. (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: 11. (as www). Set your password mechanism to 'unix' 
   85:    Command: [prompt %] echo "unix:" > passwd
   86: 
   87: 12. (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: 
   90:   Command: [prompt %] perl script.pl DOMAIN USERNAME
   91:   Example: [prompt %] perl script.pl 103 dc103
   92: 
   93: #!/usr/bin/perl
   94: 
   95: # quick temporary script
   96: # brought up-to-date by Scott Harrison, 03/01/2001
   97: 
   98: 
   99: print "Usage: rolesmanip.pl DOMAIN USERNAME\n" unless @ARGV;
  100: 
  101: my $domain=shift @ARGV;
  102: my $name=shift @ARGV;
  103: 
  104: my ($l1,$l2,$l3)=split(//,substr($name,0,3));
  105: 
  106: use GDBM_File;
  107: my %hash;
  108:         tie(%hash,'GDBM_File',
  109: "/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.db",
  110: 	    &GDBM_WRCREAT,0640);
  111: 
  112: $hash{'/'.$domain.'/_dc'}='dc';
  113: open OUT, ">/home/httpd/lonUsers/$domain/$l1/$l2/$l3/$name/roles.hist";
  114: map {
  115:     print OUT $_.' : '.$hash{$_}."\n";
  116: } keys %hash;
  117: close OUT;
  118: 
  119: untie %hash;
  120: 
  121: 13. login as root
  122:     Command: [prompt %] su
  123: 
  124: 14. Restart the lon processes (/etc/rc.d/init.d/loncontrol restart)
  125: 15. Restart the httpd processes (/etc/rc.d/init.d/httpd restart)
  126: 16. You may further define the domain coordinator user (i.e. dc103)
  127:     by going to http://MACHINENAME/adm/createuser.
  128: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>