Annotation of doc/build/manual_install.frag, revision 1.4

1.1       bowersj2    1: <p>
                      2: You will need to check all the following things to ensure proper
1.2       bowersj2    3: installation of your LON-CAPA system. Be sure to use the <a
                      4: href="rh73.html">RedHat 7.3 specific instructions</a> if they apply,
                      5: as that will be much easier for you.
1.1       bowersj2    6: </p>
                      7: <ul>
1.2       bowersj2    8: <li><a href="#download">Downloading LON-CAPA</a></li>
1.1       bowersj2    9: <li><a href="#wwwuser">
                     10: Creating a user 'www'</a></li>
                     11: <li><a href="#shadow">
                     12: Make a LON-CAPA system work with shadow passwords</a></li>
                     13: <li><a href="#install">
                     14: Installing LON-CAPA files</a></li>
                     15: <li><a href="#checkrpms">
                     16: Checking your Linux RPMs</a> (On RedHat)</li>
                     17: <li><a href="#fixhosts">
                     18: Fixing <tt>/etc/hosts</tt></a></li>
                     19: <li><a href="#mysql">
                     20: Configuring the MySQL database</a></li>
                     21: <li><a href="#testing">
                     22: Testing to see if the LON-CAPA server is operational</a></li>
                     23: </ul>
                     24: 
1.2       bowersj2   25: <a name="download" />
                     26: <h3>Downloading LON-CAPA</h3>
                     27: 
                     28: <p>
                     29: <b>Current Release is Version LATESTVERSION.
                     30: This version was released on LATESTDATE.</b>
                     31: </p>
                     32: <p>
1.4     ! bowersj2   33: You can download the <b>most current version of LON-CAPA</b> at
1.2       bowersj2   34: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
1.4     ! bowersj2   35: http://install.lon-capa.org/versions/loncapa-current.tar.gz</a>
1.2       bowersj2   36: (version LATESTVERSION).
                     37: </p>
                     38: <p>
1.4     ! bowersj2   39: The <b>development release of LON-CAPA</b> is at:
1.2       bowersj2   40: <a href="http://install.lon-capa.org/versions/loncapa-unstable.tar.gz">
1.4     ! bowersj2   41: http://install.lon-capa.org/versions/loncapa-unstable.tar.gz</a>.
1.2       bowersj2   42: </p>
                     43: <p>
                     44: To view the code development history of LON-CAPA, you will need to use the
                     45: <a href="http://www.cvshome.org/">CVS</a> tool, the open standard for
                     46: version control.  Please contact Helen (<a href="mailto:helen@lon-capa.org">
                     47: helen@lon-capa.org</a>) to request a CVS USERNAME.
                     48: </p>
                     49: <p>
                     50: The initial CVS commands would be:
                     51: </p>
                     52: <blockquote>
                     53: <table bgcolor="#aaaaaa" border="1">
                     54: <tr><td>
                     55: <pre>
                     56: export CVSROOT=:pserver:USERNAME@zaphod.lite.msu.edu:/home/cvs 
                     57: cvs login 
                     58: cvs co loncapa
                     59: </pre>
                     60: </td></tr></table>
                     61: </blockquote>
                     62: <p>
                     63: For more information on using CVS, please visit
                     64: <a href="http://www.cvshome.org/">http://www.cvshome.org/</a>
                     65: or read <tt>loncom/build/readme.html</tt> after downloading
                     66: the current version of LON-CAPA as described above.
                     67: </p>
                     68: 
1.1       bowersj2   69: <a name="wwwuser" />
                     70: <h3>Creating a user 'www'</h3>
                     71: <p>
                     72: Execute the following command to create a user named 'www' on your
                     73: LON-CAPA server:
                     74: </p>
                     75: <table bgcolor="#aaaaaa" border="1"><tr><td>
                     76: <tt>/usr/sbin/useradd www</tt>
                     77: </td></tr></table>
                     78: <a name="shadow" />
                     79: <h3>Make a LON-CAPA system work with shadow passwords</h3>
                     80: <table border="1">
                     81: <tr><th>Step #</th><th>Description</th></tr>
                     82: <tr><td>
                     83: <font size="+1">1</font>
                     84: </td><td>
                     85: <p>Is your system using shadow passwords? (Note: LON-CAPA will work
                     86: with either MD5/non-MD5 configured systems).  It is strongly
                     87: recommended to use shadow passwords. If your system is currently not
                     88: using shadow passwords, run the "pwconv" command (as root) in order to
                     89: convert to shadow passwords.  If you choose not to use shadow
                     90: passwords, then do not perform any of the additional steps.  If your
                     91: system is using shadow passwords, then you will need to perform the
                     92: additional steps below. 
                     93: </p>
                     94: <p>
                     95: <strong>How to detect:</strong>
                     96: <br />command: <tt>cat /etc/passwd | grep ':x:'</tt>
                     97: </p>
                     98: <p>If there is output such as "<tt>root:x:0:0:root:/root:/bin/bash</tt>",
                     99: then your system is using shadow passwords and you will need to continue with
                    100: the steps below.
                    101: </p>
                    102: </td></tr>
                    103: <tr><td>
                    104: <font size='+1'>2</font>
                    105: </td><td>
                    106: <p><strong>Retrieve the mod_auth_external source</strong> by
                    107: running the following command
                    108: </p>
                    109: <p><tt>
                    110: wget http://www.unixpapa.com/software/mod_auth_external-2.1.15.tar.gz
                    111: </tt>
                    112: </p>
                    113: </td></tr>
                    114: <tr><td>
                    115: <font size='+1'>3</font>
                    116: </td><td>
                    117: <p><strong>Unpack the mod_auth_external source</strong> by
                    118: running the following command
                    119: </p>
                    120: <p>
                    121: <tt>tar xzvf mod_auth_external-2.1.15.tar.gz</tt>
                    122: </p>
                    123: </td></tr>
                    124: <tr><td>
                    125: <font size='+1'>4</font>
                    126: </td><td>
                    127: <p><strong>Go to the <tt>pwauth</tt> directory</strong> by
                    128: running the following command
                    129: </p>
                    130: <p>
                    131: <tt>cd mod_auth_external-2.1.15/pwauth/</tt>
                    132: </p>
                    133: </td></tr>
                    134: <tr><td>
                    135: <font size='+1'>5</font>
                    136: </td><td>
                    137: <p><strong>Edit <tt>config.h</tt> and change SERVER_UIDS definition</strong>
                    138: </p>
                    139: <p>
                    140: Determine the user id of 'www':
                    141: <br /><tt>id -u www</tt>
                    142: <br />
                    143: Change the line
                    144: <br /><tt>#define SERVER_UIDS 99       /* user "nobody" */</tt>
                    145: <br />to be
                    146: <br /><tt>#define SERVER_UIDS 513      /* user "www" */</tt>
                    147: <br />where in this example 513 corresponds to the user id of 'www'.
                    148: </p>
                    149: </td></tr>
                    150: <tr><td>
                    151: <font size='+1'>6</font>
                    152: </td><td>
                    153: <p><strong>Compile the <tt>pwauth</tt> executable</strong> by
                    154: running the following command
                    155: </p>
                    156: <p>
                    157: <tt>make</tt>
                    158: </p>
                    159: </td></tr>
                    160: <tr><td>
                    161: <font size='+1'>7</font>
                    162: </td><td>
                    163: <p><strong>Install <tt>pwauth</tt></strong> by doing the following
                    164: </p>
                    165: <p>
                    166: <tt>cp pwauth /usr/local/sbin/</tt>
                    167: <br /><tt>chmod 6755 /usr/local/sbin/pwauth</tt>
                    168: </p>
                    169: <p>
                    170: Edit (creating the file) /etc/pam.d/pwauth to have the contents:
                    171: </p>
                    172: <pre>
                    173:         auth       required     /lib/security/pam_pwdb.so shadow nullok
                    174:         auth       required     /lib/security/pam_nologin.so
                    175:         account    required     /lib/security/pam_pwdb.so
                    176: </pre>
                    177: </td></tr>
                    178: </table>
                    179: <a name="install" />
                    180: <h3>Installing LON-CAPA files</h3>
                    181: <p>
                    182: Download the most current
                    183: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
                    184: loncapa-current.tar.gz</a>.
                    185: </p>
                    186: <table bgcolor="#aaaaaa" border="1">
                    187: <tr><td><tt>wget http://install.lon-capa.org/versions/loncapa-current.tar.gz
                    188: </tt>
                    189: <br />
                    190: <tt>tar xzvf loncapa-current.tar.gz</tt>
                    191: <br />
                    192: <tt>cd loncapa-N.N</tt> (N.N is the version number)</td></tr>
                    193: </table>
                    194: <p>
                    195: The <strong>UPDATE</strong> command will refresh your filesystem with all
                    196: the latest LON-CAPA software.
                    197: </p>
                    198: <table bgcolor="#aaaaaa" border="1">
                    199: <tr><td><tt>./UPDATE</tt></td></tr>
                    200: </table>
                    201: <a name="checkrpms" />
                    202: <h3>Checking your Linux RPMs on RedHat</h3>
                    203: <p>
                    204: The <strong>CHECKRPMS</strong> command will check the RPMs on your machine
                    205: against an FTP repository, if you're using a RedHat server.
                    206: </p>
                    207: 
                    208: <table bgcolor="#aaaaaa" border="1">
                    209: <tr><td><tt>./CHECKRPMS</tt></td></tr>
                    210: </table>
                    211: 
                    212: <p>If you are not installing on RedHat, you may need to manually
                    213: install some software. The following pointers may be useful:</p>
                    214: 
1.2       bowersj2  215: <ul><li>LON-CAPA uses a lot of Perl modules. If you are using RedHat,
                    216: go to <a href="http://install.lon-capa.org/resources">this
                    217: directory</a> and download the latest
                    218: <b>LON-CAPA-systemperl-?.?-rh7.i386.rpm</b>, which will contain all
                    219: the Perl modules you need on RedHat. Use <tt>rpm-Uvh --force</tt> to
                    220: install the RPM; this will overwrite some currently existing files and
                    221: that's OK.
                    222: 
                    223: <br /><br />For other Linux distributions, the easiest way to figure
1.1       bowersj2  224: out what Perl modules are being used by LON-CAPA that you do not have
                    225: installed is to try to start up LON-CAPA and see what Perl complains
                    226: about missing. Start by trying to run <tt>/home/httpd/perl/lonc</tt>
                    227: and <tt>/home/httpd/perl/lond</tt> manually as the <tt>www</tt> user,
                    228: and install the modules it complains about not finding. How you
                    229: install those modules will be distribution-specific, but failing all
                    230: else, you can use CPAN; see <tt>man CPAN</tt> on your distribution.<br
                    231: /><br />Once you've gotten <tt>lonc</tt> and <tt>lond</tt> to run, try
                    232: starting up the webserver. How long this will take depends entirely on
                    233: how close your distribution came to having all the modules LON-CAPA
                    234: uses when you started.</li>
                    235: <li>LON-CAPA assumes that the apache web server will be named "httpd"
                    236: and have configuration directories in <tt>/etc/httpd</tt>. Some distributions 
                    237: have that directory at <tt>/etc/apache</tt>. Symlinking <tt>httpd</tt> to the correct 
                    238: directory should work.</li>
                    239: </ul>
                    240: <a name="fixhosts" />
                    241: <h3>Fixing <tt>/etc/hosts</tt></h3>
                    242: <p>
                    243: A common RedHat glitch of new installations (RedHat's fault, not LON-CAPA)
                    244: is the generation of /etc/hosts.
                    245: </p>
                    246: <p>
                    247: It should look something like this (except the <tt>myschool</tt> line
                    248: should be replaced with settings specific to your machine):
                    249: </p>
                    250: <table bgcolor="#aaaaaa" border="1">
                    251: <tr><td>
                    252: <pre>
                    253: 127.0.0.1		localhost.localdomain localhost
                    254: 12.34.56.78		www.myschool.edu myschool
                    255: </pre></td></tr>
                    256: </table>
                    257: <a name="mysql" />
                    258: <h3>Configuring the MySQL database</h3>
                    259: <p>
                    260: The following commands describe how to configure the MySQL database
                    261: on your LON-CAPA server.
                    262: <br />Note:
                    263: </p>
                    264: <ul>
                    265: <li>you should substitute 'ROOTPASSWORD' with something very hard to guess
                    266: (it does not have to be the Linux OS root password)
                    267: </li>
                    268: <li>The MySQL www@localhost user must always have a password of 'localhostkey'
                    269: in order for there to be correct operation of a standard LON-CAPA system.
                    270: </li>
                    271: </ul>
                    272: <p>
                    273: The following instructions assume you are logged in as 'root'.
                    274: </p>
                    275: <p>Entering the mysql shell</p>
                    276: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    277: <pre>
                    278: mysql -u root -p mysql
                    279: OR
                    280: mysql -u root mysql (depending on whether you have set a root password)
                    281: </pre>
                    282: </td></tr></table>
                    283: <p>Creating the mysql 'www' user (after entering mysql shell)</p>
                    284: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    285: <pre>
                    286: mysql> CREATE DATABASE loncapa;
                    287: 
                    288: mysql> INSERT INTO user (Host, User, Password)
                    289: mysql> VALUES ('localhost','www',password('localhostkey'));
                    290: 
                    291: mysql> INSERT INTO db VALUES ('localhost','loncapa','www',
                    292: mysql> 'Y','Y','Y','Y','Y','Y','N','Y','Y','Y');
                    293: 
                    294: mysql> FLUSH PRIVILEGES;
                    295: </pre>
                    296: </td></tr></table>
                    297: <p>SECURITY: set a password for the mysql 'root' user</p>
                    298: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    299: <pre>
                    300: shell> mysql -u root mysql
                    301: mysql> SET PASSWORD FOR root@localhost=PASSWORD('ROOTPASSWORD');
                    302: </pre>
                    303: </td></tr></table>
                    304: <p>SECURITY: only allow access from localhost</p>
                    305: <table bgcolor="#aaaaaa" border="1"><tr><td>
                    306: <pre>
                    307: shell> mysql -u root -p mysql
                    308: mysql> DELETE FROM user WHERE host&lt;&gt;'localhost';
                    309: </pre>
                    310: </td></tr></table>
                    311: <a name="testing" />
                    312: <h3>Testing to see if the LON-CAPA server is operational</h3>
                    313: <p>
                    314: The <strong>TEST</strong> command will check the installation software,
                    315: the perl libraries on your system, the MySQL database, and
                    316: will also automatically test the real-time operation of the 
                    317: LON-CAPA Apache web server.
                    318: </p>
                    319: <table bgcolor="#aaaaaa" border="1">
                    320: <tr><td><tt>./TEST</tt></td></tr>
                    321: </table>
                    322: <p>
                    323: Using the <strong>TEST</strong> command will likely
                    324: be an iterative process.
                    325: It is normal to expect that the <strong>TEST</strong> command
                    326: will recommend you perform various steps to ensure optimal
                    327: performance of your LON-CAPA server.
                    328: </p>
                    329: <!-- maintext end -->
                    330: <!-- validated -->
                    331: </body>
                    332: </html>

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