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