Annotation of doc/build/debian12_install.frag, revision 1.1

1.1     ! raeburn     1: <h1>Installing LON-CAPA on a basic Debian 12 Server</h1>
        !             2: <p>
        !             3: This document guides you through the process of setting up a new LON-CAPA
        !             4: server/VM running Debian 12 with only the base set of packages installed.  
        !             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 12 .iso</a></li>
        !            27:   <li><a href="#net">Determine Network Settings</a></li>
        !            28:   <li><a href="#lin">Install Debian 12</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 12 .iso file</a></h2>
        !            38: <p>
        !            39: Debian 12 .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 12 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 
        !            71:        of space for Debian, /home should receive at least 10 to 12 GB.  
        !            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 12 Server/VM from another machine.</dd>
        !            83: </dl>
        !            84: <p>
        !            85: Finish installing your server, reboot it, and log in with the username you created during installation.  
        !            86: </p>
        !            87: <h3>Enabling sudo>/h3> 
        !            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>&lt;username&gt;<i> with that specific username:
        !            89: </p>
        !            90: <pre>
        !            91: apt-get install sudo
        !            92: /sbin/adduser <username> sudo
        !            93: exit
        !            94: </pre>
        !            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 <l>sudo<i> when executing all commands listed on the remainder of this page, after using su to become root.
        !            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 gpg |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 apt-get install ufw
        !           109: sudo ufw default deny
        !           110: sudo ufw enable
        !           111: sudo ufw allow ssh
        !           112: sudo ufw allow www
        !           113: sudo ufw allow https
        !           114: sudo ufw reload
        !           115: </pre>
        !           116: <h3>E-mail: Postfix Installation</h3>
        !           117: <p>
        !           118: Configure to "Internet Site" to allow LON-CAPA to send e-mail to users.
        !           119: </p>
        !           120: <pre>
        !           121: sudo apt-get install postfix
        !           122: </pre>
        !           123: <h3>E-mail: Postfix Configuration</h3>
        !           124: <p>
        !           125: If you need to change the postfix configuration in the future use:
        !           126: </p>
        !           127: <pre>
        !           128: sudo dpkg-reconfigure postfix
        !           129: </pre>
        !           130: <h3>Time synchronization service</h3>
        !           131: <p>
        !           132: You will use chrony for time synchronization, so if timesyncd is installed you should remove it.
        !           133: </p>
        !           134: <pre>
        !           135: sudo systemctl stop systemd-timesyncd
        !           136: sudo systemctl disable systemd-timesyncd
        !           137: sudo apt-get remove systemd-timesyncd
        !           138: sudo apt-get install chrony
        !           139: </pre>
        !           140: <h2>4. <a name="upd">Update your system</a></h2>
        !           141: <p>
        !           142: Update your system to the latest versions of the system software using apt-get
        !           143: </p>
        !           144: <pre>
        !           145: sudo apt-get update
        !           146: sudo apt-get upgrade
        !           147: </pre>
        !           148: <p>
        !           149: If kernel packages were updated, reboot your system before continuing with the installation.
        !           150: </p>
        !           151: <h2>5. <a name="ilc">Installing LON-CAPA</a></h2>
        !           152: <h3>Import the LON-CAPA encryption key</h3>
        !           153: <p>Check if gpg is installed</p>
        !           154: <pre>sudo dpkg-query -s gpg |grep Status</pre>
        !           155: <p>If the result is not: <i>Status: install ok installed</i>, then install it:
        !           156: <pre>sudo apt-get install gpg</pre>
        !           157: <p>Check if wget is installed</p>
        !           158: <pre>sudo dpkg-query -s wget |grep Status</pre>
        !           159: <p>If the result is not: <i>Status: install ok installed</i>, then install it:
        !           160: <pre>sudo apt-get install wget</pre>
        !           161: <p> Execute: </p>
        !           162: <pre>
        !           163: 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
        !           164: </pre>
        !           165: <h3>Add LON-CAPA debian repository to /etc/apt/sources.list.d</h3>
        !           166: <p> Execute: </p>
        !           167: <pre>
        !           168: echo "deb [signed-by=/etc/apt/keyrings/loncapa.gpg] https://install.loncapa.org/debian bookworm main" | sudo tee /etc/apt/sources.list.d/loncapa.list
        !           169: </pre>
        !           170: <p>
        !           171: You can display which standard Debian repositories are currently enabled by executing:
        !           172: </p>
        !           173: <pre>
        !           174: grep '^deb ' /etc/apt/sources.list |grep ' bookworm'
        !           175: </pre>
        !           176: <p>The output should be similar to the following (with deb.debian.org replaced with your preferred mirror site):</p>
        !           177: <pre>
        !           178: deb http://deb.debian.org bookworm main non-free-firmware
        !           179: deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
        !           180: deb http://deb.debian.org bookworm-updates main non-free-firmware
        !           181: </pre>
        !           182: <h3>Install prerequisites</h3>
        !           183: <p> Execute: </p>
        !           184: <pre>
        !           185: sudo apt-get install loncapa-prerequisites
        !           186: </pre><p>
        !           187: This may take some minutes due to LON-CAPA's large number of dependencies.
        !           188: </p>
        !           189: <h3>Set MPM mode for Apache web server and enable use of cgi scripts and webDAV</h3>
        !           190: <p>Execute: </p>
        !           191: <pre>
        !           192: sudo a2dismod mpm_event
        !           193: sudo a2enmod mpm_prefork
        !           194: sudo a2enmod cgi
        !           195: sudo a2enmod dav
        !           196: sudo a2enmod dav_fs
        !           197: </pre>
        !           198: <h3>Retrieve and execute LON-CAPA setup program</h3>
        !           199: <p>
        !           200: Retrieve the LON-CAPA setup script and dependencies with the following command:
        !           201: </p>
        !           202: <pre>
        !           203: wget http://install.loncapa.org/linux/install.tar
        !           204: </pre>
        !           205: <p>
        !           206: Extract the archive with the following command:
        !           207: </p>
        !           208: <pre>
        !           209: tar xf install.tar
        !           210: </pre>
        !           211: <p>
        !           212: This creates a directory named <tt>installation</tt>.  Change to it and
        !           213: execute the setup script with the following commands:
        !           214: </p>
        !           215: <pre>
        !           216: cd installation
        !           217: sudo ./install.pl
        !           218: </pre>
        !           219: <p>
        !           220: The script is used to prepare a Linux system to run LON-CAPA, and can also be
        !           221: 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.
        !           222: </p>
        !           223: <p>
        !           224: 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.
        !           225: Once a choice has been entered for all nine possible actions, required changes will be made.
        !           226: </p>
        !           227: <p>The possible actions are:
        !           228: <ul>
        !           229: <li>Create the www user/group</li>
        !           230: <li>Install the package LON-CAPA uses to authenticate users.</li>
        !           231: <li>Set-up the MySQL database</li>
        !           232: <li>Set-up MySQL permissions</li>
        !           233: <li>Configure Apache web server</li>
        !           234: <li>Configure start-up of services</li>
        !           235: <li>Check firewall settings</li>
        !           236: <li>Stop services not used by LON-CAPA,<br>
        !           237:     e.g., services for a print server: cups daemon</li>
        !           238: <li>Download LON-CAPA source code in readiness for installation</li>
        !           239: </ul>
        !           240: </p>
        !           241: 
        !           242: <h3>Determine LON-CAPA Settings</h3>
        !           243: <p>
        !           244: LON-CAPA requires a number of identifying parameters to be set in order
        !           245: for it to function at all.  Below is a list with descriptions.
        !           246: </p>
        !           247: <dl>
        !           248:   <dt>Host Type (library or access)</dt>
        !           249:   <dd>The server must be designated a 'library' or an 'access' server.  In
        !           250:       general you should have a library server for your instructors to create
        !           251:       their course content on and run their courses.  Students should connect
        !           252:       to access servers.  If you are doing the first install of LON-CAPA at 
        !           253:       your site, or if you are playing with it for your own edification you
        !           254:       should make your machine a 'library' server.</dd>
        !           255:   <dt>LON-CAPA domain</dt>
        !           256:   <dd>Each site or school which installs LON-CAPA needs its own domain.
        !           257:       Here at MSU we use 'msu'.  You should choose something short but
        !           258:       meaningful.  <i>Restriction: One word, no hyphens, underscores, or 
        !           259:       special characters.</i><br>Domain names which include a departmental 
        !           260:       abbreviation are not recommended as although LON-CAPA may start in
        !           261:       a single department, other departments frequently join subsequently.
        !           262:       For a domain name: 'msu' is a superior choice to 'msuphys' for example.
        !           263:   </dd>
        !           264:   <dt>LON-CAPA host id</dt>
        !           265:   <dd>Each LON-CAPA server requires a unique internal name.  We use names
        !           266:       such as "msul1" for the first library server. <i>Restriction: One word, 
        !           267:       no hyphens, underscores, or special characters.</i>
        !           268:   </dd>
        !           269:   <dt>Domain's Primary Library Server ID</dt>
        !           270:    <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>
        !           271:   <dt>Host administrator email</dt>
        !           272:   <dd>The amount of email sent to this address is relatively minimal.  Messages
        !           273:       are sent every time the system starts up, or if the system is in 
        !           274:       serious trouble. On a laptop, make this <tt>root@localhost</tt>.
        !           275:   </dd>
        !           276:   <dt>Support email address</dt>
        !           277:   <dd>If you enter an e-mail address here, then users of the system  
        !           278:       will be able to click an "Ask Helpdesk" link in the system to 
        !           279:       display a web form which they will complete to request support from
        !           280:       your institution's helpdesk. On form submission the contents 
        !           281:       will be sent to the e-mail address you specify. 
        !           282:   </dd>
        !           283: </dl>
        !           284: 
        !           285: <h3>Configuring LON-CAPA</h3>
        !           286: <p>
        !           287: To configure and install LON-CAPA, execute the following commands:
        !           288: </p>
        !           289: <pre>
        !           290: cd ../loncapa-X.Y.Z  (X.Y.Z should correspond to a version number like '2.11.5')
        !           291: sudo ./UPDATE
        !           292: </pre>
        !           293: <p>
        !           294: You will need to enter the LON-CAPA configuration information you determined 
        !           295: in the previous section.
        !           296: </p>
        !           297: 
        !           298: <h2>6. <a name="cdc">Creating a Domain Coordinator</a></h2>
        !           299: <p>
        !           300: You will need at least one user at your site who has the role of
        !           301: 'domain coordinator'.  This user creates accounts for other users and
        !           302: grants them additional privileges.  The make_domain_coordinator.pl script
        !           303: invoked below requires that you enter the user's password.
        !           304: Replace USERNAME and DOMAIN with an appropriate username and your domain.
        !           305: </p>
        !           306: <pre>
        !           307: cd loncom/build
        !           308: sudo perl make_domain_coordinator.pl USERNAME DOMAIN
        !           309: cd
        !           310: </pre>
        !           311: 
        !           312: <h2>7. <a name="sts">Start/Restart Services</a></h2>
        !           313: <p>
        !           314: The LON-CAPA network services take a moment to start.  Most misconfigurations
        !           315: will be apparent at this step.
        !           316: </p>
        !           317: <pre>
        !           318: sudo /home/httpd/perl/loncontrol start
        !           319: sudo systemctl restart apache2
        !           320: exit
        !           321: </pre>
        !           322: <p>
        !           323: If you receive warnings about missing perl modules when starting Apache,
        !           324: please make sure you followed the instructions in 
        !           325: <b>Installing prerequisites</b>.  If you still have errors, please
        !           326: contact the MSU LON-CAPA group.
        !           327: </p>
        !           328: 
        !           329: <h2>8. <a name="log">Log in to your LON-CAPA Machine</a></h2>
        !           330: <p>
        !           331: Point a web browser at your new machine and log in as the domain
        !           332: coordinator.  Congratulations!
        !           333: </p>
        !           334: 
        !           335: <hr>
        !           336: <h2>If things aren't working right</h2>
        !           337: <p>
        !           338: If you've followed the steps above and the server doesn't start or you think 
        !           339: there's something wrong, please send a <a href="http://help.loncapa.org/help">help request</a> to the MSU LON-CAPA group.  If there were errors in installation of the dependency .deb packages or errors during the
        !           340: automatic setup, please send us as much information as possible.
        !           341: If some part of this document is unclear please let us know.
        !           342: </p>

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