Application Development Azure

Apache Answer on Ubuntu 24.04 on Azure User Guide

| Product: Apache Answer on Ubuntu 24.04 LTS on Azure

Overview

Apache Answer is an open-source question-and-answer platform - a self-hosted Stack Overflow you can run for a team, a community or a product support site. The cloudimg image installs Apache Answer 2.0.1 (Apache-2.0 licensed) as a single Go binary, runs it as a hardened systemd service bound to loopback behind an nginx reverse proxy on port 80, persists its SQLite database and uploads on a dedicated Azure data disk, and seeds a unique administrator account on the first boot of every VM. Backed by 24/7 cloudimg support.

What is included:

  • Apache Answer 2.0.1 (binary /usr/local/bin/answer) with an embedded SQLite database
  • nginx on :80 as a plain reverse proxy to the loopback Answer backend on 127.0.0.1:9080
  • A per-VM administrator account generated on first boot and recorded in a root-only file
  • A dedicated Azure data disk at /var/lib/answer for the database, config and uploads
  • answer.service + nginx.service as systemd units, enabled and active
  • 24/7 cloudimg support

Prerequisites

An active Azure subscription, an SSH key pair, and a VNet + subnet in the target region. Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting point. NSG inbound: allow 22/tcp from your management network and 80/tcp. Apache Answer serves plain HTTP on port 80; for production, terminate TLS in front of it with your own domain.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Apache Answer 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). Review the dedicated data disk on the Disks tab, then Review + create -> Create.

Step 2 - Deploy from the Azure CLI

az vm create \
  --resource-group <your-rg> \
  --name apache-answer \
  --image <marketplace-image-urn> \
  --size Standard_B2ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard

az vm open-port --resource-group <your-rg> --name apache-answer --port 80 --priority 1010

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services and data disk

Apache Answer runs as answer.service (the Go binary, bound to loopback) and nginx.service (the public reverse proxy on port 80). The SQLite database, config and uploads live on a dedicated Azure data disk mounted at /var/lib/answer.

systemctl is-active answer.service nginx.service
findmnt -no SOURCE,TARGET,FSTYPE /var/lib/answer
/usr/local/bin/answer --version

Both services report active, the data disk is mounted ext4, and the binary reports version 2.0.1.

answer.service and nginx.service active, the dedicated data disk mounted, and the Answer version

Step 5 - Retrieve your admin password

The administrator password is generated uniquely on the first boot of your VM and written to a root-only file. Confirm the home page is also answering on port 80:

sudo grep -E '^answer\.' /root/apache-answer-credentials.txt
curl -s -o /dev/null -w 'home HTTP %{http_code}\n' http://localhost/

The file contains answer.admin.email (admin@cloudimg.local), answer.admin.pass (your unique password) and answer.url. The home page returns HTTP 200. Store the password somewhere safe.

The per-VM admin credentials file and the home page returning HTTP 200

Step 6 - Sign in to the web UI

Browse to http://<vm-public-ip>/ and select Log in, or go straight to http://<vm-public-ip>/users/login. Sign in with admin@cloudimg.local and the password from Step 5.

The Apache Answer sign-in page served by your VM

After signing in you land on the question list - your community's home page. New visitors can browse questions, tags, users and badges; signed-in members can ask and answer.

The Apache Answer question list - the community home page

Step 7 - The admin dashboard

The administrator area is at http://<vm-public-ip>/admin. It shows site statistics, site health (version, running mode, upload folder, HTTPS status), system info and quick links. Use Contents, Community, Appearance and Advanced to configure your site - site name, login policy, themes, SMTP for email, and more.

The Apache Answer admin dashboard showing site statistics and health

Step 8 - Ask a question

Select Create -> Question (or browse to http://<vm-public-ip>/questions/ask). Give the question a specific title, write the body in the Markdown editor, add tags, and post. Other members can then answer, comment and vote.

The Apache Answer create-question view with the Markdown editor and tags

Step 9 - The login API

Apache Answer exposes a JSON login endpoint that returns a session access token. This is useful for scripting or integration. It accepts the admin email and password and returns HTTP 200 with an access_token on success (and HTTP 400 on a wrong password):

PASS=$(sudo grep '^answer.admin.pass=' /root/apache-answer-credentials.txt | cut -d= -f2-)
curl -s -X POST -H 'Content-Type: application/json' \
  -d "{\"e_mail\":\"admin@cloudimg.local\",\"pass\":\"${PASS}\"}" \
  http://localhost/answer/api/v1/user/login/email | head -c 220

The response begins {"code":200,"reason":"base.success",...} and includes the signed-in user and an access_token.

The Apache Answer admin login API returning HTTP 200 with the signed-in user

Step 10 - Where data lives

Everything stateful is on the dedicated Azure data disk at /var/lib/answer, so it is independent of the OS disk and survives image updates:

sudo ls -la /var/lib/answer/data

You will see answer.db (the SQLite database), conf/config.yaml (the site config, which pins the loopback bind 127.0.0.1:9080), uploads/ (user uploads), i18n/ and cache/.

Step 11 - Enable HTTPS for production

Apache Answer is served as plain HTTP on port 80. For production, put your own domain in front and terminate TLS - for example by installing certbot and an nginx TLS server block, or by placing the VM behind an Azure Application Gateway or Front Door with a managed certificate. After enabling HTTPS, set your site URL to the https:// address in Admin -> Advanced -> General so links and emails use it.

Maintenance

  • Restart the service: sudo systemctl restart answer.service
  • View logs: sudo journalctl -u answer.service -e
  • OS updates: unattended-upgrades is enabled; apply the latest security updates with sudo apt-get update && sudo apt-get -y upgrade and reboot if a new kernel is installed.
  • Back up: snapshot the /var/lib/answer data disk, or copy /var/lib/answer/data/answer.db and /var/lib/answer/data/uploads while the service is stopped.

Support

This image is maintained by cloudimg with 24/7 support. Apache Answer is licensed under Apache-2.0. "Apache", "Apache Answer" and the Apache feather logo are trademarks of The Apache Software Foundation; this image is provided by cloudimg and is not endorsed by or affiliated with The Apache Software Foundation.