Talk:Step-by-step Installation Guide for Ubuntu

From MoodleDocs

outdated for moodle 4.4

The instructions talk about installing PHP 7.4, but Moodle 4.4 and later requires PHP 8.1

I added a brief info box on the page to explain this: https://docs.moodle.org/500/en/index.php?title=Step-by-step_Installation_Guide_for_Ubuntu&type=revision&diff=149211&oldid=146443

--Heikki Wilenius (talk) 07:30, 30 August 2024 (UTC)


Hi all

thank you for reading and contributing to the installation page.

It would perhaps be really, really useful to novice users to provide a brief explanation of what is going on and why this is the case:

1. Enable Zend OpCache/Change Document Root - i.e. what and why are we changing the document root? 2. why are we copying the local repository (where the git folders are) again to /var/www/html/ 3. why are we changing sytem paths?


need not be too detailed, but the information here can be quite overwhelming when one doesn't know why they are doing it, and what they are actually doing. that's my only suggestion.

--B K (talk) 11:08, 9 July 2014 (WST)

Installing PostgreSQL

As mentioned in https://docs.moodle.org/500/en/Talk:Arguments_in_favour_of_PostgreSQL, it would be VERY useful if someone experienced in Ubuntu expands this page and includes the necessary steps for installing PostgreSQL. They were present in the Moodle 2.0 version of this page. German Valero (talk)

Some suggestions

  1. Vim isn't the most user friendly text editor. Nano (ctrl-x, etc) would be my advice for someone who has to be told how to install an editor.
  2. This will install a http version of the site if run on my usual choice of VPS. If you want to use WebRTC for recording audio directly into Moodle, https is required. Getting a secure SSL connection before starting the install saves the step of replacing http with https later.
  3. I haven't run across a database file format problem in Ubuntu for some time. I suspect this is no longer required and could be hived off to a new linked page for those who have this problem.
  4. There are links to a separate git page (https://docs.moodle.org/500/en/Git_for_Administrators) so I would consider putting in only the git commands and making this link more explicit.
  5. A link to the cron page at the "Installation Complete " section would be a useful reminder. Installation is not really complete until backups, mail and other tasks are done.
  6. The Enable Zend OpCache/Change section is big enough for its own page.

-James Steerpike (talk) 07:40, 23 February 2021 (UTC)

Thanks for your comments!

Please feel free to add to the page yourself if you are experienced in Moodle Ubuntu installation. --Mary Cooch (talk) 15:08, 7 July 2014 (WST)

Unsure

Hi

I have been trying to install moodle on ubuntu 20.04 but I am unsure what is meant by the following phrase:

(Ubuntu 20.04 now installs PHP8 by default, so be careful to specify the PHP version number or you will get a "line 10602" error)

Should I avoid spesifying the PHP version? According to my knowledge Moodle doesnt yet support PHP 8.

I am confused.

Victor.


Hi Victor,

The install command above the comment about PHP 8 definitely still loads PHP 7.4, so always good to specify that version for Ubuntu 20.04.

Brian Merritt

About PHP8.0

See the progress for https://tracker.moodle.org/browse/MDL-70745 Prepare Moodle for PHP 8.0. German VAlero

Consider adding functionality for website management: Plesk and cPanel

I need to create a server for several websites.

Since I am currently using Plesk on IONOS, I inquired with Plesk on when and how Plesk should be installed during the installation process. Their response is below, and maybe could be tested and integrated into the Installation Guide.

To install Plesk on your Ubuntu server for managing multiple websites, including your Moodle-based training website, you should follow these steps:

1. Connect to the server via SSH.

2. Install the software-properties-common package to manage repositories:
# apt-get install software-properties-common

3. Add the PPA repository:
# add-apt-repository ppa:ondrej/php

4. Install PHP 7.2:
# apt -y install php7.2

5. Install necessary PHP modules (example):
# apt install -y php7.2-{bcmath,bz2,cli,common,curl,dev,fpm,gd,gmp,imagick,imap,intl,json,mbstring,mysql,opcache,soap,ssh2,xml,xmlrpc,zip}

6. Register the PHP handler in Plesk:
# plesk bin php_handler --add -displayname php72-fpm-custom -path /usr/sbin/php-fpm7.2 -phpini /etc/php/7.2/fpm/php.ini -type fpm -id php72-fpm-custom -clipath /usr/bin/php -service php7.2-fpm -poold /etc/php/7.2/fpm/pool.d

Plesk will handle the installation of Apache, MariaDB/MySQL, PHP, and other necessary components. You can then proceed with the Moodle installation as per the Moodle documentation.

Rewrite

I have done an extensive rewrite of this page as it included outdated information. I have also tried to move away from "this is how Linux does things, now try to do it" to "this is what you have to do". Using simple logic,a prompt, bash variables, sed and echo means there is no longer a need to modify the lines before copying or use a text editor, simplifying the process.

I did have to decide if this page should show you how to create a simple insecure development Moodle, a more secure site suitable for production or both. A simple process with the http protocol and a /var/www/html/moodle location followed by a security update process would require a new virtual host, and a replacement of http with https through all the files. Doing it right the first time seemed a better option and if a development moodle is a step towards production, the same setup makes sense.

I have chained commands and skipped explanations to reduce the install procedure to have as few lines as possible. The loss of readability I think is outweighed by having short sections of code to copy and paste.

Back to steps

My first draft had a single block of code to be executed and few explanations. After some feedback, I have reformatted to create logical steps, each has a description of what needs to be done and the following code showing how to accomplish it. By using bullet points, I have tried to be as concise as possible and left a place at the end of the guide for longer explanations. The code steps have been tested to be a complete path to a Ubuntu Moodle.

Previously, the reader was expected to modify lines before running the commands on the server and to use a text editor to change configuration files and create cron jobs. By using sed (a text editor which can search for text, remove, and replace a line) and echo to add lines, the install is simplified and less likely to error. Using generated passwords and hardcoding values such as the site name also makes the task of installing less prone to failure.

Encryption of the protocol is included because converting from a http site later means the extra work of replacing the web address in Moodle files. Better to do it at install.

Security is done after install because, for a development site, relaxed file permissions and no database root password makes things easier.

I intend to add an enhancement area to include installation of web based tools such as phpadmin, adminer, and cockpit so the administration of the database and services can be done using a graphical user interface.