APACHE/2.4 MACOS M4 MOD_STATUS PORT 80 / 8080

Enable mod_status Apache · MacBook Air M4 · Built-in & Homebrew

sudo apachectl graceful && open http://localhost/server-status
What is mod_status?

A built-in Apache module that exposes a real-time dashboard of server activity — worker threads, requests/sec, CPU load, uptime, and per-connection details. Essential for monitoring and tuning.

Default URL after setup
http://localhost/server-status http://localhost/server-status?auto (plain text) http://localhost/server-status?refresh=5 (auto-refresh)
01

Built-in macOS Apache (/etc/apache2)

The built-in Apache config lives at /etc/apache2/httpd.conf. All edits require sudo. Follow these steps exactly — each one must be done before restarting.

💡

Back up your config first: sudo cp /etc/apache2/httpd.conf /etc/apache2/httpd.conf.bak

Step 1 — Uncomment the LoadModule Line

Open httpd.conf and find the mod_status line. Remove the leading # to enable it.

Terminal — open config
sudo nano /etc/apache2/httpd.conf
httpd.conf — find and uncomment this line
# BEFORE (commented out — module disabled):
#LoadModule status_module libexec/apache2/mod_status.so

# AFTER (remove the # — module enabled):
LoadModule status_module libexec/apache2/mod_status.so
ℹ️

In nano: use Ctrl+W to search for mod_status, then delete the # at the start of the matching LoadModule line. Press Ctrl+O to save, Ctrl+X to exit.

Step 2 — Add the <Location> Block

Scroll to the bottom of httpd.conf and add this block. It defines the /server-status URL and restricts access to localhost only — critical for security.

httpd.conf — add at the bottom
# ── mod_status configuration ──────────────────────────
<Location "/server-status">
    SetHandler  server-status

    # Restrict to localhost ONLY — never expose on public IP
    Require     local

    # Alternative syntax if "Require local" doesn't work:
    # Require ip 127.0.0.1 ::1
</Location>

# Enable extended status (per-request details)
ExtendedStatus On

Step 3 — Test Config & Restart

Terminal
# Check for syntax errors first
sudo apachectl configtest
# Must say "Syntax OK" before continuing

# Graceful restart (applies changes, no dropped connections)
sudo apachectl graceful

Step 4 — Verify in Browser

Terminal — open in browser
open http://localhost/server-status

You should see the Apache Status page with server version, uptime, request counters, and a worker scoreboard. If you get a 403 or 404, see the Troubleshooting section below.

02

Homebrew Apache (/opt/homebrew/etc/httpd)

If you installed Apache via Homebrew (brew install httpd), the config is at a different path and runs on port 8080 by default. The steps are the same — only paths and ports differ.

Step 1 — Open Homebrew httpd.conf

Terminal
nano /opt/homebrew/etc/httpd/httpd.conf
# No sudo needed for Homebrew config

Step 2 — Uncomment the LoadModule Line

httpd.conf (Homebrew) — uncomment
# BEFORE:
#LoadModule status_module lib/httpd/modules/mod_status.so

# AFTER (remove the #):
LoadModule status_module lib/httpd/modules/mod_status.so

Step 3 — Add the <Location> Block

httpd.conf (Homebrew) — add at bottom
# ── mod_status configuration ──────────────────────────
<Location "/server-status">
    SetHandler  server-status
    Require     local
</Location>

ExtendedStatus On

Step 4 — Test & Restart

Terminal
/opt/homebrew/bin/apachectl configtest
brew services restart httpd

Step 5 — Verify (note port 8080)

Terminal
open http://localhost:8080/server-status
03

Reading the server-status Page

Here's what the key fields on the status page mean:

Apache Status — localhost/server-status ● LIVE
Apache Server Status for localhost

Server Version: Apache/2.4.x (macOS)
Server MPM: prefork / event
Uptime: 2 hours 14 minutes
Total Accesses: 1,482
CPU Usage: u0.14 s0.03 cu0 cs0 — .00237% CPU load
Requests/sec: 0.184
Bytes/sec: 1.22 kB/s

Worker Scoreboard
_
Waiting
W
Sending
R
Reading
K
Keepalive
C
Closing
L
Logging
G
Graceful
I
Idle cleanup
.
Open slot

Useful URL Parameters

URLWhat It Does
/server-statusFull HTML status page
/server-status?autoMachine-readable plain text output (great for scripts)
/server-status?refresh=5Auto-refresh the page every 5 seconds
/server-status?notableHTML page without the per-worker table (faster to load)
04

Security — Lock It Down

⚠️

Never expose /server-status on a public IP. The status page reveals your server internals, active request paths, and client IPs. Always restrict access to localhost or a trusted IP range.

Restrict to localhost only (recommended)

httpd.conf — safest option
<Location "/server-status">
    SetHandler server-status
    Require    local
    # "Require local" = 127.0.0.1 and ::1 only
</Location>

Allow your whole local network (e.g. for team use)

httpd.conf — local network range
<Location "/server-status">
    SetHandler server-status
    Require    ip 127.0.0.1 ::1 192.168.1.0/24
    # Replace 192.168.1.0/24 with your actual LAN subnet
</Location>

Find your local subnet

Terminal
# Your local IP (replace en0 with en1 for Ethernet if needed)
ipconfig getifaddr en0
05

Troubleshooting

ProblemCause & Fix
403 Forbidden Access control too strict. Make sure Require local is inside the <Location> block and you're accessing from localhost or 127.0.0.1.
404 Not Found The <Location> block is missing or misspelled in httpd.conf. Double-check the block was saved and Apache was restarted.
500 Internal Server Error The LoadModule line is still commented out. Run httpd -M | grep status to confirm the module loaded.
No scoreboard / limited info ExtendedStatus On is missing. Add it outside any <Location> block in httpd.conf.
Syntax Error on restart Run sudo apachectl configtest and read the output. It will name the exact line number of the error.

Confirm the Module Loaded

Terminal — verify module is active
# Built-in Apache:
httpd -M | grep status
# Expected: status_module (shared)

# Homebrew Apache:
/opt/homebrew/bin/httpd -M | grep status

Check Error Log for Details

Terminal
# Built-in Apache error log:
tail -f /private/var/log/apache2/error_log

# Homebrew Apache error log:
tail -f /opt/homebrew/var/log/httpd/error_log

Quick Reference — Path Differences

ItemBuilt-in macOSHomebrew
Config file/etc/apache2/httpd.conf/opt/homebrew/etc/httpd/httpd.conf
Module pathlibexec/apache2/mod_status.solib/httpd/modules/mod_status.so
Default port808080
Error log/private/var/log/apache2/error_log/opt/homebrew/var/log/httpd/error_log
Restart commandsudo apachectl gracefulbrew services restart httpd
Status URLhttp://localhost/server-statushttp://localhost:8080/server-status