Annotation of doc/build/install.html, revision 1.38

1.18      harris41    1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      2:  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.11      harris41    3: <!-- The LearningOnline Network with CAPA -->
1.38    ! harris41    4: <!-- $Id: install.html,v 1.37 2002/11/16 15:35:33 harris41 Exp $ -->
1.11      harris41    5: <html>
                      6: <head>
1.18      harris41    7: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
1.11      harris41    8: <title>LON-CAPA Installation</title>
1.12      harris41    9: <!-- pdfahref install.pdf -->
                     10: <!-- button INSTALL -->
1.11      harris41   11: </head>
1.12      harris41   12: <body bgcolor='#ffffff'>
                     13: <!-- preamble start -->
                     14: <br />&nbsp;
                     15: <p>
                     16: You will need to check all the following things to ensure proper
                     17: installation of your LON-CAPA system.
1.18      harris41   18: </p>
1.12      harris41   19: <ul>
1.13      harris41   20: <li><a href="#wwwuser">
                     21: Creating a user 'www'</a></li>
                     22: <li><a href="#shadow">
1.12      harris41   23: Make a LON-CAPA system work with shadow passwords</a></li>
1.13      harris41   24: <li><a href="#install">
                     25: Installing LON-CAPA files</a></li>
                     26: <li><a href="#checkrpms">
                     27: Checking your Linux RPMs</a></li>
1.37      harris41   28: <li><a href="#fixhosts">
                     29: Fixing <tt>/etc/hosts</tt></a></li>
1.13      harris41   30: <li><a href="#mysql">
                     31: Configuring the MySQL database</a></li>
1.15      harris41   32: <li><a href="#testing">
                     33: Testing to see if the LON-CAPA server is operational</a></li>
1.12      harris41   34: </ul>
1.31      harris41   35: <p>
                     36: <strong>NOTE:</strong>
                     37: If you want to simultaneously install both RedHat 7.3 and LON-CAPA
                     38: (to ensure 100% reliability), follow <a href="rh73.html">these
                     39: alternative directions</a>.
                     40: </p>
1.12      harris41   41: <br />&nbsp;
                     42: <!-- preamble end -->
                     43: <!-- maintext start -->
1.13      harris41   44: <a name="wwwuser" />
                     45: <h3>Creating a user 'www'</h3>
                     46: <p>
1.14      harris41   47: Execute the following command to create a user named 'www' on your
                     48: LON-CAPA server:
1.13      harris41   49: </p>
1.14      harris41   50: <table bgcolor="#aaaaaa" border="1"><tr><td>
                     51: <tt>/usr/sbin/useradd www</tt>
                     52: </td></tr></table>
1.13      harris41   53: <a name="shadow" />
1.12      harris41   54: <h3>Make a LON-CAPA system work with shadow passwords</h3>
1.14      harris41   55: <table border="1">
1.12      harris41   56: <tr><th>Step #</th><th>Description</th></tr>
                     57: <tr><td>
1.14      harris41   58: <font size="+1">1</font>
1.12      harris41   59: </td><td>
                     60: <p>Is your system using shadow passwords? (Note: LON-CAPA will
                     61: work with either MD5/non-MD5 configured systems).  If your
                     62: system is not using shadow passwords, then do not perform
                     63: any of the additional steps.  If your system is using shadow
                     64: passwords, then you will need to perform the additional steps below.
                     65: </p>
                     66: <p>
                     67: <strong>How to detect:</strong>
                     68: <br />command: <tt>cat /etc/passwd | grep ':x:'</tt>
                     69: </p>
                     70: <p>If there is output such as "<tt>root:x:0:0:root:/root:/bin/bash</tt>",
                     71: then your system is using shadow passwords and you will need to continue with
                     72: the steps below.
                     73: </p>
                     74: </td></tr>
                     75: <tr><td>
                     76: <font size='+1'>2</font>
                     77: </td><td>
                     78: <p><strong>Retrieve the mod_auth_external source</strong> by
                     79: running the following command
                     80: </p>
                     81: <p><tt>
                     82: wget http://www.wwnet.net/~janc/software/mod_auth_external-2.1.13.tar.gz
                     83: </tt>
                     84: </p>
                     85: </td></tr>
1.13      harris41   86: <tr><td>
                     87: <font size='+1'>3</font>
                     88: </td><td>
1.17      harris41   89: <p><strong>Unpack the mod_auth_external source</strong> by
                     90: running the following command
                     91: </p>
                     92: <p>
                     93: <tt>tar xzvf mod_auth_external-2.1.13.tar.gz</tt>
                     94: </p>
                     95: </td></tr>
                     96: <tr><td>
                     97: <font size='+1'>4</font>
                     98: </td><td>
                     99: <p><strong>Go to the <tt>pwauth</tt> directory</strong> by
                    100: running the following command
                    101: </p>
                    102: <p>
                    103: <tt>cd mod_auth_external-2.1.13/pwauth/</tt>
                    104: </p>
                    105: </td></tr>
                    106: <tr><td>
                    107: <font size='+1'>5</font>
                    108: </td><td>
                    109: <p><strong>Edit <tt>config.h</tt> and change SERVER_UIDS definition</strong>
                    110: </p>
                    111: <p>
                    112: Determine the user id of 'www':
                    113: <br /><tt>grep ^www /etc/passwd | cut -d':' -f3</tt>
                    114: <br />
                    115: Change the line
                    116: <br /><tt>#define SERVER_UIDS 99       /* user "nobody" */</tt>
                    117: <br />to be
                    118: <br /><tt>#define SERVER_UIDS 513      /* user "www" */</tt>
                    119: <br />where in this example 513 corresponds to the user id of 'www'.
1.13      harris41  120: </p>
1.17      harris41  121: </td></tr>
                    122: <tr><td>
                    123: <font size='+1'>6</font>
                    124: </td><td>
                    125: <p><strong>Compile the <tt>pwauth</tt> executable</strong> by
                    126: running the following command
                    127: </p>
                    128: <p>
                    129: <tt>make</tt>
                    130: </p>
                    131: </td></tr>
                    132: <tr><td>
                    133: <font size='+1'>7</font>
                    134: </td><td>
                    135: <p><strong>Install <tt>pwauth</tt></strong> by doing the following
                    136: </p>
                    137: <p>
                    138: <tt>cp pwauth /usr/local/sbin/</tt>
                    139: <br /><tt>chmod 6755 /usr/local/sbin/pwauth</tt>
                    140: </p>
                    141: <p>
                    142: Edit (creating the file) /etc/pam.d/pwauth to have the contents:
1.18      harris41  143: </p>
1.17      harris41  144: <pre>
                    145:         auth       required     /lib/security/pam_pwdb.so shadow nullok
                    146:         auth       required     /lib/security/pam_nologin.so
                    147:         account    required     /lib/security/pam_pwdb.so
                    148: </pre>
1.13      harris41  149: </td></tr>
                    150: </table>
                    151: <a name="install" />
                    152: <h3>Installing LON-CAPA files</h3>
                    153: <p>
                    154: Download the most current
1.33      harris41  155: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
                    156: loncapa-current.tar.gz</a>.
1.13      harris41  157: </p>
1.25      harris41  158: <table bgcolor="#aaaaaa" border="1">
1.33      harris41  159: <tr><td><tt>wget http://install.lon-capa.org/versions/loncapa-current.tar.gz
1.25      harris41  160: </tt>
                    161: <br />
1.33      harris41  162: <tt>tar xzvf loncapa-current.tar.gz</tt>
1.26      harris41  163: <br />
1.33      harris41  164: <tt>cd loncapa-N.N</tt> (N.N is the version number)</td></tr>
1.25      harris41  165: </table>
1.14      harris41  166: <p>
                    167: The <strong>UPDATE</strong> command will refresh your filesystem with all
                    168: the latest LON-CAPA software.
                    169: </p>
                    170: <table bgcolor="#aaaaaa" border="1">
                    171: <tr><td><tt>./UPDATE</tt></td></tr>
                    172: </table>
1.13      harris41  173: <a name="checkrpms" />
                    174: <h3>Checking your Linux RPMs</h3>
                    175: <p>
1.14      harris41  176: The <strong>CHECKRPMS</strong> command will check the RPMs on your machine
                    177: against an FTP repository.
1.13      harris41  178: </p>
1.14      harris41  179: <table bgcolor="#aaaaaa" border="1">
1.13      harris41  180: <tr><td><tt>./CHECKRPMS</tt></td></tr>
1.37      harris41  181: </table>
                    182: <a name="fixhosts" />
                    183: <h3>Fixing <tt>/etc/hosts</tt></h3>
                    184: <p>
                    185: A common RedHat glitch of new installations (RedHat's fault, not LON-CAPA)
                    186: is the generation of /etc/hosts.
                    187: </p>
                    188: <p>
                    189: It should look something like this (except the <tt>myschool</tt> line
                    190: should be replaced with settings specific to your machine):
                    191: </p>
                    192: <table bgcolor="#aaaaaa" border="1">
                    193: <tr><td>
1.38    ! harris41  194: <pre>
1.37      harris41  195: 127.0.0.1		localhost.localdomain localhost
                    196: 12.34.56.78		www.myschool.edu myschool
1.38    ! harris41  197: </pre></td></tr>
1.12      harris41  198: </table>
1.13      harris41  199: <a name="mysql" />
                    200: <h3>Configuring the MySQL database</h3>
                    201: <p>
                    202: The following commands describe how to configure the MySQL database
                    203: on your LON-CAPA server.
1.19      harris41  204: <br />Note:
1.12      harris41  205: </p>
1.19      harris41  206: <ul>
                    207: <li>you should substitute 'ROOTPASSWORD' with something very hard to guess
                    208: (it does not have to be the Linux OS root password)
                    209: </li>
1.29      harris41  210: <li>The MySQL www@localhost user must always have a password of 'localhostkey'
                    211: in order for there to be correct operation of a standard LON-CAPA system.
1.27      harris41  212: </li>
1.19      harris41  213: </ul>
1.23      harris41  214: <p>
                    215: The following instructions assume you are logged in as 'root'.
                    216: </p>
1.20      harris41  217: <p>Entering the mysql shell</p>
1.14      harris41  218: <table bgcolor="#aaaaaa" border="1"><tr><td>
1.13      harris41  219: <pre>
                    220: mysql -u root -p mysql
1.19      harris41  221: OR
1.22      harris41  222: mysql -u root mysql (depending on whether you have set a root password)
1.19      harris41  223: </pre>
                    224: </td></tr></table>
1.20      harris41  225: <p>Creating the mysql 'www' user (after entering mysql shell)</p>
1.19      harris41  226: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    227: <pre>
                    228: mysql> CREATE DATABASE loncapa;
1.13      harris41  229: 
1.19      harris41  230: mysql> INSERT INTO user (Host, User, Password)
1.27      harris41  231: mysql> VALUES ('localhost','www',password('localhostkey'));
1.13      harris41  232: 
1.36      harris41  233: mysql> INSERT INTO db VALUES ('localhost','loncapa','www',
                    234: mysql> 'Y','Y','Y','Y','Y','Y','N','Y','Y','Y');
1.13      harris41  235: 
1.19      harris41  236: mysql> FLUSH PRIVILEGES;
                    237: </pre>
                    238: </td></tr></table>
1.20      harris41  239: <p>SECURITY: set a password for the mysql 'root' user</p>
1.19      harris41  240: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    241: <pre>
1.13      harris41  242: shell> mysql -u root mysql
1.19      harris41  243: mysql> SET PASSWORD FOR root@localhost=PASSWORD('ROOTPASSWORD');
                    244: </pre>
                    245: </td></tr></table>
1.20      harris41  246: <p>SECURITY: only allow access from localhost</p>
1.19      harris41  247: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    248: <pre>
                    249: shell> mysql -u root -p mysql
1.28      harris41  250: mysql> DELETE FROM user WHERE host&lt;&gt;'localhost';
1.13      harris41  251: </pre>
                    252: </td></tr></table>
1.15      harris41  253: <a name="testing" />
                    254: <h3>Testing to see if the LON-CAPA server is operational</h3>
                    255: <p>
                    256: The <strong>TEST</strong> command will check the installation software,
                    257: the perl libraries on your system, the MySQL database, and
                    258: will also automatically test the real-time operation of the 
                    259: LON-CAPA Apache web server.
                    260: </p>
                    261: <table bgcolor="#aaaaaa" border="1">
                    262: <tr><td><tt>./TEST</tt></td></tr>
                    263: </table>
1.16      harris41  264: <p>
                    265: Using the <strong>TEST</strong> command will likely
                    266: be an iterative process.
                    267: It is normal to expect that the <strong>TEST</strong> command
                    268: will recommend you perform various steps to ensure optimal
                    269: performance of your LON-CAPA server.
                    270: </p>
1.12      harris41  271: <!-- maintext end -->
1.18      harris41  272: <!-- validated -->
1.11      harris41  273: </body>
                    274: </html>

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