Deployment guide

Apache Answer

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 SecureAnyCloud image installs Apache Answer 2.0.1 (Apache-2.0 licensed) as a single Go binary and seeds a unique administrator account on the first boot of every VM.

What you get:

  • Apache Answer 2.0.1 (binary /usr/local/bin/answer) with an embedded SQLite database, running as a hardened systemd service bound to loopback
  • 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 and nginx.service as systemd units, enabled and active
  • 24/7 SecureAnyCloud support

Prerequisites

Before you deploy this image, make sure you have:

  • An active Azure subscription
  • An SSH key pair
  • A VNet and subnet in the target region

Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting point. For NSG inbound rules, 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 SecureAnyCloud, 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 select Review + create, and select Create.

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 sac1647283583153:apache-answer-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name apache-answer \
  --image sac1647283583153:apache-answer-ubuntu-24-04:default:latest \
  --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 should report active, the data disk should be mounted ext4, and the binary should report version 2.0.1.

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@sac.local), answer.admin.pass (your unique password) and answer.url. The home page returns HTTP 200. Store the password somewhere safe.

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@sac.local and the password from Step 5.

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

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, including the site name, login policy, themes and SMTP for email.

Step 8 - Ask a question

Select Create, then 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 it. Other members can then answer, comment and vote.

Step 9 - The login API

Apache Answer exposes a JSON login endpoint that returns a session access token, which is useful for scripting or integration. The endpoint 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@sac.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.

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, install certbot and an nginx TLS server block, or place the VM behind an Azure Application Gateway or Front Door with a managed certificate.

After you enable HTTPS, set your site URL to the https:// address in Admin, then Advanced, then 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 SecureAnyCloud 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 SecureAnyCloud and is not endorsed by or affiliated with The Apache Software Foundation.

Deploy on Azure

Launch Apache Answer on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure