I am using Linux in Azure ( Ubuntu 16.04.06 LTS ) and I am trying to enable Apache status. However, after I enable the status module, when I go to http://localhost/server-status I get an error
$ wget http://localhost/server-status/
–2020-02-27 20:58:26– http://localhost/server-status/ Resolving localhost (localhost)… 127.0.0.1 Connecting to localhost
(localhost)|127.0.0.1|:80… connected. HTTP request sent, awaiting
response… 500 Internal Server Error 2020-02-27 20:58:26 ERROR 500:
Internal Server Error.
When I look at the apache error.log I get a message about too many internal redirects
[Thu Feb 27 20:58:26.451285 2020] [core:error] [pid 86787] [client
127.0.0.1:51734] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use
'LimitInternalRecursion' to increase the limit if necessary. Use
'LogLevel debug' to get a backtrace.
I used the standard command : sudo a2enmod status to enable the service and then rebooted apache. I am also using the default config file:
—- status.conf —
<IfModule mod_status.c>
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
<Location /server-status>
SetHandler server-status
#Require ip 192.0.2.0/24
Require local
</Location>
# Keep track of extended status information for each request
ExtendedStatus On
<IfModule mod_proxy.c>
# Show Proxy LoadBalancer status in mod_status
ProxyStatus On
</IfModule>
</IfModule>
—- status.conf —
I do have a redirect in place for all http traffic, but there is an exception for local host traffic.
— default.conf —
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
RewriteEngine On
RewriteCond %{HTTP_HOST} !^localhost [NC]
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
— default.conf —
I know the above config is not redirecting to https, I have tested this without the exception and I get a completely different message telling me the secure certificate doesn't match.
There is an .htaccess file in the default directory, but it looks pretty clean
— .htaccess —
RewriteEngine on \n
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
RewriteCond %{REQUEST_URI} ^/favicon.ico$
Options -Indexes
<Files deploy>
Order allow,deny
deny from all
</Files>
— .htaccess —
Does anyone have any experience with this functionality in Azure? Is this still something in configuration that I am missing? Or does this simply not work in Azure due to some other configuration issue? like could this be an Azure networking issue?
I appreciate any help.
Cheers,
– GaryC – UnKulMunki –
Best Answer
I found the answer.
The default host exists in /var/www/html ... In that directory is the webapp code, and it's .htaccess file...
However in the parent directory ( /var/www/ ) is ANOTHER .htaccess file that was overloading the instructions from the subdirectory .htaccess file....
I added an exception for localhost and server-status works now!
Thanks... Gary C