httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Geilman <jer...@adaptr.nl>
Subject Re: [users@httpd] Monit on vhost
Date Thu, 21 Jul 2011 18:54:54 GMT
On 2011-07-21 17:28, Josu Lazkano wrote:
>
> Hello list, I am trying to configure a server with lots of vhost.
>
> I need to check if they are online with Monit, for this, I just create 
> this on each vhost:
>
>         Alias /monit/ /var/www/monit/
>
> <Directory "/var/www/monit/">
>
>                 Options Indexes MultiViews FollowSymLinks
>
>                 AllowOverride None
>
>                 Order deny,allow
>
>                 Deny from all
>
>                 Allow from all
>
> </Directory>
>
> So, I just add on the Monit lines like this:
>
>    #domain1
>
>    if failed host domain1.com port 80 protocol http and request 
> "/monit/token" then alert
>
>    if failed host www.domain1s.com port 80 protocol http and request 
> "/monit/token" then alert
>
>    #domain2
>
>    if failed host domain2.com port 80 protocol http and request 
> "/monit/token" then alert
>
>    if failed host www.domain2.com port 80 protocol http and request 
> "/monit/token" then alert
>
> There is a "token" file on /var/www/monit/ so, if Monit can not get 
> this file it send an alert.
>
> The Monit service is on localhost, so I just want to get access to 
> this directory just localhost.
>
> How could I do that?
>

By not allowing from All, obviously.

You could also simplify the shit out of this by defining the directory 
and alias ONCE, outside any vhost.

And alias only /monit/token, since that is apparently all that is requested.

-- 
J.


Mime
View raw message