Report this

What is the reason for this report?

Unable to get /server-status mod working with Apache2 on Ubuntu

Posted on April 13, 2015

I have installed the default WordPress application image from digital ocean. I tried to follow this tutorial but it doesn’t work for me:

https://www.digitalocean.com/community/tutorials/how-to-install-configure-and-use-modules-in-the-apache-web-server

If I visit http://<my IP>/server-status I get a 404 page the one and only website I have installed on this server. If I visit http://www.domain.com/service-status I get this:

403
Forbidden

You don't have permission to access /server-status on this server.

How can I get this working?

If I try to visit it from lynx from the local host in the terminal whether I use domain name, IP or 127.0.0.1 or localhost I get 404 not found (weird!).



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

What fixes this issue is a mix of settings. At least for myself, and my server.

First in your apache virtualhost configuration you need to change allow overides

<Directory Some/directory/here > # Options Indexes Options -FollowSymLinks Options -Multiviews Options -Indexes AllowOverride None </Directory>

Then before the closing virtualhosts command you place this

<Location /server-status> SetHandler server-status # Require local Require ip YOUR IP here/Server IP </Location> </VirtualHost>

Then IF you have the defualt apache2 config modified to your liking with other settings. Like a custom Wordpress installation. You should have this as well for .HTACCESS

The important line is this RewriteCond %{REQUEST_URI} !=/server-status

.HTACCESS file settings

BEGIN WordPress

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/server-status RewriteRule . /index.php [L] </IfModule> php_flag register_globals off

END WordPress

php_flag display_errors Off #Options FollowSymLinks Options -Indexes Options -ExecCGI Options -IncludesNOEXEC

Hope my post solves some other issues,

Thanks for the reply. Adding this rewrite rule only makes it so www.mydomain.com/server-status is a “Forbidden” error instead of a 404.

This is what my /etc/apache2/mods-available/status.conf file says (I had already edited it):

        <Location /server-status>
                SetHandler server-status
                Order deny,allow
                Deny from all
                Allow from 127.0.0.1 ::1
                Allow from <my public IP>
        </Location>

I am trying to access it form the local host but I am still getting this forbidden error. Any other ideas?

Thanks.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.