Q1
E-commerce Azure

QloApps 1.8 on Ubuntu 24.04 on Azure User Guide

| Product: QloApps 1.8 on Ubuntu 24.04 LTS on Azure

Overview

QloApps is an open source hotel reservation system. It gives a hotel, guest house, hostel or resort its own booking website, a booking engine that takes direct reservations, and a back office for properties, room types, rates, availability, guests, check in and check out, payments and reports. It is built on the PrestaShop 1.6 core and maintained by Webkul.

The cloudimg image runs QloApps 1.8.0 on Ubuntu 24.04 LTS with Apache 2.4, PHP 8.3 and MariaDB 10.11, all from the Ubuntu archive. QloApps installs itself on the first boot of your VM using its own installer, so the database password, the administrator password, the secret keys QloApps signs its cookies with and the back office address are generated on your VM and are not shared with any other deployment. The installer folder is removed afterwards. QloApps' sample hotel ("The Hotel Prime", with 20 rooms in four room types) is installed so you can try a booking straight away, then edit or remove it.

What is included:

  • QloApps 1.8.0 (Open Software License 3.0), from the official QloApps release on GitHub
  • Apache 2.4 with PHP 8.3 and the extensions QloApps needs (curl, gd, intl, mbstring, mysql, xml, zip, bcmath, soap)
  • MariaDB 10.11, listening on 127.0.0.1 only
  • A first boot service, qloapps-firstboot.service, that runs QloApps' installer and writes your credentials to /root/qloapps-credentials.txt (readable by root only)
  • QloApps' Cron Task Manager already scheduled every minute
  • cloudimg-set-public-address, to point the site at your domain name or a new IP address
  • cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Prerequisites

An Azure subscription and an SSH key pair. Standard_B2s (2 vCPU, 4 GiB RAM) suits a single small property; choose a larger size for several properties or heavy traffic. Network security group inbound rules: allow 80/tcp for the website and back office, 443/tcp once you enable HTTPS (Step 9), and 22/tcp from your own network for SSH. MariaDB is never exposed: it listens on 127.0.0.1 only.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for QloApps by cloudimg and select Create. On Basics pick your subscription, resource group, region and size; under Administrator account choose SSH public key and paste your key; under Inbound port rules allow SSH (22) and HTTP (80). Then select Review + create and Create.

First boot installs QloApps, which takes about a minute after the VM starts. The website answers once it has finished.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn cloudimg1647283583153:qloapps-ubuntu-24-04:default:latest

az vm create \
  --resource-group <your-rg> \
  --name qloapps \
  --image cloudimg1647283583153:qloapps-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

az vm open-port --resource-group <your-rg> --name qloapps --port 80

Step 3 - Confirm the services are running

SSH in as azureuser (ssh azureuser@<your-vm-public-ip>) and check that Apache, MariaDB and cron are active, that first boot has finished, and that MariaDB listens on the loopback address only.

systemctl is-active apache2 mariadb cron
test -f /var/lib/cloudimg/qloapps-firstboot.done && echo "first boot done"
sudo ss -tlnH | awk '{print $4}' | grep -E ':(80|3306)$' | sort -u

Expected output:

active
active
active
first boot done
*:80
127.0.0.1:3306

The first boot service, qloapps-firstboot, shows active until the VM's first reboot; it then shows inactive, because it runs only once.

The apache2, mariadb and cron services active, first boot done, the hotel website answering 200, Apache listening on port 80 and MariaDB on 127.0.0.1:3306 only

Step 4 - Read your credentials

The first boot service writes the site address, the back office address, the administrator e-mail and password, and the database details to a file only root can read:

sudo cat /root/qloapps-credentials.txt

The file looks like this; the values are unique to your VM:

QLOAPPS_VERSION=1.8.0
QLOAPPS_SITE_URL=http://<your-vm-public-ip>/
QLOAPPS_ADMIN_URL=http://<your-vm-public-ip>/admin<8 hex characters>/
QLOAPPS_ADMIN_DIR=admin<8 hex characters>
QLOAPPS_ADMIN_EMAIL=admin@example.com
QLOAPPS_ADMIN_PASSWORD=<generated>
QLOAPPS_DB_NAME=qloapps
QLOAPPS_DB_USER=qloapps
QLOAPPS_DB_PASSWORD=<generated>

The back office lives in a folder whose name is generated on your VM (admin followed by eight hexadecimal characters), so its address cannot be guessed. Keep the file private and change the administrator e-mail to your own after you sign in (Step 6).

The per VM QloApps credentials file, mode 600 owned by root, its keys listed with the values hidden, and the back office address and administrator e-mail

Step 5 - Open the hotel website

Browse to http://<your-vm-public-ip>/. The home page of the sample hotel opens with the room search bar: pick check in and check out dates and the number of guests, then Search Rooms to see the room types and prices that are free for those dates.

The QloApps hotel website home page for the sample Hotel Prime, with the check in and check out, guests and Search Rooms booking bar

Step 6 - Sign in to the back office

Browse to the QLOAPPS_ADMIN_URL from Step 4 and sign in with QLOAPPS_ADMIN_EMAIL and QLOAPPS_ADMIN_PASSWORD.

The QloApps back office sign in page with the e-mail address and password fields

The dashboard opens. QloApps ships with its dashboard Demo mode switched on, so the figures on the first visit are sample numbers: turn the Demo mode switch at the top right off to see your own bookings. Then open Hotel Admin (top right) > My preferences to set your own e-mail address and, if you like, a new password.

Step 7 - Take a booking from the back office

Front desk bookings are made under Hotel Reservation System > Book Now. Choose the dates, the property and the occupancy, then Search: the booking calendar and the counters show the total, available, partially available and booked rooms, and you can add free rooms to the cart and complete the booking for a guest.

The QloApps Book Now page with the booking form for The Hotel Prime and the booking calendar showing 20 available rooms

Guests book the same rooms themselves from the website (Step 5). Bookings from either side appear under Orders.

Step 8 - Set up your own hotel

  • Hotel Reservation System > Manage Hotel: edit The Hotel Prime into your own property (name, address, check in and check out times, policies), or add more properties.
  • Catalog > Manage Room Types: set each room type's price, occupancy, the rooms (numbers) that belong to it, images and features.
  • Catalog > Manage Service Products: extras such as breakfast, airport transfer or parking.
  • Modules and Services > Payment: QloApps includes bank wire and cheque, and payment modules for PayPal and others can be configured here.
  • Preferences > Maintenance: put the site in maintenance mode while you prepare it.

The QloApps Manage Room Types list for the sample hotel, with each room type, its hotel, price and status

Step 9 - Point the site at your domain and enable HTTPS

QloApps redirects every visitor to its configured address, which first boot sets to your VM's public IP. When you have a DNS name pointing at the VM (an A record), set it as the site's address, replacing <your-domain> with that name (for example hotel.example.com):

sudo cloudimg-set-public-address <your-domain>

This updates the shop domain in the database, clears QloApps' cache, rewrites .htaccess, sets your domain as the ServerName of the QloApps Apache site (qloapps.conf, checked with apache2ctl configtest before Apache reloads) and updates the addresses in /root/qloapps-credentials.txt. Run it again with the public IP to go back (the site then has no ServerName).

Then take a free Let's Encrypt certificate with Certbot's Apache plugin (open port 443 in the network security group first). Run cloudimg-set-public-address with your domain first, as above: Certbot then finds the QloApps site by its ServerName and does not ask which site to use.

sudo apt-get install -y certbot python3-certbot-apache
sudo certbot --apache -d <your-domain>

Finally, in the back office open Preferences > General, set Enable SSL to Yes, save, then set Enable SSL on all pages to Yes and save again.

Step 10 - Scheduled tasks

QloApps 1.8 runs its scheduled work (log cleanup, and tasks that modules register) through its Cron Task Manager module. The image already runs it every minute as the web server user:

sudo crontab -u www-data -l
# QloApps Cron Task Manager (runs qlocrontaskmanager/cron.php through PHP CLI), installed by cloudimg
* * * * * /usr/bin/php /usr/local/lib/cloudimg/qloapps-cron.php >/dev/null 2>&1

The tasks themselves are listed in the back office under Advanced Parameters > Cron Task Manager.

Security model

No password, cookie key or database ships in the image. On the first boot of every VM, QloApps' own installer runs on that VM with a database password and an administrator password generated there; it also generates the cookie keys in config/settings.inc.php. The passwords are passed to the installer on standard input, never on a command line. The image then removes the install folder and the upstream tests folder, moves the back office to a generated folder name, and proves the administrator password signs in. You can prove it yourself: this check signs in through the real back office login form with the password from the credentials file, and checks that a wrong password is refused. It uses the e-mail address and password in the credentials file over plain HTTP on the VM itself, so run it before you change the administrator e-mail address or password (Step 6) or turn on SSL (Step 9); after those changes the check fails.

sudo bash /usr/local/sbin/qloapps-cred-roundtrip.sh

Expected output:

ROUNDTRIP_OK back-office login with the per-VM password; wrong password refused

Also in this image:

  • MariaDB listens on 127.0.0.1 only, with no anonymous users and no test database; the qloapps database user exists only on the VM itself.
  • Apache and MariaDB cannot reach the Azure Instance Metadata Service or the Azure wire server (IPAddressDeny in their systemd units), so a request to the website cannot be turned into a request for the VM's metadata. (QloApps' scheduled tasks run from cron, which is not restricted, because your own cron jobs run there too.)
  • Apache sends no version banner, refuses TRACE, and refuses /install and /tests even if they were put back.
  • The website is served over HTTP until you add your domain and certificate (Step 9); do that before you take real bookings or payments.

The credential round trip signing in with the per VM password and refusing a wrong one, the generated back office folder, and the metadata deny on apache2 and mariadb

Versions and the first boot service

cat /opt/qloapps-source/VERSION
php -r 'echo PHP_VERSION, PHP_EOL;'
mariadb --version
test -f /var/lib/cloudimg/qloapps-firstboot.done && echo "first boot done"

QloApps 1.8.0, PHP 8.3, MariaDB 10.11 and Apache 2.4 versions, first boot done, and the www-data crontab with the Cron Task Manager entry

Backups

Your bookings and settings are in the qloapps MariaDB database; uploaded images are under /var/www/qloapps/img. A simple nightly backup:

sudo mariadb-dump --single-transaction qloapps | gzip > qloapps-$(date +%F).sql.gz
sudo tar czf qloapps-files-$(date +%F).tar.gz -C /var/www/qloapps img config/settings.inc.php

Keep copies off the VM (for example in Azure Blob Storage), or use Azure Backup for the whole VM.

Logs and troubleshooting

sudo tail -n 20 /var/log/apache2/qloapps-error.log
sudo journalctl -u qloapps-firstboot --no-pager | tail -n 20
  • The first boot log is /var/log/qloapps-firstboot.log. If the website does not answer a few minutes after the VM started, check systemctl status qloapps-firstboot: Apache starts only after first boot has finished.
  • A redirect to an address you cannot reach means the site's configured address is not the one you browse to: run sudo cloudimg-set-public-address <the address you use> (Step 9).
  • QloApps keeps its code in /var/www/qloapps and its database settings in /var/www/qloapps/config/settings.inc.php.

Support

cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours. Contact us for help with deployment and first sign in, pointing the site at your domain and enabling HTTPS, upgrades, performance tuning, MariaDB administration and troubleshooting.

QloApps is a trademark of Webkul Software. cloudimg is not affiliated with or endorsed by Webkul; this image packages the open source QloApps release under its Open Software License 3.0.