Annotation of doc/build/debian11_install.frag, revision 1.7
1.1 raeburn 1: <h1>Installing LON-CAPA on a basic Debian 11 Server</h1>
2: <p>
3: This document guides you through the process of setting up a new LON-CAPA
1.2 raeburn 4: server/VM running Debian 11 with only the base set of packages installed.
1.1 raeburn 5: The machine (virtual or real) will be configured solely as a LON-CAPA server and will be
6: expected to have no other services running. Your server/VM is expected to have
7: a reasonably fast connection to the internet.
8: </p><p>
9: More information is available at
10: <a href="http://install.lon-capa.org/">http://install.lon-capa.org/</a>.
11: </p>
12:
13: <h2>Before you begin</h2>
14: <p>
15: Installing Linux is getting easier and easier.
16: You will be required to log in to the machine and execute
17: some routine Linux commands. Familiarity with the Apache web server, mod_perl,
18: perl, and MySQL are not required to install and run LON-CAPA.
19: </p>
20:
21: <h2>Installation Overview</h2>
22: <p>
23: The installation process takes the following steps:
24: </p>
25: <ol>
26: <li><a href="#obt">Obtain Debian 11 .iso</a></li>
27: <li><a href="#net">Determine Network Settings</a></li>
28: <li><a href="#lin">Install Debian 11</a></li>
29: <li><a href="#upd">Update your system</a></li>
30: <li><a href="#ilc">Install LON-CAPA</a></li>
31: <li><a href="#cdc">Create a Domain Coordinator</a></li>
32: <li><a href="#sts">Start/Restart services</a></li>
33: <li><a href="#log">Log in to LON-CAPA</a></li>
34: </ol>
35:
36: <hr>
37: <h2>1. <a name="obt">Obtain Debian 11 .iso file</a></h2>
38: <p>
39: Debian 11 .iso files can be obtained from the <a href="https://www.debian.org/distrib/">Getting Debian</a> page. Either a small installation image .iso for installation over the network or a larger complete installation image .iso can be downloaded.
40: </p>
41: <h2>2. <a name="net">Determine Network Settings</a></h2>
42: <p>
43: You will need to know the following network settings for your installation.
44: <b>Note:</b>You must have a static IP address to use LON-CAPA.
45: DHCP is <em>not</em> supported.
46:
47: <ul>
48: <li>ip address </li>
49: <li>netmask </li>
50: <li>hostname </li>
51: <li>gateway </li>
52: <li>domain name server(s) </li>
53: </ul>
54:
55: <h2>3. <a name="lin">Debian 11 installation</a></h2>
56: <p>
57: Installing Debian Linux is straightforward.
58: Documentation is available from
59: <a href="https://www.debian.org/releases/stable/installmanual">https://www.debian.org/releases/stable/installmanual/</a>
60: Most of the installation screens are self explanatory. (Choose "Graphical Install").
61: There are a few steps that require comment and are dealt with below.
62: </p>
63: <dl style="list-style:square outside none">
64: <dt>Installation Language</dt>
65: <dd>Use English as your installation language.</dd>
66: <dt>Partitioning your Drive</dt>
67: <dd>For a fresh install you may want to use the automatic partitioning feature of the installer.
68: If you decide to customize partitioning, the following may be useful to know.
69: LON-CAPA resource files are stored in the /home directory, so the
70: majority of the disk space should be allocated here. If you have 20 GB
1.2 raeburn 71: of space for Debian, /home should receive at least 10 to 12 GB.
1.1 raeburn 72: Since MySQL uses the /var filesystem to store its databases you should
73: have at least 4 gigs of space available on /var. Be sure to
74: include adequate swap space. A minimum is 512 Megs, but you should
75: typically have 1 or 2x as much swap space as you do physical RAM.</dd>
76:
77: <dt>Network Configuration</dt>
78: <dd>LON-CAPA will <b>not</b> work with a machine set up to use a dynamic
79: IP address. When configuring your network card, be sure to unselect
80: the DHCP option and enter in your network information.</dd>
81: <dt>Software Selection</dt>
82: <dd>The base system will be installed. Once that is complete you will have the option to select additional software collections. By default, "standard system utilities" will be checked -- leave that checked, and (optionally) also check SSH Server, if you plan to ssh into your Debian 11 Server/VM from another machine.</dd>
83: </dl>
84: <p>
1.2 raeburn 85: Finish installing your server, reboot it, and log in with the username you created during installation.
1.1 raeburn 86: </p>
1.4 raeburn 87: <h3>Enabling sudo</h3>
1.5 raeburn 88: <p>If you wish to allow the username created during installation to have administration privileges using sudo, use su to become root and execute the following, replacing <i><username></i> with that specific username:
1.1 raeburn 89: </p>
90: <pre>
91: apt-get install sudo
1.6 raeburn 92: /sbin/adduser <username> sudo
1.1 raeburn 93: exit
94: </pre>
1.3 raeburn 95: <p>Now logout and log in again with that username. If you prefer not to use sudo, then you should omit all instances of <i>sudo</i> when executing all commands listed on the remainder of this page, after using su to become root.
1.1 raeburn 96: </p>
97: <h3>Firewall Configuration</h3>
98: <p>
99: Use ufw to allow incoming traffic for the following services:
100: ssh, www, https
101: </p>
102: <p>Check if ufw is installed</p>
103: <pre>sudo dpkg-query -s ufw |grep Status</pre>
104: <p>If the result is not: <i>Status: install ok installed</i>, then install it:
105: <pre>sudo apt-get install ufw</pre>
106: <p>Configure ufw by executing the following:</p>
107: <pre>
108: sudo ufw default deny
109: sudo ufw enable
110: sudo ufw allow ssh
111: sudo ufw allow www
112: sudo ufw allow https
113: sudo ufw reload
114: </pre>
115: <h3>E-mail: Postfix Installation</h3>
116: <p>
117: Configure to "Internet Site" to allow LON-CAPA to send e-mail to users.
118: </p>
119: <pre>
120: sudo apt-get install postfix
121: </pre>
122: <h3>E-mail: Postfix Configuration</h3>
123: <p>
124: If you need to change the postfix configuration in the future use:
125: </p>
126: <pre>
127: sudo dpkg-reconfigure postfix
128: </pre>
129: <h3>Time synchronization service</h3>
130: <p>
131: You will use chrony for time synchronization, so if timesyncd is installed you should remove it.
132: </p>
133: <pre>
134: sudo systemctl stop systemd-timesyncd
135: sudo systemctl disable systemd-timesyncd
136: sudo apt-get remove systemd-timesyncd
137: sudo apt-get install chrony
138: sudo systemctl start chrony
139: sudo systemctl enable chrony
140: </pre>
141: <h2>4. <a name="upd">Update your system</a></h2>
142: <p>
143: Update your system to the latest versions of the system software using apt-get
144: </p>
145: <pre>
146: sudo apt-get update
147: sudo apt-get upgrade
148: </pre>
149: <p>
150: If kernel packages were updated, reboot your system before continuing with the installation.
151: </p>
152: <h2>5. <a name="ilc">Installing LON-CAPA</a></h2>
153: <h3>Import the LON-CAPA encryption key</h3>
154: <p>Check if gpg is installed</p>
155: <pre>sudo dpkg-query -s gpg |grep Status</pre>
156: <p>If the result is not: <i>Status: install ok installed</i>, then install it:</p>
157: <pre>sudo apt-get install gpg</pre>
158: <p>Check if wget is installed</p>
159: <pre>sudo dpkg-query -s wget |grep Status</pre>
160: <p>If the result is not: <i>Status: install ok installed</i>, then install it:</p>
161: <pre>sudo apt-get install wget</pre>
162: <p>Check if /etc/apt/keyrings directory exists by executing:</p>
163: <pre>
164: ls -al /etc/apt/keyrings
165: </pre>
166: <p>If it is missing, create it by executing:</p>
167: <pre>
168: sudo mkdir /etc/apt/keyrings
169: </pre>
170: <p> Execute: </p>
171: <pre>
172: wget -q -O - https://install.loncapa.org/versions/debian/APT-GPG-KEY-loncapa.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/loncapa.gpg > /dev/null
173: </pre>
174: <h3>Add LON-CAPA debian repository to /etc/apt/sources.list.d</h3>
175: <p> Execute: </p>
176: <pre>
177: echo "deb [signed-by=/etc/apt/keyrings/loncapa.gpg] https://install.loncapa.org/debian bullseye main" | sudo tee /etc/apt/sources.list.d/loncapa.list
178: </pre>
179: <p>
180: You can display which standard Debian repositories are currently enabled by executing:
181: </p>
182: <pre>
183: grep '^deb ' /etc/apt/sources.list |grep ' bullseye'
184: </pre>
185: <p>The output should be similar to the following (with deb.debian.org replaced with your preferred mirror site):</p>
186: <pre>
187: deb http://deb.debian.org bullseye main
188: deb http://security.debian.org/debian-security bullseye-security main
189: deb http://deb.debian.org bullseye-updates main
190: </pre>
191: <h3>Install prerequisites</h3>
192: <p> Execute: </p>
193: <pre>
194: sudo apt-get update
195: sudo apt-get install loncapa-prerequisites
196: </pre><p>
197: This may take some minutes due to LON-CAPA's large number of dependencies.
198: </p>
199: <h3>Set MPM mode for Apache web server and enable use of cgi scripts and webDAV</h3>
200: <p>Execute: </p>
201: <pre>
202: sudo a2dismod mpm_event
203: sudo a2enmod mpm_prefork
204: sudo a2enmod cgi
205: sudo a2enmod dav
206: sudo a2enmod dav_fs
207: </pre>
208: <h3>Retrieve and execute LON-CAPA setup program</h3>
209: <p>
210: Retrieve the LON-CAPA setup script and dependencies with the following command:
211: </p>
212: <pre>
213: wget http://install.loncapa.org/linux/install.tar
214: </pre>
215: <p>
216: Extract the archive with the following command:
217: </p>
218: <pre>
219: tar xf install.tar
220: </pre>
221: <p>
222: This creates a directory named <tt>installation</tt>. Change to it and
223: execute the setup script with the following commands:
224: </p>
225: <pre>
226: cd installation
227: sudo ./install.pl
228: </pre>
229: <p>
230: The script is used to prepare a Linux system to run LON-CAPA, and can also be
231: used to check the configuration of a system on which LON-CAPA has already been installed. Typically, though, you will run this script only once, when you first install LON-CAPA.
232: </p>
233: <p>
234: The script will analyze your system to determine which actions are recommended. The script will then prompt you to choose the actions you would like taken.
1.7 ! raeburn 235: Once a choice has been entered for all ten possible actions, required changes will be made.
1.1 raeburn 236: </p>
237: <p>The possible actions are:
238: <ul>
239: <li>Create the www user/group</li>
240: <li>Install the package LON-CAPA uses to authenticate users.</li>
241: <li>Set-up the MySQL database</li>
242: <li>Set-up MySQL permissions</li>
243: <li>Configure Apache web server</li>
1.7 ! raeburn 244: <li>Configure systemd security settings for Apache web server</li>
1.1 raeburn 245: <li>Configure start-up of services</li>
246: <li>Check firewall settings</li>
247: <li>Stop services not used by LON-CAPA,<br>
248: e.g., services for a print server: cups daemon</li>
249: <li>Download LON-CAPA source code in readiness for installation</li>
250: </ul>
251: </p>
252:
253: <h3>Determine LON-CAPA Settings</h3>
254: <p>
255: LON-CAPA requires a number of identifying parameters to be set in order
256: for it to function at all. Below is a list with descriptions.
257: </p>
258: <dl>
259: <dt>Host Type (library or access)</dt>
260: <dd>The server must be designated a 'library' or an 'access' server. In
261: general you should have a library server for your instructors to create
262: their course content on and run their courses. Students should connect
263: to access servers. If you are doing the first install of LON-CAPA at
264: your site, or if you are playing with it for your own edification you
265: should make your machine a 'library' server.</dd>
266: <dt>LON-CAPA domain</dt>
267: <dd>Each site or school which installs LON-CAPA needs its own domain.
268: Here at MSU we use 'msu'. You should choose something short but
269: meaningful. <i>Restriction: One word, no hyphens, underscores, or
270: special characters.</i><br>Domain names which include a departmental
271: abbreviation are not recommended as although LON-CAPA may start in
272: a single department, other departments frequently join subsequently.
273: For a domain name: 'msu' is a superior choice to 'msuphys' for example.
274: </dd>
275: <dt>LON-CAPA host id</dt>
276: <dd>Each LON-CAPA server requires a unique internal name. We use names
277: such as "msul1" for the first library server. <i>Restriction: One word,
278: no hyphens, underscores, or special characters.</i>
279: </dd>
280: <dt>Domain's Primary Library Server ID</dt>
281: <dd>If you are setting up a domain with a single library server, then the domain's primary library server ID will be the LON-CAPA host id of that server (e.g., msul1). Once your domain grows and you need to add more servers, one of the library servers in the domain should be assigned as the domain's primary library server. This will be where domain-wide settings will be stored.<dd>
282: <dt>Host administrator email</dt>
283: <dd>The amount of email sent to this address is relatively minimal. Messages
284: are sent every time the system starts up, or if the system is in
285: serious trouble. On a laptop, make this <tt>root@localhost</tt>.
286: </dd>
287: <dt>Support email address</dt>
1.2 raeburn 288: <dd>If you enter an e-mail address here, then users of the system
1.1 raeburn 289: will be able to click an "Ask Helpdesk" link in the system to
290: display a web form which they will complete to request support from
291: your institution's helpdesk. On form submission the contents
1.2 raeburn 292: will be sent to the e-mail address you specify.
1.1 raeburn 293: </dd>
294: </dl>
295:
296: <h3>Configuring LON-CAPA</h3>
297: <p>
298: To configure and install LON-CAPA, execute the following commands:
299: </p>
300: <pre>
301: cd ../loncapa-X.Y.Z (X.Y.Z should correspond to a version number like '2.11.5')
302: sudo ./UPDATE
303: </pre>
304: <p>
305: You will need to enter the LON-CAPA configuration information you determined
306: in the previous section.
307: </p>
308:
309: <h2>6. <a name="cdc">Creating a Domain Coordinator</a></h2>
310: <p>
311: You will need at least one user at your site who has the role of
312: 'domain coordinator'. This user creates accounts for other users and
313: grants them additional privileges. The make_domain_coordinator.pl script
314: invoked below requires that you enter the user's password.
315: Replace USERNAME and DOMAIN with an appropriate username and your domain.
316: </p>
317: <pre>
318: cd loncom/build
319: sudo perl make_domain_coordinator.pl USERNAME DOMAIN
320: cd
321: </pre>
322:
323: <h2>7. <a name="sts">Start/Restart Services</a></h2>
324: <p>
325: The LON-CAPA network services take a moment to start. Most misconfigurations
326: will be apparent at this step.
327: </p>
328: <pre>
329: sudo /home/httpd/perl/loncontrol start
330: sudo systemctl restart apache2
331: exit
332: </pre>
333: <p>
334: If you receive warnings about missing perl modules when starting Apache,
335: please make sure you followed the instructions in
336: <b>Installing prerequisites</b>. If you still have errors, please
337: contact the MSU LON-CAPA group.
338: </p>
339:
340: <h2>8. <a name="log">Log in to your LON-CAPA Machine</a></h2>
341: <p>
342: Point a web browser at your new machine and log in as the domain
343: coordinator. Congratulations!
344: </p>
345:
346: <hr>
347: <h2>If things aren't working right</h2>
348: <p>
349: If you've followed the steps above and the server doesn't start or you think
1.7 ! raeburn 350: there's something wrong, please contact the LON-CAPA helpdesk.
! 351: Installation/update support is available from: helpdesk at loncapa.org
! 352: (replace " at " with @).
! 353: If there were errors in installation of the dependency .deb packages or errors during the
1.1 raeburn 354: automatic setup, please send us as much information as possible.
355: If some part of this document is unclear please let us know.
356: </p>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>