1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3: <!-- The LearningOnline Network with CAPA -->
4: <!-- $Id: install.html,v 1.39 2002/12/14 18:35:35 harris41 Exp $ -->
5: <html>
6: <head>
7: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
8: <title>LON-CAPA Installation</title>
9: <!-- pdfahref install.pdf -->
10: <!-- button INSTALL -->
11: </head>
12: <body bgcolor='#ffffff'>
13: <!-- preamble start -->
14: <br />
15: <p>
16: You will need to check all the following things to ensure proper
17: installation of your LON-CAPA system.
18: </p>
19: <ul>
20: <li><a href="#wwwuser">
21: Creating a user 'www'</a></li>
22: <li><a href="#shadow">
23: Make a LON-CAPA system work with shadow passwords</a></li>
24: <li><a href="#install">
25: Installing LON-CAPA files</a></li>
26: <li><a href="#checkrpms">
27: Checking your Linux RPMs</a></li>
28: <li><a href="#fixhosts">
29: Fixing <tt>/etc/hosts</tt></a></li>
30: <li><a href="#mysql">
31: Configuring the MySQL database</a></li>
32: <li><a href="#testing">
33: Testing to see if the LON-CAPA server is operational</a></li>
34: </ul>
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>
41: <br />
42: <!-- preamble end -->
43: <!-- maintext start -->
44: <a name="wwwuser" />
45: <h3>Creating a user 'www'</h3>
46: <p>
47: Execute the following command to create a user named 'www' on your
48: LON-CAPA server:
49: </p>
50: <table bgcolor="#aaaaaa" border="1"><tr><td>
51: <tt>/usr/sbin/useradd www</tt>
52: </td></tr></table>
53: <a name="shadow" />
54: <h3>Make a LON-CAPA system work with shadow passwords</h3>
55: <table border="1">
56: <tr><th>Step #</th><th>Description</th></tr>
57: <tr><td>
58: <font size="+1">1</font>
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>
86: <tr><td>
87: <font size='+1'>3</font>
88: </td><td>
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'.
120: </p>
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:
143: </p>
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>
149: </td></tr>
150: </table>
151: <a name="install" />
152: <h3>Installing LON-CAPA files</h3>
153: <p>
154: Download the most current
155: <a href="http://install.lon-capa.org/versions/loncapa-current.tar.gz">
156: loncapa-current.tar.gz</a>.
157: </p>
158: <table bgcolor="#aaaaaa" border="1">
159: <tr><td><tt>wget http://install.lon-capa.org/versions/loncapa-current.tar.gz
160: </tt>
161: <br />
162: <tt>tar xzvf loncapa-current.tar.gz</tt>
163: <br />
164: <tt>cd loncapa-N.N</tt> (N.N is the version number)</td></tr>
165: </table>
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>
173: <a name="checkrpms" />
174: <h3>Checking your Linux RPMs</h3>
175: <p>
176: The <strong>CHECKRPMS</strong> command will check the RPMs on your machine
177: against an FTP repository.
178: </p>
179: <table bgcolor="#aaaaaa" border="1">
180: <tr><td><tt>./CHECKRPMS</tt></td></tr>
181: </table>
182: <p>
183: Also, please be sure to install the LON-CAPA-systemperl RPM as described on
184: the <a href="/docs/downloads/index.html">Downloads</a> page.
185: </p>
186: <a name="fixhosts" />
187: <h3>Fixing <tt>/etc/hosts</tt></h3>
188: <p>
189: A common RedHat glitch of new installations (RedHat's fault, not LON-CAPA)
190: is the generation of /etc/hosts.
191: </p>
192: <p>
193: It should look something like this (except the <tt>myschool</tt> line
194: should be replaced with settings specific to your machine):
195: </p>
196: <table bgcolor="#aaaaaa" border="1">
197: <tr><td>
198: <pre>
199: 127.0.0.1 localhost.localdomain localhost
200: 12.34.56.78 www.myschool.edu myschool
201: </pre></td></tr>
202: </table>
203: <a name="mysql" />
204: <h3>Configuring the MySQL database</h3>
205: <p>
206: The following commands describe how to configure the MySQL database
207: on your LON-CAPA server.
208: <br />Note:
209: </p>
210: <ul>
211: <li>you should substitute 'ROOTPASSWORD' with something very hard to guess
212: (it does not have to be the Linux OS root password)
213: </li>
214: <li>The MySQL www@localhost user must always have a password of 'localhostkey'
215: in order for there to be correct operation of a standard LON-CAPA system.
216: </li>
217: </ul>
218: <p>
219: The following instructions assume you are logged in as 'root'.
220: </p>
221: <p>Entering the mysql shell</p>
222: <table bgcolor="#aaaaaa" border="1"><tr><td>
223: <pre>
224: mysql -u root -p mysql
225: OR
226: mysql -u root mysql (depending on whether you have set a root password)
227: </pre>
228: </td></tr></table>
229: <p>Creating the mysql 'www' user (after entering mysql shell)</p>
230: <table bgcolor="#aaaaaa" border="1"><tr><td>
231: <pre>
232: mysql> CREATE DATABASE loncapa;
233:
234: mysql> INSERT INTO user (Host, User, Password)
235: mysql> VALUES ('localhost','www',password('localhostkey'));
236:
237: mysql> INSERT INTO db VALUES ('localhost','loncapa','www',
238: mysql> 'Y','Y','Y','Y','Y','Y','N','Y','Y','Y');
239:
240: mysql> FLUSH PRIVILEGES;
241: </pre>
242: </td></tr></table>
243: <p>SECURITY: set a password for the mysql 'root' user</p>
244: <table bgcolor="#aaaaaa" border="1"><tr><td>
245: <pre>
246: shell> mysql -u root mysql
247: mysql> SET PASSWORD FOR root@localhost=PASSWORD('ROOTPASSWORD');
248: </pre>
249: </td></tr></table>
250: <p>SECURITY: only allow access from localhost</p>
251: <table bgcolor="#aaaaaa" border="1"><tr><td>
252: <pre>
253: shell> mysql -u root -p mysql
254: mysql> DELETE FROM user WHERE host<>'localhost';
255: </pre>
256: </td></tr></table>
257: <a name="testing" />
258: <h3>Testing to see if the LON-CAPA server is operational</h3>
259: <p>
260: The <strong>TEST</strong> command will check the installation software,
261: the perl libraries on your system, the MySQL database, and
262: will also automatically test the real-time operation of the
263: LON-CAPA Apache web server.
264: </p>
265: <table bgcolor="#aaaaaa" border="1">
266: <tr><td><tt>./TEST</tt></td></tr>
267: </table>
268: <p>
269: Using the <strong>TEST</strong> command will likely
270: be an iterative process.
271: It is normal to expect that the <strong>TEST</strong> command
272: will recommend you perform various steps to ensure optimal
273: performance of your LON-CAPA server.
274: </p>
275: <!-- maintext end -->
276: <!-- validated -->
277: </body>
278: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>