Documentation

Virtualbox CMS Development Appliance

The VM Appliance is based on http://mirror.umd.edu/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso

Download Appliance File

https://help.hubzero.org/app/site/vmimages/Hubzero_CMS_Development_Environment.ova

Import into Virtualbox

https://docs.oracle.com/cd/E26217_01/E26796/html/qs-import-vm.html

 

VirtualBox Configuration

The VM Appliance expects to be configured as a server.  Do NOT configure shared folders or mount directories to a local workstation filesystem, it's likely permission and write access will be problematic.

Networking in the appliance is configured in Bridged network mode.  This mode will obtain a DHCP IP from your local DHCP server and will be on the same network as your laptop for easy access.

Note: You may want to consider using NAT when connecting to a public network where you do not want your development hub exposed to other users of the network.

If you prefer a NAT network configuration:

https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/

 

Chosen Hub Configuration

The following configuration options have been chosen during the VM appliance creation process and may be different on a production hubs.

hub name is 'hub'

The webroot is /var/www/hub

 

Finding the Hub Appliance IP address

From the VirtualBox terminal as the root user:

ip addr show

** The IP address may change if the VM is restarted

 

How to access the hub VM

It may be useful to add a short name for the VM to your hosts file (/etc/hosts for Linux and Mac or C:\Windows\System32\drivers\etc\hosts on Windows). If your IP address changes you will need to update it, but if you have sftp, DBeaver, and bookmarks set to use the name you will only have to update one location. If you add a name to hosts, use that name below where it says <ip_address_from_above>

SSH/SFTP

ssh root@<ip_address_from_above>

root password: hubzero2021

Web port 443

https://<ip_address_from_above>

** Accept the invalid / Self Signed Cert message.   If you don't see that message, please use Firefox or add the default snake-oil certificate to your browser.

One-time use CMS admin credentials

Once your new hub VM is up and running create a new account via hub registration at /register.  To email confirm, approve and promote the new account to Super User/Admin, you may use the included admin account once.  The username is "admin" and you can find the password in the VM at /etc/hubzero.secrets  "CMS-ADMIN".  You must be root on the VM to access this file.  ** Do not use this account after promoting your individual account to a CMS Super User - it is no longer needed.

 

CMS Cron Job Configuration

Add the <ip_address_from_above> to the CMS Cron component IP Whitelist configuration.

The full list should be "127.0.0.1,<ip_address_from_above>"

 

Updating the CMS code

As root:

webroot="hub" && \
cd /var/www/${webroot} && \
git stash && git pull && \
cd /var/www/${webroot}/core && ./bin/composer install && \
cd /var/www/${webroot} && php muse migration -i -f && \
chown -R apache:apache /var/www/${webroot} && \
hzcms update

Reference: https://help.hubzero.org/documentation/22/webdevs/index/devenvironment

 

Debugging the Hub

As root:

yum install php56-php-pecl-xdebug

Add the following to /opt/remi/php56/etc/php.ini:

xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_enable = 1
xdebug.remote_host = <ip_address_from_above>
xdebug.remote_port = 9003
xdebug.idekey=IDEKEY
xdebug.remote_log="/var/log/hubzero/xdebug.log"

CLI

Download an appropriate version of [dbgpClient](https://xdebug.org/download#dbgpClient). Possibly you will need to look into the [archive](https://xdebug.org/download/historical). Once downloaded you should be able to run:

dbgpClient -p 9003

and debug on the CLI as needed.

IDE (VS Code example)

In VS Code, as an example, install PHP Debug and click "Run", "Add Configurations". In the resulting launch.json you will need to minimally edit the "Listen for Xdebug" configuration to include the following:

{
  "name": "Listen for Xdebug",
  "type": "php",
  "request": "launch",
  "port": 9003,
  "pathMappings": {
    "/var/www/hub/": "${workspaceFolder}/",
  },
},

Last modified:

  • Copyright © 2022 Hubzero
  • Powered by Hubzero®