Deployment guide

Apache Sling 14

Overview

Apache Sling is an open source framework from the Apache Software Foundation for building content-centric web applications on top of a Java Content Repository (JCR). It pairs an Apache Felix OSGi runtime with a Jackrabbit Oak content store, so HTTP requests map directly onto repository resources. It powers content management systems, web platforms and RESTful content services.

This guide covers deploying and configuring Apache Sling 14 on Ubuntu 24.04 on Azure from the SecureAnyCloud Azure Marketplace image. The image runs the official Apache Sling Starter 14 distribution as a single Java process on OpenJDK 21. The Apache Sling Feature Model Launcher starts it from the self-contained oak_tar feature archive, which is verified against a sha256 checksum at build time. The image ships a browsable web UI: the Sling welcome page, the Apache Felix Web Console for managing the OSGi runtime, and the Composum content browser for exploring the JCR repository.

What you get:

  • Apache Sling Starter 14 (org.apache.sling.starter, Apache-2.0), launched by the Apache Sling Feature Model Launcher 1.3.6, both sha256-pinned
  • OpenJDK 21 JRE headless (the Temurin 21 baseline that the upstream project ships on)
  • The apache-sling.service systemd unit, which starts on boot and runs as the unprivileged sling:sling system user
  • The apache-sling-firstboot.service systemd oneshot, which generates a per-VM administrator password, resets the default admin/admin, and confirms the console before it completes
  • An HTTP connector bound to loopback only (127.0.0.1:8080), fronted by nginx on :80
  • An unauthenticated /healthz endpoint (served by nginx, HTTP 200) for load balancer and probe checks
  • The Sling welcome page, the Apache Felix Web Console (/system/console) and the Composum content browser (/bin/browser.html), a clickable admin UI
  • The Feature Launcher home and the Jackrabbit Oak content repository on a dedicated 20 GiB Azure data disk mounted at /var/lib/sling, so repository content survives independently of the OS disk
  • An Ubuntu 24.04 LTS base with the latest security patches applied at build time and unattended security updates enabled
  • The Azure Linux Agent, for cloud integration and SSH key injection
  • 24/7 SecureAnyCloud support with a guaranteed 24 hour response SLA

Architecture

Apache Sling listens on 127.0.0.1:8080 only. It is never exposed directly to the network. nginx terminates :80 and reverse proxies to the loopback connector, and the Azure Network Security Group opens only ports 22, 80 and 443. This keeps the OSGi Web Console and the content repository off the public interface and behind a single, auditable nginx front door.

1

Deploy the image

Launch the Apache Sling 14 on Ubuntu 24.04 LTS by SecureAnyCloud image from the Azure Marketplace on a Standard_B2s (or larger) VM. Open inbound ports 22 (SSH), 80 (HTTP) and 443 (HTTPS) in the Network Security Group. The image provisions the 20 GiB data disk that carries the content repository automatically.

When the VM is running, connect over SSH as azureuser with the SSH key you selected at launch:

ssh azureuser@<public-ip>
2

Confirm the services are running

Apache Sling and nginx start automatically on boot. Confirm both are active:

systemctl is-active apache-sling.service nginx.service

Both commands print active. For the full status view, run:

systemctl --no-pager status apache-sling.service nginx.service
3

Retrieve the per-VM administrator password

There is no default login. On first boot, the image generates a unique administrator password, resets Sling's built-in admin account to it, and writes the details to a root-only file. Read the file with:

sudo cat /var/lib/sac/secrets/sac-credentials.txt

The file shows the Sling URL, the console URL, the admin user (admin) and the generated SLING_ADMIN_PASSWORD.

4

Open the Sling welcome page

Open the VM's public address in a browser:

http://<public-ip>/

Sling redirects to its welcome page. The page introduces the Starter and links to the content browser, the System Console and the API documentation.

You can also verify the front door from the shell without a browser. The nginx health endpoint returns 200:

curl -s -o /dev/null -w '%{http_code}\n' http://localhost/healthz
5

Sign in to the Apache Felix Web Console

You manage the OSGi runtime through the Apache Felix Web Console at /system/console. Sign in with admin and the password from Step 3. The Bundles view lists every OSGi bundle and its state. A healthy Starter reports all bundles active.

You can confirm the same thing from the shell. Replace <SLING_ADMIN_PASSWORD> with the value from Step 3:

curl -s -u "admin:<SLING_ADMIN_PASSWORD>" http://localhost/system/console/bundles.json \
  | python3 -c "import sys, json; print(json.load(sys.stdin)['status'])"

The response prints a summary such as Bundle information: 234 bundles in total - all 234 bundles active.

6

Manage OSGi configuration

The Configuration view (/system/console/configMgr) lists every configurable OSGi service and lets you edit its settings at runtime. Use it to tune Sling's HTTP service, authentication, resource resolver and your own components without restarting the framework.

7

Browse the content repository

Content in Sling lives in a Jackrabbit Oak JCR repository. The bundled Composum browser at /bin/browser.html gives you a tree view of the repository, including apps, conf, content and libs. You can inspect and edit nodes and properties directly.

Sling's Post Servlet also lets you create content over plain HTTP. For example, create a node from the shell. Replace <SLING_ADMIN_PASSWORD> with your password:

curl -s -u "admin:<SLING_ADMIN_PASSWORD>" -F "message=hello from sac" http://localhost/content/sac-demo/

Then read it back as JSON:

curl -s -u "admin:<SLING_ADMIN_PASSWORD>" http://localhost/content/sac-demo.json
8

Where the data lives

The content repository and the Feature Launcher runtime live under /var/lib/sling on the dedicated 20 GiB Azure data disk. They persist independently of the OS disk, and you can resize the volume on its own:

df -h /var/lib/sling

Managing the service

Apache Sling is a standard systemd service. Restart it and view its recent logs with:

sudo systemctl restart apache-sling.service
sudo journalctl -u apache-sling.service -n 50 --no-pager

Stop the service with sudo systemctl stop apache-sling.service and start it again with sudo systemctl start apache-sling.service. Sling's own logs are under /var/lib/sling/launcher/logs/ (for example error.log).

Security notes

  • No default credential ships in the image. The image neutralizes the upstream admin/admin default at build time, and first boot generates a unique administrator password before nginx exposes port 80.
  • Loopback binding. Sling listens only on 127.0.0.1:8080. nginx is the single network-facing front door on :80.
  • Change the administrator password to one you control after your first login, either in the Web Console or with the Sling user management API:
curl -s -u "admin:<SLING_ADMIN_PASSWORD>" \
  -F oldPwd="<SLING_ADMIN_PASSWORD>" -F newPwd="<new-password>" -F newPwdConfirm="<new-password>" \
  http://localhost/system/userManager/user/admin.changePassword.html
  • Keep the VM patched. Ubuntu unattended security upgrades are enabled by default.
  • Put Sling behind HTTPS, with TLS terminated at nginx or an Azure load balancer, before you serve production traffic.

Troubleshooting

  • The welcome page does not load. Confirm that systemctl is-active apache-sling.service nginx.service reports active for both, and that the NSG allows inbound port 80.
  • The console login is rejected. Re-read the password with sudo cat /var/lib/sac/secrets/sac-credentials.txt. The password is generated per VM and is not admin.
  • Sling is slow to answer right after boot. The OSGi framework needs a few seconds to bring all bundles to the active state on first start. curl http://localhost/system/console/bundles.json shows progress.

Support

SecureAnyCloud images include 24/7 support with a guaranteed 24 hour response SLA. Contact sales@secureanycloud.com for assistance.

Deploy on Azure

Launch Apache Sling 14 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