<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- The LearningOnline Network with CAPA -->
<!-- $Id: install.html,v 1.35 2002/11/15 23:36:58 harris41 Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<title>LON-CAPA Installation</title>
<!-- pdfahref install.pdf -->
<!-- button INSTALL -->
</head>
<body bgcolor='#ffffff'>
<!-- preamble start -->
<br />
<p>
You will need to check all the following things to ensure proper
installation of your LON-CAPA system.
</p>
<ul>
<li><a href="#wwwuser">
Creating a user 'www'</a></li>
<li><a href="#shadow">
Make a LON-CAPA system work with shadow passwords</a></li>
<li><a href="#install">
Installing LON-CAPA files</a></li>
<li><a href="#checkrpms">
Checking your Linux RPMs</a></li>
<li><a href="#mysql">
Configuring the MySQL database</a></li>
<li><a href="#testing">
Testing to see if the LON-CAPA server is operational</a></li>
</ul>
<p>
<strong>NOTE:</strong>
If you want to simultaneously install both RedHat 7.3 and LON-CAPA
(to ensure 100% reliability), follow <a href="rh73.html">these
alternative directions</a>.
</p>
<br />
<!-- preamble end -->
<!-- maintext start -->
<a name="wwwuser" />
<h3>Creating a user 'www'</h3>
<p>
Execute the following command to create a user named 'www' on your
LON-CAPA server:
</p>
<table bgcolor="#aaaaaa" border="1"><tr><td>
<tt>/usr/sbin/useradd www</tt>
</td></tr></table>
<a name="shadow" />
<h3>Make a LON-CAPA system work with shadow passwords</h3>
<table border="1">
<tr><th>Step #</th><th>Description</th></tr>
<tr><td>
<font size="+1">1</font>
</td><td>
<p>Is your system using shadow passwords? (Note: LON-CAPA will
work with either MD5/non-MD5 configured systems). If your
system is not using shadow passwords, then do not perform
any of the additional steps. If your system is using shadow
passwords, then you will need to perform the additional steps below.
</p>
<p>
<strong>How to detect:</strong>
<br />command: <tt>cat /etc/passwd | grep ':x:'</tt>
</p>
<p>If there is output such as "<tt>root:x:0:0:root:/root:/bin/bash</tt>",
then your system is using shadow passwords and you will need to continue with
the steps below.
</p>
</td></tr>
<tr><td>
<font size='+1'>2</font>
</td><td>
<p><strong>Retrieve the mod_auth_external source</strong> by
running the following command
</p>
<p><tt>
wget http://www.wwnet.net/~janc/software/mod_auth_external-2.1.13.tar.gz
</tt>
</p>
</td></tr>
<tr><td>
<font size='+1'>3</font>
</td><td>
<p><strong>Unpack the mod_auth_external source</strong> by
running the following command
</p>
<p>
<tt>tar xzvf mod_auth_external-2.1.13.tar.gz</tt>
</p>
</td></tr>
<tr><td>
<font size='+1'>4</font>
</td><td>
<p><strong>Go to the <tt>pwauth</tt> directory</strong> by
running the following command
</p>
<p>
<tt>cd mod_auth_external-2.1.13/pwauth/</tt>
</p>
</td></tr>
<tr><td>
<font size='+1'>5</font>
</td><td>
<p><strong>Edit <tt>config.h</tt> and change SERVER_UIDS definition</strong>
</p>
<p>
Determine the user id of 'www':
<br /><tt>grep ^www /etc/passwd | cut -d':' -f3</tt>
<br />
Change the line
<br /><tt>#define SERVER_UIDS 99 /* user "nobody" */</tt>
<br />to be
<br /><tt>#define SERVER_UIDS 513 /* user "www" */</tt>
<br />where in this example 513 corresponds to the user id of 'www'.
</p>
</td></tr>
<tr><td>
<font size='+1'>6</font>
</td><td>
<p><strong>Compile the <tt>pwauth</tt> executable</strong> by
running the following command
</p>
<p>
<tt>make</tt>
</p>
</td></tr>
<tr><td>
<font size='+1'>7</font>
</td><td>
<p><strong>Install <tt>pwauth</tt></strong> by doing the following
</p>
<p>
<tt>cp pwauth /usr/local/sbin/</tt>
<br /><tt>chmod 6755 /usr/local/sbin/pwauth</tt>
</p>
<p>
Edit (creating the file) /etc/pam.d/pwauth to have the contents:
</p>
<pre>
auth required /lib/security/pam_pwdb.so shadow nullok
auth required /lib/security/pam_nologin.so
account required /lib/security/pam_pwdb.so
</pre>
</td></tr>
</table>
<a name="install" />
<h3>Installing LON-CAPA files</h3>
<p>
Download the most current
<a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
loncapa-current.tar.gz</a>.
</p>
<table bgcolor="#aaaaaa" border="1">
<tr><td><tt>wget http://install.lon-capa.org/versions/loncapa-current.tar.gz
</tt>
<br />
<tt>tar xzvf loncapa-current.tar.gz</tt>
<br />
<tt>cd loncapa-N.N</tt> (N.N is the version number)</td></tr>
</table>
<p>
The <strong>UPDATE</strong> command will refresh your filesystem with all
the latest LON-CAPA software.
</p>
<table bgcolor="#aaaaaa" border="1">
<tr><td><tt>./UPDATE</tt></td></tr>
</table>
<a name="checkrpms" />
<h3>Checking your Linux RPMs</h3>
<p>
The <strong>CHECKRPMS</strong> command will check the RPMs on your machine
against an FTP repository.
</p>
<table bgcolor="#aaaaaa" border="1">
<tr><td><tt>./CHECKRPMS</tt></td></tr>
</table>
<a name="mysql" />
<h3>Configuring the MySQL database</h3>
<p>
The following commands describe how to configure the MySQL database
on your LON-CAPA server.
<br />Note:
</p>
<ul>
<li>you should substitute 'ROOTPASSWORD' with something very hard to guess
(it does not have to be the Linux OS root password)
</li>
<li>The MySQL www@localhost user must always have a password of 'localhostkey'
in order for there to be correct operation of a standard LON-CAPA system.
</li>
</ul>
<p>
The following instructions assume you are logged in as 'root'.
</p>
<p>Entering the mysql shell</p>
<table bgcolor="#aaaaaa" border="1"><tr><td>
<pre>
mysql -u root -p mysql
OR
mysql -u root mysql (depending on whether you have set a root password)
</pre>
</td></tr></table>
<p>Creating the mysql 'www' user (after entering mysql shell)</p>
<table bgcolor="#aaaaaa" border="1"><tr><td>
<pre>
mysql> CREATE DATABASE loncapa;
mysql> INSERT INTO user (Host, User, Password)
mysql> VALUES ('localhost','www',password('localhostkey'));
mysql> GRANT ALL PRIVILEGES ON loncapa.* TO 'www@localhost';
mysql> FLUSH PRIVILEGES;
</pre>
</td></tr></table>
<p>SECURITY: set a password for the mysql 'root' user</p>
<table bgcolor="#aaaaaa" border="1"><tr><td>
<pre>
shell> mysql -u root mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD('ROOTPASSWORD');
</pre>
</td></tr></table>
<p>SECURITY: only allow access from localhost</p>
<table bgcolor="#aaaaaa" border="1"><tr><td>
<pre>
shell> mysql -u root -p mysql
mysql> DELETE FROM user WHERE host<>'localhost';
</pre>
</td></tr></table>
<a name="testing" />
<h3>Testing to see if the LON-CAPA server is operational</h3>
<p>
The <strong>TEST</strong> command will check the installation software,
the perl libraries on your system, the MySQL database, and
will also automatically test the real-time operation of the
LON-CAPA Apache web server.
</p>
<table bgcolor="#aaaaaa" border="1">
<tr><td><tt>./TEST</tt></td></tr>
</table>
<p>
Using the <strong>TEST</strong> command will likely
be an iterative process.
It is normal to expect that the <strong>TEST</strong> command
will recommend you perform various steps to ensure optimal
performance of your LON-CAPA server.
</p>
<!-- maintext end -->
<!-- validated -->
</body>
</html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>