Showing posts with label google cloud. Show all posts
Showing posts with label google cloud. Show all posts

Wednesday, 4 June 2025

install moodle 5 di virtual machine google cloud

 ✅ Solusi: Upgrade ke PHP 8.2 di Ubuntu 22.04

Berikut langkah aman dan cepat untuk upgrade PHP 8.2 di Ubuntu 22.04 Minimal:

🔧 1. Tambahkan PPA Resmi dari ondrej/php
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update

💡 2. Install PHP 8.2 dan Ekstensi Moodle
sudo apt install -y php8.2 php8.2-fpm php8.2-mysql php8.2-xml php8.2-gd php8.2-intl php8.2-curl php8.2-zip php8.2-mbstring php8.2-soap php8.2-bcmath php8.2-readline



🔁 3. Ubah konfigurasi Nginx agar pakai PHP 8.2

Edit file konfigurasi Nginx kamu, misalnya:
sudo nano /etc/nginx/sites-available/moodle
Temukan bagian ini:
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
Ubah menjadi:
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
simpan dan keluar

♻️ 4. Restart semua service
sudo systemctl restart php8.2-fpm
sudo systemctl disable php8.1-fpm
sudo systemctl stop php8.1-fpm
sudo systemctl restart nginx

✅ 5. Verifikasi Versi PHP
php -v

Setelah ini, reload halaman instalasi Moodle. Moodle 5.0 sekarang harus bisa lanjut karena PHP 8.2 sudah aktif.

Tuesday, 3 June 2025

mesin moodle google cloud

 

Machine type
g1-small (1 vCPUs, 1.7 GB memory)
CPU platform
Intel Skylake
Minimum CPU platform
None
Architecture
x86/64

chatgpt

Sama-sama! 🎉 Senang sekali mendengar bahwa semuanya sudah berhasil! 🎯

Sekarang website Moodle kamu sudah bisa diakses dengan aman lewat domain yang dikamuflase dan diamankan oleh Cloudflare Tunnel, tanpa harus membuka port publik — langkah yang aman, profesional, dan efisien. 👍


Kalau kamu nanti ingin:

  • Menambahkan autostart untuk tunnel saat booting

  • Mengaktifkan akses terbatas (Zero Trust) ke Moodle (misalnya hanya user tertentu yang bisa masuk)

  • Menghubungkan Moodle ke email, backup, atau plugin

  • Atau sekadar ingin tampilannya lebih menarik

Saya siap bantu juga. 🚀

Selamat mengelola platform pembelajaranmu! 😊

lanjutan ssh server moodle di google cloud

 ketika menjalankan perintah ini ada error juga, sampai akhirnya berhasil

 

utuhglobal@moodle-1-vm:~$ sudo nano /etc/cloudflared/config.yml
utuhglobal@moodle-1-vm:~$ ls /etc/cloudflared/
ls: cannot access '/etc/cloudflared/': No such file or directory
utuhglobal@moodle-1-vm:~$ sudo nano /etc/cloudflared/config.yml
utuhglobal@moodle-1-vm:~$ sudo nano /etc/cloudflared/config.yml
utuhglobal@moodle-1-vm:~$ sudo mkdir -p /etc/cloudflared
utuhglobal@moodle-1-vm:~$ sudo nano /etc/cloudflared/config.yml
utuhglobal@moodle-1-vm:~$ cloudflared tunnel route dns moodle-tunnel moodle.sman2kandangan.sch.id
2025-06-03T13:14:48Z INF Added CNAME moodle.sman2kandangan.sch.id which will route to this tunnel tunnelID=513840d2-0a37-4ac4-becd-158be81c615b
utuhglobal@moodle-1-vm:~$ cloudflared tunnel run moodle-tunnel
Tunnel credentials file '/root/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json' doesn't exist or is not a file
utuhglobal@moodle-1-vm:~$ sudo cloudflared service install
2025-06-03T13:15:36Z INF Using Systemd
systemctl [start cloudflared.service] returned with error code exit status 1 due to: Job for cloudflared.service failed because the control process exited with error code.
See "systemctl status cloudflared.service" and "journalctl -xeu cloudflared.service" for details.

utuhglobal@moodle-1-vm:~$ ls ~/.cloudflared/
513840d2-0a37-4ac4-becd-158be81c615b.json  cert.pem
utuhglobal@moodle-1-vm:~$ sudo mkdir -p /root/.cloudflared
utuhglobal@moodle-1-vm:~$ sudo cp ~/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json /root/.cloudflared/
utuhglobal@moodle-1-vm:~$ cloudflared tunnel run moodle-tunnel
Tunnel credentials file '/root/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json' doesn't exist or is not a file
utuhglobal@moodle-1-vm:~$ ls
cloudflared-linux-amd64.deb
utuhglobal@moodle-1-vm:~$ ls /.clodflared/
ls: cannot access '/.clodflared/': No such file or directory
utuhglobal@moodle-1-vm:~$ ls /.cloudflared/
ls: cannot access '/.cloudflared/': No such file or directory
utuhglobal@moodle-1-vm:~$ ls /root/.cloudflared/
ls: cannot access '/root/.cloudflared/': Permission denied
utuhglobal@moodle-1-vm:~$ sudo ls /root/.cloudflared/
513840d2-0a37-4ac4-becd-158be81c615b.json
utuhglobal@moodle-1-vm:~$ sudo nano /etc/cloudflared/config.yml
utuhglobal@moodle-1-vm:~$ cloudflared tunnel run moodle-tunnel
Tunnel credentials file '/root/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json' doesn't exist or is not a file
utuhglobal@moodle-1-vm:~$ ls ~/.cloudflared
513840d2-0a37-4ac4-becd-158be81c615b.json  cert.pem
utuhglobal@moodle-1-vm:~$ sudo cp ~/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json /root/.cloudflared/
utuhglobal@moodle-1-vm:~$ cloudflared tunnel run moodle-tunnel
Tunnel credentials file '/root/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json' doesn't exist or is not a file
utuhglobal@moodle-1-vm:~$ ls ~/.cloudflared
513840d2-0a37-4ac4-becd-158be81c615b.json  cert.pem
utuhglobal@moodle-1-vm:~$ sudo ls /root/.cloudflared
513840d2-0a37-4ac4-becd-158be81c615b.json
utuhglobal@moodle-1-vm:~$ cloudflared tunnel list
You can obtain more detailed information for each tunnel with `cloudflared tunnel info <name/uuid>`
ID                                   NAME          CREATED              CONNECTIONS                        
07c91082-76b3-49d0-b1f6-38d6dc7dd65b erapor        2023-12-02T08:32:32Z                                    
e98b54c7-c8c3-403a-a162-e8b8e866a6aa moodle-go     2025-06-03T13:00:45Z                                    
513840d2-0a37-4ac4-becd-158be81c615b moodle-tunnel 2025-06-03T13:02:21Z 2xkix03, 2xkix06                   
ed65472f-4a35-4efb-b93a-74f946490b17 smandaka      2023-12-02T09:03:22Z 1xsin06, 1xsin11, 1xsin12, 1xsin16 
63c00ee6-da0a-4cf9-b6c1-13094c208b3d ulangan       2023-12-01T02:24:17Z                                    
utuhglobal@moodle-1-vm:~$ cloudflared tunnel --config /etc/cloudflared/config.yml run
Tunnel credentials file '/root/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json' doesn't exist or is not a file 

ssh server moodle di

 Linux moodle-1-vm 6.1.0-37-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
       ___ _ _                   _
      | _ |_) |_ _ _  __ _ _ __ (_)
      | _ \ |  _| ' \/ _` | '  \| |
      |___/_|\__|_|_|\__,_|_|_|_|_|

  -> Welcome to Bitnami LMS powered by Moodle(TM) LMS 5.0.0
  -> Documentation:   https://docs.bitnami.com/google/apps/moodle/
  -> Bitnami Support: https://github.com/bitnami/vms/issues
utuhglobal@moodle-1-vm:~$ wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
--2025-06-03 12:52:41--  https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
Resolving github.com (github.com)... 20.27.177.113
Connecting to github.com (github.com)|20.27.177.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github.com/cloudflare/cloudflared/releases/download/2025.5.0/cloudflared-linux-amd64.deb [following]
--2025-06-03 12:52:42--  https://github.com/cloudflare/cloudflared/releases/download/2025.5.0/cloudflared-linux-amd64.deb
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/106867604/9e5400a4-4cb7-46d5-9863-40f617b2d4ce?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250603%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250603T125242Z&X-Amz-Expires=300&X-Amz-Signature=da178afd399cfb11e66bf3a62ab8d2ec601d5de79c80912c6116bf32739be2df&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dcloudflared-linux-amd64.deb&response-content-type=application%2Foctet-stream [following]
--2025-06-03 12:52:42--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/106867604/9e5400a4-4cb7-46d5-9863-40f617b2d4ce?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250603%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250603T125242Z&X-Amz-Expires=300&X-Amz-Signature=da178afd399cfb11e66bf3a62ab8d2ec601d5de79c80912c6116bf32739be2df&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dcloudflared-linux-amd64.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18558876 (18M) [application/octet-stream]
Saving to: ‘cloudflared-linux-amd64.deb’

cloudflared-linux-amd64.deb 100%[==========================================>]  17.70M  18.9MB/s    in 0.9s    

2025-06-03 12:52:44 (18.9 MB/s) - ‘cloudflared-linux-amd64.deb’ saved [18558876/18558876]

utuhglobal@moodle-1-vm:~$ sudo dpkg -i cloudflared-linux-amd64.deb
Selecting previously unselected package cloudflared.
(Reading database ... 80542 files and directories currently installed.)
Preparing to unpack cloudflared-linux-amd64.deb ...
Unpacking cloudflared (2025.5.0) ...
Setting up cloudflared (2025.5.0) ...
Processing triggers for man-db (2.11.2-2) ...
utuhglobal@moodle-1-vm:~$ cloudflared tunnel login
Please open the following URL and log in with your Cloudflare account:

https://dash.cloudflare.com/argotunnel?aud=&callback=https%3A%2F%2Flogin.cloudflareaccess.org%2F_C2WZPGL_erFjF_YeqwGy7uoPytg71PzombKe5AP2k4%3D

Leave cloudflared running to download the cert automatically.
2025-06-03T12:54:52Z INF Waiting for login...
2025-06-03T12:55:46Z INF Waiting for login...
2025-06-03T12:56:41Z INF Waiting for login...
2025-06-03T12:57:35Z INF Waiting for login...
2025-06-03T12:58:02Z INF You have successfully logged in.
If you wish to copy your credentials to a server, they have been saved to:
/home/utuhglobal/.cloudflared/cert.pem

utuhglobal@moodle-1-vm:~$ cloudflared tunnel create moodle-tunnel
Tunnel credentials written to /home/utuhglobal/.cloudflared/513840d2-0a37-4ac4-becd-158be81c615b.json. cloudflared chose this file based on where your origin certificate was found. Keep this file secret. To revoke these credentials, delete the tunnel.

Created tunnel moodle-tunnel with id 513840d2-0a37-4ac4-becd-158be81c615b