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
:80as a plain reverse proxy to the loopback Answer backend on127.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/answerfor the database, config and uploads answer.serviceandnginx.serviceas 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 1010Step 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 --versionBoth 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 220The 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/dataYou 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 upgradeand reboot if a new kernel is installed. - Back up: snapshot the
/var/lib/answerdata disk, or copy/var/lib/answer/data/answer.dband/var/lib/answer/data/uploadswhile 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
Overview
This image runs Apache Answer, the open-source question-and-answer platform for teams at any scale. Use it for a community forum, a help centre or a company knowledge management platform. Answer gives you a fast, searchable Q&A experience with questions, answers, accepted solutions, tags, voting, reputation and a full moderation and administration suite.
What you get:
- The Apache Answer binary under
/opt/answer, running as a dedicated unprivilegedanswersystem account under a systemd service that starts it on boot and restarts it on failure - Application data (the SQLite database, the uploads directory and the generated configuration) at
/var/lib/answer, on a dedicated, independently resizable EBS data volume - Setup already completed: Apache Answer normally presents an interactive web setup wizard on first run, but this image completes that setup during the build using Answer's built-in non-interactive install path, so your instance comes up initialised on a SQLite database with the schema migrated and an administrator account ready
- The Answer binary bound to the loopback interface only, never exposed directly, with an nginx reverse proxy that publishes the Q&A web interface and the same-origin REST API on port 80
- An administrator password generated on the first boot of every deployed instance, so two instances launched from the same Amazon Machine Image never share a password. It is written to
/root/apache-answer-credentials.txtwith mode 0600, so only the root user can read it.
Prerequisites
Before you deploy this image, make sure you have:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group allowing inbound port 22 from your management network and port 80 for the Q&A web interface and the REST API
- The AWS CLI (version 2) installed locally if you plan to deploy from the command line
Launch the instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for Apache Answer. Select the SecureAnyCloud listing and choose Select, then choose Continue on the subscription summary.
Pick an instance type of t3.small or larger. Choose your EC2 key pair under Key pair (login).
Under Network settings, select your VPC and subnet. Create or select a security group that opens port 22 from your management network and port 80 for the Q&A web interface and the REST API. Leave the root volume at the default size or larger.
Select Launch instance. First-boot initialisation takes a few seconds after the instance state becomes Running and the status checks pass.
Launch the instance from the AWS CLI
Run the following command to launch an instance from the SecureAnyCloud Apache Answer Marketplace AMI into an existing subnet and security group. Replace <ami-id> with the AMI ID shown on the Marketplace listing, <key-name> with your EC2 key pair name, <subnet-id> with your subnet ID, and <security-group-id> with a security group that opens ports 22 and 80 as described above.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type t3.small \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=apache-answer}]'When the instance reaches the Running state and its status checks pass, note its public IP address or DNS name from the EC2 console or with aws ec2 describe-instances.
Connect to your instance
Connect over SSH using your key pair and the login user for your operating system variant. For Ubuntu 24.04, the login user is ubuntu.
ssh -i <key-name>.pem ubuntu@<public-ip>Retrieve the admin password
The administrator password is unique to your instance and was generated on first boot. Read it as root:
sudo cat /root/apache-answer-credentials.txtThe file lists the Answer URL, the administrator email and the generated password, along with an example REST API login call. Keep this password somewhere safe.
Sign in to the Q&A web interface
The Apache Answer web interface is served on port 80 by nginx. In a browser, go to:
http://<instance-public-ip>/The Q&A home lists the community questions. Select Login and sign in with the administrator email and the password from the credentials file.
Open a question to read its full body in Markdown alongside its answers. The author of a question can accept the best answer, and any signed-in user can vote questions and answers up or down.
The administration dashboard, reachable from the user menu, is where the administrator manages the site, users, content moderation, tags, themes, login policy and plugins.
Confirm Apache Answer is running
Over SSH, confirm the Answer service and the nginx proxy are active and that the ports are listening:
sudo systemctl is-active answer nginx
sudo ss -tlnp | grep -E ':(80|9080) 'You should see both services reported as active, the Answer binary listening on 127.0.0.1:9080 (loopback only), and nginx listening on port 80.
Ask and answer questions
Build your knowledge base from the web interface. Select Ask a Question, give it a title and a body in Markdown, add one or more tags, and post it.
Other users (or you) answer it and vote on the best contributions, and the question author marks an answer as accepted. Tags organise questions into topics, and the search box queries the whole knowledge base.
To confirm the bundled REST API is serving, query the public question list endpoint over loopback on the instance:
curl -s 'http://127.0.0.1:9080/answer/api/v1/question/page?page=1&page_size=5' | head -c 300; echoUse the REST API
Apache Answer exposes a REST API under /answer/api/v1, served same-origin on port 80 through nginx. The same host and port therefore serve both the web interface and the API.
Obtain an access token by posting your administrator email and password to the email login endpoint. On the instance, you can call it over loopback:
EMAIL=$(sudo grep '^answer.admin.email=' /root/apache-answer-credentials.txt | cut -d= -f2-)
PASS=$(sudo grep '^answer.admin.pass=' /root/apache-answer-credentials.txt | cut -d= -f2-)
curl -s -X POST -H 'Content-Type: application/json' \
--data "{\"e_mail\":\"${EMAIL}\",\"pass\":\"${PASS}\"}" \
http://127.0.0.1/answer/api/v1/user/login/email | head -c 300; echoThe response includes an access_token. Pass it as the Authorization header on subsequent API calls. From outside the instance, send the same request to http://<instance-public-ip>/answer/api/v1/user/login/email.
The data volume
The application data lives on a dedicated EBS volume mounted at /var/lib/answer. This keeps the SQLite database, the uploaded files and the configuration off the operating system disk, and lets you resize or snapshot them independently. Confirm the mount with:
df -h /var/lib/answerThe SQLite database is at /var/lib/answer/answer.db, uploaded files are under /var/lib/answer/uploads, and the generated configuration is at /var/lib/answer/conf/config.yaml.
To grow the data store, expand the EBS volume in the AWS console. Then grow the filesystem on the instance with sudo resize2fs on the underlying device.
Enable HTTPS
The Q&A interface and the API are served over plain HTTP on port 80 by nginx. For production use, place them behind TLS.
Obtain a certificate for your domain, for example with a managed certificate on an Application Load Balancer in front of the instance, or with Certbot installed on the instance. Then configure nginx to listen on 443 with your certificate and proxy to 127.0.0.1:9080 exactly as the bundled site does for port 80.
Set the site URL to your HTTPS domain in the Answer admin dashboard under General, so generated links use it. Restrict the security group so ports 80 and 443 are reachable only from the networks that use the platform.
Backup and maintenance
Back up the platform by snapshotting the /var/lib/answer EBS volume, which captures the SQLite database, the uploads and the configuration in one consistent image. You can also copy /var/lib/answer/answer.db and the uploads directory while the service is briefly stopped.
Apply operating system security updates with sudo apt-get update && sudo apt-get upgrade, and reboot when a new kernel is installed. Apache Answer and nginx start automatically on boot.
Support
This image is published and supported by SecureAnyCloud. Support covers deployment, site configuration, user and role management, tags and categories, theming, plugins, SMTP and email, backup of the SQLite database and uploads, TLS and reverse proxy tuning. Contact SecureAnyCloud through the support channel listed on the AWS Marketplace listing.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on AWS
Launch Apache Answer on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com