Apache Lounge


About Forum Index Downloads Search Register Log in RSS X

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Getting 404 error for apache `/server-status`

Joined: 20 Jan 2024
Posts: 2

PostPosted: Sat 20 Jan '24 16:03    Post subject: Getting 404 error for apache `/server-status` Reply with quote

I was told that there's a way to enable a url called `http://<your host>/server-status` and that this page would show you some operational metrics of the apache service. But every time I visit that url, I get 404 page not found. Here's how I set things up:

1. Start a new virtual machine in my office network. The local ip address of this machine is ``. The machine uses Ubuntu 22.04.
2. I run `apt-get update && apt dist-upgrade -y && apt-get install -y apache2`. This causes Apache 2.4.52 to be installed.
3. The Windows computer I work from has the local ip address of ``. From this computer, I type `` and I can see the Apache default web page.
4. ON the machine of ``, I type `a2enmod rewrite && a2enmod status`.
5. I provide the following files

`// /etc/apache2/apache2.conf`
DefaultRuntimeDir ${APACHE_RUN_DIR}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied

Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
<Directory /usr/share>
AllowOverride None
Require all granted
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf


`/etc/apache2/mods-available/status.conf && /etc/apache2/mods-enabled/status.conf`

<IfModule mod_status.c>
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Uncomment and change the "" to allow access from other hosts.

<Location /server-status>
SetHandler server-status
Require local
Require ip
Require ip

# Keep track of extended status information for each request
ExtendedStatus On

# Determine if mod_status displays the first 63 characters of a request or
# the last 63, assuming the request itself is greater than 63 chars.
# Default: Off
#SeeRequestTail On

<IfModule mod_proxy.c>
# Show Proxy LoadBalancer status in mod_status
ProxyStatus On


# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Then I do a `systemctl restart apache2`.

When my `` computer loads up `` via google chrome browser, I get 404.

When I run the command `wget` from the shell of ``, I get 404.

When I run the command `wget` from the shell of ``, I get 404.

When I run the command `wget http://localhost/server-status` from the shell of ``, I get 404.

What am I doing wrong?
Back to top

Joined: 16 Aug 2020
Posts: 333
Location: UK

PostPosted: Sun 21 Jan '24 20:26    Post subject: Reply with quote

The fact you're getting a 404 (rather than a 403), suggests your server-status configuration isn't enabled. You've listed your configuration file, but is the mod_status module being loaded? i.e.
user@host:~$ more /etc/apache2/mods-available/status.load
LoadModule status_module /usr/lib/apache2/modules/mod_status.so

user@host:~$ ls -l /etc/apache2/mods-enabled/status.load
lrwxrwxrwx 1 root root 29 Sep 27  2021 /etc/apache2/mods-enabled/status.load -> ../mods-available/status.load

Beyond that, the "Require local" directive constrains requests to a local host IP or the loopback interface. With your listed configuration, this works for me.
user@host:~$ wget
--2024-01-21 18:18:26--
Connecting to connected.
HTTP request sent, awaiting response... 200 OK
Length: 5481 (5.4K) [text/html]
Saving to: ‘server-status’

server-status            100%[=================================>]   5.35K  --.-KB/s    in 0s     

2024-01-21 18:18:26 (1011 MB/s) - ‘server-status’ saved [5481/5481]

Once you've got it working, if you want to allow access from remote hosts, you'll need to remove the "Require local" directive.
Back to top

Joined: 20 Jan 2024
Posts: 2

PostPosted: Tue 23 Jan '24 4:14    Post subject: Reply with quote

Ok, for whatever reason, i can actually see the `` page now from the localhost and from ``.

All I did was turn off the machine on Saturday. And today, when I turned it on, things are magically working.

on Saturday, I did do things like `systemctl restart apache2`, reboot the machine, etc... But now, on Monday, it decided to work...
Back to top

Reply to topic   Topic: Getting 404 error for apache `/server-status` View previous topic :: View next topic
Post new topic   Forum Index -> Apache