Is there a more recent hand-holding tutorial somewhere to guide me through the installation on Ubuntu 18.04 running a LEMP stack? I’m admittedly a deployment newbie, so I need my handheld pretty well. I’m finding some older information for Ubuntu 16 and more for Apache, but I’d already set up and configured Nginx before realizing I needed to install a LMS.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi @ljwaloski,
Let’s say we start from the beginning so it’s more clear,
Prepare Ubuntu 18.04 LTS
First, you need to update your system
Install Nginx HTTP Server
Now that Ubuntu is updated, we need to install Nginx
After installing Nginx, the commands below can be used to stop, start and enable Nginx service to always startup when your computer boots.
Install MariaDB Database Server
You’ll also need a database server to run Moodle, my recommendation is MariaDB
After installing, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.
After that, run the commands below to secure MariaDB server.
When prompted, answer the questions below by following the guide.
Enter current password for root (enter for none): Just press the Enter Set root password? [Y/n]: Y New password: Enter password Re-enter new password: Repeat password Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y
Next, run the commands below to open MySQL default configuration file.
Now to add some configuration to your instance
Once done, restart MariaDB
Now we need to create a Database for our Moodle installation. Enter your MariaDB instance like
Then create a database and configure it for usage
Then grant the user full access to the database.
Finally, save your changes and exit.
Install PHP7.1-FPM and Related PHP Modules
Run the commands below to add the below third party repository to upgrade to PHP 7.1
Update Ubuntu again
Finally, run the commands below to install PHP 7.1 and related modules…
Configure Nginx
You can type the following to create the file needed
Put the followng in it
PS. Notice you need to update your server_name in the config.
Enable the Moodle site
After configuring the VirtualHost above, enable it by running the commands below
Restart Nginx To load all the settings above, restart Nginx by running the commands below.
Kind regards, Kalin
So, everything goes fine until I go to secure the installation of MariaDB:
and this is what I get back:
I ran into something on StackOverflow that suggested there might be a conflict with apparmor since I had MySQL on this server before, but setting
/usr/sbin/mysqld
to complain mode didn’t seem to help at all. I’m still stuck at this point and MariaDB will not start. Trying to force the start gives me a timeout error.