简体   繁体   English

laravel 和 apache mod_status

[英]laravel and apache mod_status

I have enabled Apache mod_status on my server:我在我的服务器上启用了 Apache mod_status:

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?我收到example.com/server-status的 404 错误页面,因为我不知道如何使用 laravel(5.2) 路由 api 或任何其他方式提供此路由?
my configuration in httpd.conf:我在 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并在 .htaccess 中

RewriteCond %{REQUEST_URI} !=/server-status

I use the following code on my .htaccess to server-info and server-status:我在我的 .htaccess 上使用以下代码来访问 server-info 和 server-status:

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

Make sure first you get server-info and server-status working.首先确保您获得 server-info 和 server-status 工作。 Them, read the logs about permission issues (mostly are because of order from rules).他们,阅读有关权限问题的日志(主要是因为规则的顺序)。

My system:我的系统:

  • Laravel 6 Laravel 6
  • Apache 2.4.1阿帕奇 2.4.1
  • FreeBSD 12.1 FreeBSD 12.1

Try placing it inside the virtualhost tag尝试将其放在 virtualhost 标签内

<VirtualHost *:80>
ServerAdmin tecmint@example.com
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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM