1
votes

I have enabled Apache mod_status on my server:

OS: centos 6
Server version: Apache/2.2.15 (Unix)
php version 7.1

I get a 404 error page for example.com/server-status as i dont know how can i serv this route, with laravel(5.2) route api or any other way?
my configuration in httpd.conf:

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1 ::1
    Allow from .example.com
    Allow from xxx.xxx.xxx.xxx #my ip address
</Location>

and in .htaccess

RewriteCond %{REQUEST_URI} !=/server-status
2
seems you need to modify the url rewrite on public directory. your 404 gives laravel 404 right? - Bagus Tesa
apparently, you need to remove the = on RewriteCond %{REQUEST_URI} !=/server-status. and put it before line 20. see example - Bagus Tesa
@BagusTesa thanks alot, you saved my day with provided htaccess test tools. you can post it as an answer and i will accept it - osyan
your welcome. glad be of help~ - Bagus Tesa

2 Answers

2
votes

I use the following code on my .htaccess to server-info and server-status:

RewriteRule ^(server-info|server-status) - [L]

Make sure first you get server-info and server-status working. Them, read the logs about permission issues (mostly are because of order from rules).

My system:

  • Laravel 6
  • Apache 2.4.1
  • FreeBSD 12.1
0
votes

Try placing it inside the virtualhost tag

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/example.com
ServerName example.com
ErrorLog logs/example.com-error_log
CustomLog logs/example.com-access_log common
<Location /server-status>
SetHandler server-status
Order allow,deny
Deny from all
Allow from example.com 
</Location>
</VirtualHost>