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.
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
Open httpd.conf and find the mod_status line. Remove the leading # to enable it.
sudo nano /etc/apache2/httpd.conf
# 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.
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.
# ── 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
# Check for syntax errors first sudo apachectl configtest # Must say "Syntax OK" before continuing # Graceful restart (applies changes, no dropped connections) sudo apachectl graceful
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.
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.
nano /opt/homebrew/etc/httpd/httpd.conf # No sudo needed for Homebrew config
# BEFORE: #LoadModule status_module lib/httpd/modules/mod_status.so # AFTER (remove the #): LoadModule status_module lib/httpd/modules/mod_status.so
# ── mod_status configuration ────────────────────────── <Location "/server-status"> SetHandler server-status Require local </Location> ExtendedStatus On
/opt/homebrew/bin/apachectl configtest brew services restart httpd
open http://localhost:8080/server-status
Here's what the key fields on the status page mean:
| URL | What It Does |
|---|---|
/server-status | Full HTML status page |
/server-status?auto | Machine-readable plain text output (great for scripts) |
/server-status?refresh=5 | Auto-refresh the page every 5 seconds |
/server-status?notable | HTML page without the per-worker table (faster to load) |
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.
<Location "/server-status"> SetHandler server-status Require local # "Require local" = 127.0.0.1 and ::1 only </Location>
<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>
# Your local IP (replace en0 with en1 for Ethernet if needed) ipconfig getifaddr en0
| Problem | Cause & 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. |
# Built-in Apache: httpd -M | grep status # Expected: status_module (shared) # Homebrew Apache: /opt/homebrew/bin/httpd -M | grep status
# 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
| Item | Built-in macOS | Homebrew |
|---|---|---|
| Config file | /etc/apache2/httpd.conf | /opt/homebrew/etc/httpd/httpd.conf |
| Module path | libexec/apache2/mod_status.so | lib/httpd/modules/mod_status.so |
| Default port | 80 | 8080 |
| Error log | /private/var/log/apache2/error_log | /opt/homebrew/var/log/httpd/error_log |
| Restart command | sudo apachectl graceful | brew services restart httpd |
| Status URL | http://localhost/server-status | http://localhost:8080/server-status |