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

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.40    ! albertel    4: <!-- $Id: install.html,v 1.39 2002/12/14 18:35:35 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>
1.40    ! albertel   60: <p>Is your system using shadow passwords? (Note: LON-CAPA will work
        !            61: with either MD5/non-MD5 configured systems).  It is strongly
        !            62: recommended to use shadow passwords. If your system is currently not
        !            63: using shadow passwords, run the "pwconv" command (as root) in order to
        !            64: convert to shadow passwords.  If you choose not to use shadow
        !            65: passwords, then do not perform any of the additional steps.  If your
        !            66: system is using shadow passwords, then you will need to perform the
        !            67: additional steps below. 
1.12      harris41   68: </p>
                     69: <p>
                     70: <strong>How to detect:</strong>
                     71: <br />command: <tt>cat /etc/passwd | grep ':x:'</tt>
                     72: </p>
                     73: <p>If there is output such as "<tt>root:x:0:0:root:/root:/bin/bash</tt>",
                     74: then your system is using shadow passwords and you will need to continue with
                     75: the steps below.
                     76: </p>
                     77: </td></tr>
                     78: <tr><td>
                     79: <font size='+1'>2</font>
                     80: </td><td>
                     81: <p><strong>Retrieve the mod_auth_external source</strong> by
                     82: running the following command
                     83: </p>
                     84: <p><tt>
1.40    ! albertel   85: wget http://www.unixpapa.com/software/mod_auth_external-2.1.15.tar.gz
1.12      harris41   86: </tt>
                     87: </p>
                     88: </td></tr>
1.13      harris41   89: <tr><td>
                     90: <font size='+1'>3</font>
                     91: </td><td>
1.17      harris41   92: <p><strong>Unpack the mod_auth_external source</strong> by
                     93: running the following command
                     94: </p>
                     95: <p>
1.40    ! albertel   96: <tt>tar xzvf mod_auth_external-2.1.15.tar.gz</tt>
1.17      harris41   97: </p>
                     98: </td></tr>
                     99: <tr><td>
                    100: <font size='+1'>4</font>
                    101: </td><td>
                    102: <p><strong>Go to the <tt>pwauth</tt> directory</strong> by
                    103: running the following command
                    104: </p>
                    105: <p>
1.40    ! albertel  106: <tt>cd mod_auth_external-2.1.15/pwauth/</tt>
1.17      harris41  107: </p>
                    108: </td></tr>
                    109: <tr><td>
                    110: <font size='+1'>5</font>
                    111: </td><td>
                    112: <p><strong>Edit <tt>config.h</tt> and change SERVER_UIDS definition</strong>
                    113: </p>
                    114: <p>
                    115: Determine the user id of 'www':
1.40    ! albertel  116: <br /><tt>id -u www</tt>
1.17      harris41  117: <br />
                    118: Change the line
                    119: <br /><tt>#define SERVER_UIDS 99       /* user "nobody" */</tt>
                    120: <br />to be
                    121: <br /><tt>#define SERVER_UIDS 513      /* user "www" */</tt>
                    122: <br />where in this example 513 corresponds to the user id of 'www'.
1.13      harris41  123: </p>
1.17      harris41  124: </td></tr>
                    125: <tr><td>
                    126: <font size='+1'>6</font>
                    127: </td><td>
                    128: <p><strong>Compile the <tt>pwauth</tt> executable</strong> by
                    129: running the following command
                    130: </p>
                    131: <p>
                    132: <tt>make</tt>
                    133: </p>
                    134: </td></tr>
                    135: <tr><td>
                    136: <font size='+1'>7</font>
                    137: </td><td>
                    138: <p><strong>Install <tt>pwauth</tt></strong> by doing the following
                    139: </p>
                    140: <p>
                    141: <tt>cp pwauth /usr/local/sbin/</tt>
                    142: <br /><tt>chmod 6755 /usr/local/sbin/pwauth</tt>
                    143: </p>
                    144: <p>
                    145: Edit (creating the file) /etc/pam.d/pwauth to have the contents:
1.18      harris41  146: </p>
1.17      harris41  147: <pre>
                    148:         auth       required     /lib/security/pam_pwdb.so shadow nullok
                    149:         auth       required     /lib/security/pam_nologin.so
                    150:         account    required     /lib/security/pam_pwdb.so
                    151: </pre>
1.13      harris41  152: </td></tr>
                    153: </table>
                    154: <a name="install" />
                    155: <h3>Installing LON-CAPA files</h3>
                    156: <p>
                    157: Download the most current
1.33      harris41  158: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
                    159: loncapa-current.tar.gz</a>.
1.13      harris41  160: </p>
1.25      harris41  161: <table bgcolor="#aaaaaa" border="1">
1.33      harris41  162: <tr><td><tt>wget http://install.lon-capa.org/versions/loncapa-current.tar.gz
1.25      harris41  163: </tt>
                    164: <br />
1.33      harris41  165: <tt>tar xzvf loncapa-current.tar.gz</tt>
1.26      harris41  166: <br />
1.33      harris41  167: <tt>cd loncapa-N.N</tt> (N.N is the version number)</td></tr>
1.25      harris41  168: </table>
1.14      harris41  169: <p>
                    170: The <strong>UPDATE</strong> command will refresh your filesystem with all
                    171: the latest LON-CAPA software.
                    172: </p>
                    173: <table bgcolor="#aaaaaa" border="1">
                    174: <tr><td><tt>./UPDATE</tt></td></tr>
                    175: </table>
1.13      harris41  176: <a name="checkrpms" />
                    177: <h3>Checking your Linux RPMs</h3>
                    178: <p>
1.14      harris41  179: The <strong>CHECKRPMS</strong> command will check the RPMs on your machine
                    180: against an FTP repository.
1.13      harris41  181: </p>
1.14      harris41  182: <table bgcolor="#aaaaaa" border="1">
1.13      harris41  183: <tr><td><tt>./CHECKRPMS</tt></td></tr>
1.37      harris41  184: </table>
1.39      harris41  185: <p>
                    186: Also, please be sure to install the LON-CAPA-systemperl RPM as described on
                    187: the <a href="/docs/downloads/index.html">Downloads</a> page.
                    188: </p>
1.37      harris41  189: <a name="fixhosts" />
                    190: <h3>Fixing <tt>/etc/hosts</tt></h3>
                    191: <p>
                    192: A common RedHat glitch of new installations (RedHat's fault, not LON-CAPA)
                    193: is the generation of /etc/hosts.
                    194: </p>
                    195: <p>
                    196: It should look something like this (except the <tt>myschool</tt> line
                    197: should be replaced with settings specific to your machine):
                    198: </p>
                    199: <table bgcolor="#aaaaaa" border="1">
                    200: <tr><td>
1.38      harris41  201: <pre>
1.37      harris41  202: 127.0.0.1		localhost.localdomain localhost
                    203: 12.34.56.78		www.myschool.edu myschool
1.38      harris41  204: </pre></td></tr>
1.12      harris41  205: </table>
1.13      harris41  206: <a name="mysql" />
                    207: <h3>Configuring the MySQL database</h3>
                    208: <p>
                    209: The following commands describe how to configure the MySQL database
                    210: on your LON-CAPA server.
1.19      harris41  211: <br />Note:
1.12      harris41  212: </p>
1.19      harris41  213: <ul>
                    214: <li>you should substitute 'ROOTPASSWORD' with something very hard to guess
                    215: (it does not have to be the Linux OS root password)
                    216: </li>
1.29      harris41  217: <li>The MySQL www@localhost user must always have a password of 'localhostkey'
                    218: in order for there to be correct operation of a standard LON-CAPA system.
1.27      harris41  219: </li>
1.19      harris41  220: </ul>
1.23      harris41  221: <p>
                    222: The following instructions assume you are logged in as 'root'.
                    223: </p>
1.20      harris41  224: <p>Entering the mysql shell</p>
1.14      harris41  225: <table bgcolor="#aaaaaa" border="1"><tr><td>
1.13      harris41  226: <pre>
                    227: mysql -u root -p mysql
1.19      harris41  228: OR
1.22      harris41  229: mysql -u root mysql (depending on whether you have set a root password)
1.19      harris41  230: </pre>
                    231: </td></tr></table>
1.20      harris41  232: <p>Creating the mysql 'www' user (after entering mysql shell)</p>
1.19      harris41  233: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    234: <pre>
                    235: mysql> CREATE DATABASE loncapa;
1.13      harris41  236: 
1.19      harris41  237: mysql> INSERT INTO user (Host, User, Password)
1.27      harris41  238: mysql> VALUES ('localhost','www',password('localhostkey'));
1.13      harris41  239: 
1.36      harris41  240: mysql> INSERT INTO db VALUES ('localhost','loncapa','www',
                    241: mysql> 'Y','Y','Y','Y','Y','Y','N','Y','Y','Y');
1.13      harris41  242: 
1.19      harris41  243: mysql> FLUSH PRIVILEGES;
                    244: </pre>
                    245: </td></tr></table>
1.20      harris41  246: <p>SECURITY: set a password for the mysql 'root' user</p>
1.19      harris41  247: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    248: <pre>
1.13      harris41  249: shell> mysql -u root mysql
1.19      harris41  250: mysql> SET PASSWORD FOR root@localhost=PASSWORD('ROOTPASSWORD');
                    251: </pre>
                    252: </td></tr></table>
1.20      harris41  253: <p>SECURITY: only allow access from localhost</p>
1.19      harris41  254: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    255: <pre>
                    256: shell> mysql -u root -p mysql
1.28      harris41  257: mysql> DELETE FROM user WHERE host&lt;&gt;'localhost';
1.13      harris41  258: </pre>
                    259: </td></tr></table>
1.15      harris41  260: <a name="testing" />
                    261: <h3>Testing to see if the LON-CAPA server is operational</h3>
                    262: <p>
                    263: The <strong>TEST</strong> command will check the installation software,
                    264: the perl libraries on your system, the MySQL database, and
                    265: will also automatically test the real-time operation of the 
                    266: LON-CAPA Apache web server.
                    267: </p>
                    268: <table bgcolor="#aaaaaa" border="1">
                    269: <tr><td><tt>./TEST</tt></td></tr>
                    270: </table>
1.16      harris41  271: <p>
                    272: Using the <strong>TEST</strong> command will likely
                    273: be an iterative process.
                    274: It is normal to expect that the <strong>TEST</strong> command
                    275: will recommend you perform various steps to ensure optimal
                    276: performance of your LON-CAPA server.
                    277: </p>
1.12      harris41  278: <!-- maintext end -->
1.18      harris41  279: <!-- validated -->
1.11      harris41  280: </body>
                    281: </html>

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