Use a suitable test server
Follow this guide on a fresh server or one you control that does not already host a website. You need an account with sudo privileges and working package repositories. Check for an existing listener on TCP port 80 before installing anything. If another service already owns the port, investigate that service first.
Ubuntu 24.04 LTS calls the package and service apache2. AlmaLinux 9 calls them httpd. Both installations can serve a simple file from /var/www/html. Choose the command block for your distribution; do not run both.
sudo ss -lntp 'sport = :80'Install and start Apache
Refresh Ubuntu's package index before installing. On AlmaLinux, DNF resolves the requested packages through its configured repositories. Installing curl gives you a convenient command-line HTTP test. Package installation may start the Ubuntu service automatically; the enable command also ensures it starts on subsequent boots.
Validate the supplied Apache configuration and confirm that the service is active. A syntax check reports configuration problems, while the service state establishes whether the process actually started.
sudo apt update
sudo apt install apache2 curl
sudo apache2ctl configtest
sudo systemctl enable --now apache2
systemctl is-active apache2sudo dnf install httpd curl
sudo httpd -t
sudo systemctl enable --now httpd
systemctl is-active httpdPublish a separate test page
Create a small HTML file without replacing the existing index page. The command below uses shell noclobber mode, so it fails if glws-check.html already exists. If that happens, choose a different filename and use that name in the later URL.
On AlmaLinux, restore the expected SELinux label after creating the file. Keep SELinux enabled. Files under the standard web directory should use the policy's web-content context; moving content from another directory can carry an unsuitable label.
sudo sh -c 'set -C; printf "%s\n" "<!doctype html><title>Apache test</title><h1>Apache is ready</h1>" > /var/www/html/glws-check.html'
sudo chmod 644 /var/www/html/glws-check.htmlsudo restorecon -v /var/www/html/glws-check.htmlVerify locally, then externally
Request the test file using the loopback address. You should receive HTTP 200 and the HTML you created. Next, visit the same path using the server's public address from another device. A successful local request with a failed external request points toward routing or firewall access rather than the page itself.
If a firewall is already active, permit TCP 80 in its correct zone or rule set while retaining all existing access rules, including your actual SSH port. Provider firewalls may require a separate rule. Avoid enabling or resetting a firewall as part of this first web test.
curl --fail --include http://127.0.0.1/glws-check.htmlHTTP/1.1 200 OK
Server: Apache/2.4.58 (Ubuntu)
Content-Type: text/html
<!doctype html><title>Apache test</title><h1>Apache is ready</h1>
<!doctype html><title>Apache test</title><h1>Apache is ready</h1>
Apache test page verifiedInspect failures and plan the next step
For a failed start, inspect the relevant service journal. A 404 suggests a path or filename mismatch; a 403 suggests access restrictions, permissions, or policy. This establishes basic HTTP only. Before hosting user accounts or handling sensitive information, configure your domain and HTTPS, then test those separately.
sudo journalctl -u apache2 -n 30 --no-pagersudo journalctl -u httpd -n 30 --no-pagerOfficial documentation
These upstream references provide more detail on the commands and workflows in this guide.