{"id":7555,"date":"2024-01-05T11:59:23","date_gmt":"2024-01-05T11:59:23","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=7555"},"modified":"2024-01-05T11:59:24","modified_gmt":"2024-01-05T11:59:24","slug":"setup-config-secure-moodle-ubuntu-debian-linux","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/","title":{"rendered":"Install &#038; secure Moodle on Ubuntu Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en.jpg\" alt=\"Installing &amp; Securing Moodle Step-by-Step Ubuntu 18.04 20.04\/22.04 Debian Linux\" class=\"wp-image-7586\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h2>\n\n\n\n<p><strong>Moodle<\/strong> is a free and open-source learning management system (LMS) that is used by schools, universities, businesses and other organizations to provide online courses and training programs. With Moodle, you can create customized learning environments complete with quizzes, forums, assignments, videos and more.<\/p>\n\n\n\n<p>Installing Moodle involves several steps including setting up a web server, database server, PHP, and the Moodle code itself. Properly securing the Moodle installation is also crucial to prevent unauthorized access and other security threats.<\/p>\n\n\n\n<p>This guide will walk through the step-by-step process of installing Moodle on a Linux server running Ubuntu 20.04\/22.04 or Debian. It also covers important security considerations and configurations to lock down access and protect data. Following these instructions will result in a fully functioning and secured Moodle environment ready for building courses.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p>Before installing Moodle, you should ensure your Ubuntu 20.04\/22.04 server is up-to-date and has the necessary packages installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt update\n$ sudo apt upgrade -y\n$ sudo apt install apache2 mariadb-server php8.0 php8.0-curl php8.0-zip php8.0-gd php8.0-mbstring php8.0-xml php8.0-soap php8.0-intl -y<\/code><\/pre>\n\n\n\n<p>You will also need a domain name pointed at your server&#8217;s public IP address. This guide uses&nbsp;<code>example.com<\/code>.<\/p>\n\n\n\n<p>Once the prerequisites are met, you can move on to installing and configuring the web server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-apache-web-server\">Install Apache Web Server<\/h2>\n\n\n\n<p>Moodle requires the Apache web server to deliver web pages. Install Apache with this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt install apache2<\/code><\/pre>\n\n\n\n<p>Adjust the firewall to allow HTTP and HTTPS traffic:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo ufw allow in \"Apache Full\"<\/code><\/pre>\n\n\n\n<p>Test that Apache is running properly by accessing your server&#8217;s domain name or public IP address from a web browser. You should see the default Apache page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"set-up-mariadb-database\">Set Up MariaDB Database<\/h2>\n\n\n\n<p>Moodle relies on a MySQL\/MariaDB database to store all course data. Install MariaDB with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt install mariadb-server<\/code><\/pre>\n\n\n\n<p>Run the security script to remove insecure defaults:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>When prompted, set a root password, remove anonymous users, disable remote root login, and remove the test database. Answer &#8216;y&#8217; to all other questions.<\/p>\n\n\n\n<p>Create a database user and database for Moodle. Change&nbsp;<code>moodleuser<\/code>&nbsp;and&nbsp;<code>moodlepassword<\/code>&nbsp;to secure credentials:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo mysql -u root -p<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">CREATE DATABASE moodledb;\nCREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'moodlepassword';\nGRANT ALL ON moodledb.* TO 'moodleuser'@'localhost';\nexit<\/code><\/pre>\n\n\n\n<p>The MariaDB database is now ready for Moodle.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure-php-80-for-moodle\">Configure PHP 8.0 for Moodle<\/h2>\n\n\n\n<p>Moodle requires PHP with a few specific modules enabled.<\/p>\n\n\n\n<p>First, edit php.ini to adjust some recommended settings:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo nano \/etc\/php\/8.0\/apache2\/php.ini<\/code><\/pre>\n\n\n\n<p>Find and update the following values:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">max_execution_time = 180 \nmax_input_time = 180\nmemory_limit = 256M\nupload_max_filesize = 100M\npost_max_size = 100M\nmax_input_vars = 3000<\/code><\/pre>\n\n\n\n<p>Save and exit the file when finished.<\/p>\n\n\n\n<p>Next, enable required PHP modules:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo phpenmod mysqli pdo pdo_mysql json zip intl mbstring soap<\/code><\/pre>\n\n\n\n<p>Restart Apache for PHP changes to take effect:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl restart apache2<\/code><\/pre>\n\n\n\n<p>PHP is now ready to run Moodle.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"download-and-install-moodle\">Download and Install Moodle<\/h2>\n\n\n\n<p>With the web server, database, and PHP configured, you can now install Moodle itself.<\/p>\n\n\n\n<p>First, switch to the Apache document root directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ cd \/var\/www\/html<\/code><\/pre>\n\n\n\n<p>Download the latest stable release of Moodle:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo wget https:\/\/download.moodle.org\/download.php\/stable403\/moodle-4.3.2.zip<\/code><\/pre>\n\n\n\n<p>Unzip the files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo unzip moodle-4.3.2.zip<\/code><\/pre>\n\n\n\n<p>Rename the directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo mv moodle moodle-install<\/code><\/pre>\n\n\n\n<p>Set permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo chown -R www-data:www-data \/var\/www\/html\/moodle-install\n$ sudo chmod -R 755 \/var\/www\/html\/moodle-install<\/code><\/pre>\n\n\n\n<p>Access your server&#8217;s domain name followed by&nbsp;<code>\/moodle-install<\/code>&nbsp;in a web browser. You will be taken to the Moodle installation page.<\/p>\n\n\n\n<p>Select your language and proceed to the next step. Provide your database details including host, name, user, and password. For data directory, enter the path&nbsp;<code>\/var\/www\/html\/moodledata<\/code>. Complete the installation process by setting an admin username, password, and site name.<\/p>\n\n\n\n<p>After the configurations are saved, you will be taken to the main Moodle interface. The base system is now installed and must be secured.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"secure-the-moodle-installation\">Secure the Moodle Installation<\/h2>\n\n\n\n<p>A default Moodle installation contains multiple security vulnerabilities that must be addressed. This involves settings changes in Moodle itself as well as the web server and database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"use-https\">Use HTTPS<\/h3>\n\n\n\n<p>HTTP traffic is unencrypted and can expose passwords and other sensitive data. To enable HTTPS on Apache:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo a2enmod ssl \n$ sudo systemctl reload apache2<\/code><\/pre>\n\n\n\n<p>Acquire an SSL\/TLS certificate from a provider like Let&#8217;s Encrypt and install it according to their documentation. Redirect all HTTP traffic to HTTPS by editing&nbsp;<code>\/etc\/apache2\/sites-available\/000-default.conf<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">&lt;VirtualHost *:80&gt;\n        Redirect \"\/\" \"https:\/\/example.com\/\"\n&lt;\/VirtualHost&gt;<\/code><\/pre>\n\n\n\n<p>Save the file and reload Apache again. Accessing the domain should now redirect to a secure HTTPS connection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"set-file-permissions\">Set File Permissions<\/h3>\n\n\n\n<p>The Moodle files and directories must be owned by the web server user. Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo chown -R www-data:www-data \/var\/www\/html\/moodle*<\/code><\/pre>\n\n\n\n<p>Lock down permissions further with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo find \/var\/www\/html\/moodle* -type d -exec chmod 750 {} \\; \n$ sudo find \/var\/www\/html\/moodle* -type f -exec chmod 640 {} \\;<\/code><\/pre>\n\n\n\n<p>This prevents the web user from creating or modifying files in the Moodle folders.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"use-a-strong-admin-password\">Use a Strong Admin Password<\/h3>\n\n\n\n<p>When initially installing Moodle, set a very strong password for the admin account. Make sure it is at least 16 characters, uses numbers, symbols, uppercase and lowercase letters.<\/p>\n\n\n\n<p>You can also improve password policies by enforcing minimum length and complexity under Site Admin &gt; Security &gt; Site Policies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"limit-course-creators\">Limit Course Creators<\/h3>\n\n\n\n<p>By default, any logged in user can create new courses in Moodle. This is unnecessary exposure. Instead, limit course creation to just the admin by going to Site Admin &gt; Users &gt; Permissions &gt; Define Roles.<\/p>\n\n\n\n<p>Under the Authenticated User role, uncheck &#8220;Create new courses&#8221;. Save changes. Now only the admin can create courses.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-guest-access\">Disable Guest Access<\/h3>\n\n\n\n<p>Guest access allows anyone to log in and see course content without registering a user account. Disable this under Site Admin &gt; Users &gt; Authentication.<\/p>\n\n\n\n<p>Set &#8220;Enable guest access&#8221; to No and save changes. Require user registration for all access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"use-https-for-database-connection\">Use HTTPS for Database Connection<\/h3>\n\n\n\n<p>By default, Moodle connects to the database over unencrypted HTTP. Encrypt this traffic by editing&nbsp;<code>\/var\/www\/html\/moodle-install\/config.php<\/code>:<\/p>\n\n\n\n<p>Find the line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">$CFG-&gt;dbhost    = 'localhost';<\/code><\/pre>\n\n\n\n<p>Change it to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">$CFG-&gt;dbhost    = 'localhost:3306';<\/code><\/pre>\n\n\n\n<p>This forces an SSL encrypted connection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"secure-the-database\">Secure the Database<\/h3>\n\n\n\n<p>Lock down the MariaDB database by first setting a strong root password.<\/p>\n\n\n\n<p>Next, restrict remote access with these edits to&nbsp;<code>\/etc\/mysql\/mariadb.conf.d\/50-server.cnf<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">bind-address            = 127.0.0.1\nport                    = 3306<\/code><\/pre>\n\n\n\n<p>This prevents external connections to the database. Restart MariaDB after making changes.<\/p>\n\n\n\n<p>Also ensure the mysql Unix user has no login shell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo usermod -s \/usr\/sbin\/nologin mysql<\/code><\/pre>\n\n\n\n<p>This prevents any OS-level access with the mysql account.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"limit-php-file-uploads\">Limit PHP File Uploads<\/h3>\n\n\n\n<p>Uploaded files could contain malicious code and should be limited. Edit&nbsp;<code>\/etc\/php\/8.0\/apache2\/php.ini<\/code>&nbsp;and add:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">file_uploads = On\nupload_max_filesize = 2M\nmax_file_uploads = 2<\/code><\/pre>\n\n\n\n<p>This restricts uploads to 2 files of 2MB each. Tweak for your specific needs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"disable-php-execution-in-uploads\">Disable PHP Execution in Uploads<\/h3>\n\n\n\n<p>To prevent execution of uploaded PHP files, disable it specifically for the upload directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">&lt;Directory \/var\/www\/html\/moodledata\/filedir&gt;\n   php_admin_flag engine off\n&lt;\/Directory&gt; <\/code><\/pre>\n\n\n\n<p>Add this to your Apache config at&nbsp;<code>\/etc\/apache2\/sites-available\/000-default.conf<\/code>&nbsp;inside the VirtualHost tags.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-a-web-application-firewall-waf\">Install a Web Application Firewall (WAF)<\/h3>\n\n\n\n<p>A WAF provides deep monitoring and filtering of all web traffic. It can block SQL injection, XSS, CSRF and other attacks before they reach Moodle.<\/p>\n\n\n\n<p>The open source ModSecurity WAF integrates closely with Apache. Follow a guide to install it for robust threat protection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"use-security-plugins\">Use Security Plugins<\/h3>\n\n\n\n<p>Moodle provides plugins that enhance security in areas like authentication, permissions, filtering, and more. Consider enabling plugins like No Self Signups, ReCAPTCHA, Access Rule Levels, etc.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>You should now have a fully functioning Moodle environment installed on Ubuntu with a secure LAMP stack configured to lock down vulnerabilities. Some next steps are:<\/p>\n\n\n\n<ul>\n<li>Create courses, users and content<\/li>\n\n\n\n<li>Customize the theme<\/li>\n\n\n\n<li>Install additional plugins as needed<\/li>\n\n\n\n<li>Set up backups and create a disaster recovery plan<\/li>\n\n\n\n<li>Monitor logs for suspicious activity<\/li>\n\n\n\n<li>Keep Moodle and dependencies updated<\/li>\n<\/ul>\n\n\n\n<p>Properly installing and securing Moodle takes effort, but the result is a reliable eLearning platform your users can trust.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Moodle is a free and open-source learning management system (LMS) that is used by schools, universities, businesses and other organizations to provide online courses and training programs. With Moodle, you can create customized learning environments complete with quizzes, forums, assignments, videos and more. Installing Moodle involves several steps including setting up a web server, ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[188,69],"tags":[],"yoast_head":"\n<title>Install &amp; secure Moodle on Ubuntu Linux - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"This guide covers step-by-step Moodle installation on Ubuntu 20.04 and securing the system by configuring HTTPS, permissions, passwords, database access, PHP and more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install &amp; secure Moodle on Ubuntu Linux - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"This guide covers step-by-step Moodle installation on Ubuntu 20.04 and securing the system by configuring HTTPS, permissions, passwords, database access, PHP and more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-05T11:59:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-05T11:59:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"Install &#038; secure Moodle on Ubuntu Linux\",\"datePublished\":\"2024-01-05T11:59:23+00:00\",\"dateModified\":\"2024-01-05T11:59:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\"},\"wordCount\":1092,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"CMS &amp; Web development\",\"Linux system administration\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\",\"name\":\"Install & secure Moodle on Ubuntu Linux - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2024-01-05T11:59:23+00:00\",\"dateModified\":\"2024-01-05T11:59:24+00:00\",\"description\":\"This guide covers step-by-step Moodle installation on Ubuntu 20.04 and securing the system by configuring HTTPS, permissions, passwords, database access, PHP and more.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install &#038; secure Moodle on Ubuntu Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"Install & secure Moodle on Ubuntu Linux - WebHi Tutorials &amp; Documentations","description":"This guide covers step-by-step Moodle installation on Ubuntu 20.04 and securing the system by configuring HTTPS, permissions, passwords, database access, PHP and more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/","og_locale":"en_US","og_type":"article","og_title":"Install & secure Moodle on Ubuntu Linux - WebHi Tutorials &amp; Documentations","og_description":"This guide covers step-by-step Moodle installation on Ubuntu 20.04 and securing the system by configuring HTTPS, permissions, passwords, database access, PHP and more.","og_url":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2024-01-05T11:59:23+00:00","article_modified_time":"2024-01-05T11:59:24+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/01\/moodle_install_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"Install &#038; secure Moodle on Ubuntu Linux","datePublished":"2024-01-05T11:59:23+00:00","dateModified":"2024-01-05T11:59:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/"},"wordCount":1092,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["CMS &amp; Web development","Linux system administration"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/","url":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/","name":"Install & secure Moodle on Ubuntu Linux - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2024-01-05T11:59:23+00:00","dateModified":"2024-01-05T11:59:24+00:00","description":"This guide covers step-by-step Moodle installation on Ubuntu 20.04 and securing the system by configuring HTTPS, permissions, passwords, database access, PHP and more.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/setup-config-secure-moodle-ubuntu-debian-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"Install &#038; secure Moodle on Ubuntu Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/7555"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=7555"}],"version-history":[{"count":5,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/7555\/revisions"}],"predecessor-version":[{"id":7594,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/7555\/revisions\/7594"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=7555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=7555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=7555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}