how to show an error message when server is down

how to show an error message when server is down

hi
i wanted to know if its possible to show an error message or load a custom error page when the server is down or not running and the user requests some service on the web page.

i am also using reverse ajax, can the same task be done using this?