You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joe Muller <jm...@ARCcorp.com> on 2016/11/04 08:01:08 UTC

[users@httpd] Error page server in Apache ?

Hi All,

 We currently have an old legacy Java application running under Sun Webservers that does the following.  It's purpose is to display an error message if a particular webserver is down.   The request is forwarded to the application from the load balancer when the load balancer detects the webserver is down.

1) Receives a request 

2) Looks at the request URL (i.e. app1.domain.com, app2.domain.com, app3.domain.com )

3) Display a file from a directory based on the URL, i.e. /usr/local/apache2/htdocs/error/app1.domain.com/site_down.html

Is it possible to implement the above in Apache 2.4 using rewrite rules ?

Thanks,

-Joe


Re: [users@httpd] Error page server in Apache ?

Posted by Daniel <df...@gmail.com>.
Yes, definetly.

there is a variable called %{HTTP_HOST} which will be the hostname in the
request.

And you can use that variable for example in mod_rewrite, and mod_rewrite
can perfectly point to local filesystem paths too.

2016-11-04 9:01 GMT+01:00 Joe Muller <jm...@arccorp.com>:

> Hi All,
>
>  We currently have an old legacy Java application running under Sun
> Webservers that does the following.  It's purpose is to display an error
> message if a particular webserver is down.   The request is forwarded to
> the application from the load balancer when the load balancer detects the
> webserver is down.
>
> 1) Receives a request
>
> 2) Looks at the request URL (i.e. app1.domain.com, app2.domain.com,
> app3.domain.com )
>
> 3) Display a file from a directory based on the URL, i.e.
> /usr/local/apache2/htdocs/error/app1.domain.com/site_down.html
>
> Is it possible to implement the above in Apache 2.4 using rewrite rules ?
>
> Thanks,
>
> -Joe
>
>


-- 
*Daniel Ferradal*
IT Specialist

email         dferradal at gmail.com
linkedin     es.linkedin.com/in/danielferradal