Changes between Initial Version and Version 1 of moodlelab2024/Adding-Moodle-OVA-File


Ignore:
Timestamp:
Jan 2, 2025, 5:11:58 AM (3 weeks ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • moodlelab2024/Adding-Moodle-OVA-File

    v1 v1  
     1== Practice Moodle in VirtualBox
     2
     3** Step-by-Step Guide to Share Alpine Linux `.OVA` File with Moodle Preconfigured **
     4
     5This guide explains how to set up a `.vdi` file with Alpine Linux, configure it for sharing, and provide instructions for others to use it in VirtualBox.
     6
     7---
     8
     9=== **Part 1: Step-by-Step Instructions for Users**
     10
     11==== **1. Download and Install VirtualBox**:
     121. Visit [VirtualBox’s official site](https://www.virtualbox.org/).
     132. Download the latest version for your operating system (Windows/macOS/Linux).
     143. Install VirtualBox using the default options.
     15---
     16==== **2. Download the `.ova` File**:
     171. Open the Google Drive link provided:
     18   ```
     19   https://drive.google.com/file/d/1bun_iIx-RaQINks6RFgXBHM8kWDEhaAq/view?usp=sharing
     20   ```
     212. Download the `.ova file.
     22---
     23==== **3. Import the .ova File**:
     24
     251.      Launch VirtualBox:
     26        - Open VirtualBox from your Start Menu, Applications, or Dock.
     272.      Import the Appliance:
     28   - Go to File > Import Appliance from the VirtualBox menu bar.
     293.      Browse to the .ova File:
     30   - Click on the folder icon to open the file picker.
     31   - Locate and select the .ova file you want to import.
     324.      Review Appliance Settings:
     33   - Click Next after selecting the file.
     34   - Review the virtual machine settings, including CPU, memory, and network.
     355.      Import the Appliance:
     36   - Click Import to start the process.
     37   - Wait for VirtualBox to import the .ova file. This might take a few minutes.
     38
     39---
     40==== **4. Start the Virtual Machine**:
     411. Click **Start** in VirtualBox.
     422. Log in using:
     43   - **Username**: `moodle`
     44   - **Password**: `mdl@123`
     45---
     46==== **5. Find the VM IP Address**:
     471. Inside the VM, type:
     48   ```bash
     49   ip addr
     50   ```
     512. Note the IP address (e.g., `192.168.1.10`).
     52
     53==== **6. Map Moodle to a Hostname on Host Machine**:
     54- On the host machine, edit the `hosts` file to map the VM's IP to a hostname.
     55
     56---
     57
     58==== **Edit Hosts File**
     59
     60==== **Windows**:
     611. Path: 
     62   `C:\Windows\System32\drivers\etc\hosts`
     632. Open Notepad as an administrator and add your VM IP: eg:
     64   ```
     65   192.168.1.10 mymoodle.test.learn.ac.lk
     66   ```
     67
     68==== **MacOS**:
     691. Path: 
     70   `/private/etc/hosts`
     712. Open a terminal and edit the file:
     72   ```bash
     73   sudo nano /private/etc/hosts
     74   ```
     753. Add:
     76   ```
     77   192.168.1.10 mymoodle.test.learn.ac.lk
     78   ```
     79
     80==== **Linux**:
     811. Path: 
     82   `/etc/hosts`
     832. Edit the file with:
     84   ```bash
     85   sudo nano /etc/hosts
     86   ```
     873. Add:
     88   ```
     89   192.168.1.10 mymoodle.test.learn.ac.lk
     90   ```
     91
     92---
     93
     94==== **7. Access Moodle from the Host Machine**:
     951. Open a browser on the host machine.
     962. Navigate to:
     97   ```
     98   http://mymoodle.test.learn.ac.lk
     99   ```
     100
     101---
     102
     103==== Notes for Users:
     104- Ensure VirtualBox's network settings are set to **Bridged Adapter**.
     105- Ensure the VM is running before accessing Moodle.
     106- Default credentials for the VM:
     107  - **Username**: `moodle`
     108  - **Password**: `Mdl@1234`
     109
     110This guide ensures users can easily import the `.vdi` file, configure the VM, and start practicing Moodle without additional setup.
     111
     112---
     113
     114==== **Part 2: Troubleshooting**
     115
     116Site Not Loading Properly:
     117
     118Verify nginx and php-fpm services are running:
     119 ``` bash
     120rc-service nginx restart
     121rc-service php-fpm82 restart
     122```
     123Ensure proper permissions for `moodledata:`
     124 ``` bash
     125
     126chmod -R 777 /var/www/moodledata
     127```
     128Error Messages:
     129
     130Check logs:
     131``` bash
     132
     133tail -f /var/log/nginx/error.log
     134```
     135
     136Renew DHCP Lease on Alpine Linux
     137``` bash
     138/etc/init.d/networking restart
     139```
     140then follow [Step 5](https://github.com/LEARN-LK/lms/blob/master/Practice-Moodle-VirtualBox.md#5-find-the-vm-ip-address)
     141
     142==== plugin installation Troubleshooting
     143
     144Edit config.php in the Moodle directory:
     145// Add these lines at the end of config.php:
     146 ``` bash
     147@error_reporting(E_ALL | E_STRICT);
     148@ini_set('display_errors', '1');
     149$CFG->debug = (E_ALL | E_STRICT);
     150$CFG->debugdisplay = 1;
     151```
     152
     153==== 1. Update PHP-FPM User and Group
     154   Open the PHP-FPM pool configuration file:
     155 ``` bash
     156vi /etc/php82/php-fpm.d/www.conf
     157```
     158 ``` bash
     159user = nginx
     160group = nginx
     161```
     162====  Restart PHP-FPM
     163
     164 ``` bash
     165rc-service php-fpm82 restart
     166```
     167==== Set Permission  "$CFG->directorypermissions = 0777;"
     168 ``` bash
     169vi /var/www/moodle/config.php
     170```