Thursday, July 28, 2022

Setting up Joomla 4 and MySQL under Red Hat OpenShift


Continue from my first post about Red Hat OpenShift, here is how to setup Joomla 4/PHP/MySQL under Red Hat OpenShift.

MySQL 

Start by adding MySQL from template.


Most of the fields will be auto generated. Note that the database name is "sampledb"

Continue and wait for the pod to up & ready


Get your OC login. List down available pods. RSH into your MySQL (running) pod and grep the environment variables for MYSQL_SERVICE_HOST, MYSQL_USER & MYSQL_PASSWORD

get IP address

C:\Users\USER>oc get pods

NAME             READY   STATUS      RESTARTS   AGE

mysql-1-deploy   0/1     Completed   0          110s

mysql-1-mrqtl    1/1     Running     0          107s

C:\Users\USER>oc rsh mysql-1-mrqtl

sh-4.4$ env | grep MYSQL_SERVICE_HOST

MYSQL_SERVICE_HOST=172.30.117.29

sh-4.4$ env | grep USER

MYSQL_USER=userBUW

sh-4.4$ env | grep PASSWORD

MYSQL_PASSWORD=XxXxXxXxXxXx

PHP

Now add PHP images from template.


Use joomla4 PHP files from Github repository below.

https://github.com/ermihusni/joomla4

Note that I've tried the actual Joomla repository but somehow failed. You may try if you want to.

https://github.com/joomla


Wait for the PHP pod to up & ready, and then open the PHP page to start Joomla setup.

Joomla

Insert "sampledb" as database name, the one that we've got from MySQL setup before.

Set the hostname, username & password from the MySQL server environment variable RSH grep before.


    Confirm as the website owner by deleting the autogenerated file named "_Joomla*".


RSH into the pod and delete it from the "installation" directory.

C:\Users\USER>oc get pods

NAME                         READY   STATUS      RESTARTS   AGE

joomla-001-1-build           0/1     Completed   0          3m50s

joomla-001-d9ff8c8b6-dwsgd   1/1     Running     0          2m35s

mysql-1-deploy               0/1     Completed   0          13m

mysql-1-mrqtl                1/1     Running     0          13m


C:\Users\USER>oc rsh joomla-001-d9ff8c8b6-dwsgd

sh-4.4$ cd installation/


sh-4.4$ ls

INSTALL  LICENSE.txt  _JoomlahFHOLvETv9AotNDHiqiuN.txt  ...


sh-4.4$ rm _JoomlahFHOLvETv9AotNDHiqiuN.txt

Continue the setup and congratulation!



No comments:

Post a Comment