Re: Custom Error page when Tomcat is down?
On 7/24/06, Eric B. <[EMAIL PROTECTED]> wrote: > If Apache is generating an "internal server error" as you indicated, it > should be returning a 5xx status, I'd think. I'd think so too. But I put in ErrorDocument 500 directives, and got nothing out of it. OK, simplest test: I took a standalone Apache 2.0.52, put a text-string ErrorDocument 500 "Stimpy, you eediot" into httpd.conf, forced a server error with a CGI script, and got my test string returned with status 500. So I would try to get that configured properly first, outside of your mod_jk stuff, and go on from there. -- Hassan Schroeder [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Subject: Re: Custom Error page when Tomcat is down?
If you are using Apache to Tomcat try using mod_security module to accomplish this. Mod security has setting for hiding the server error output: http://www.modsecurity.org/documentation/modsecurity-apache/1.9.3/modsecurity-manual.html#N1057D as well as purposly missrepresenting the Apache (like show IIS instead of Apache). http://www.modsecurity.org/documentation/modsecurity-apache/1.9.3/modsecurity-manual.html#N108B5 On 7/24/06, Eric B. <[EMAIL PROTECTED]> wrote: Thanks for the pointer, but the problem that I see is that Apache is returning the status code 200 to the browser. If Apache is generating an "internal server error" as you indicated, it should be returning a 5xx status, I'd think. I'd think so too. But I put in ErrorDocument 500 directives, and got nothing out of it. In fact, I even went one step further and put in ErrorDocument directives for error codes 500-510 (just in case I was missing something) and none made a difference. I tried putting them in the main body of the httpd.conf file (to ensure I wasn't having problems with VirtualHosts, etc), but still nothing. -- Thank you, Edmon Begoli http://blogs.ittoolbox.com/eai/software
Re: Custom Error page when Tomcat is down?
"Hassan Schroeder" <[EMAIL PROTECTED]> wrote in message > On 7/24/06, Eric B. <[EMAIL PROTECTED]> wrote: > >> Thanks for the pointer, but the problem that I see is that Apache is >> returning the status code 200 to the browser. > > If Apache is generating an "internal server error" as you indicated, it > should be returning a 5xx status, I'd think. > I'd think so too. But I put in ErrorDocument 500 directives, and got nothing out of it. In fact, I even went one step further and put in ErrorDocument directives for error codes 500-510 (just in case I was missing something) and none made a difference. I tried putting them in the main body of the httpd.conf file (to ensure I wasn't having problems with VirtualHosts, etc), but still nothing. ErrorDocument 500 "Site down 500" ErrorDocument 501 "Site down 501" ErrorDocument 502 "Site down 503" ErrorDocument 503 "Site down 504" ErrorDocument 504 "Site down 504" ErrorDocument 505 "Site down 505" ErrorDocument 506 "Site down 506" ErrorDocument 507 "Site down 507" ErrorDocument 508 "Site down 508" ErrorDocument 509 "Site down 509" ErrorDocument 510 "Site down 510" ErrorDocument 404 "Site down 404" The only one that seemed to make a difference was ErrorDocument 404 (when tested againsta a non-tomcat path). Am I doing something wrong here? Thanks, Eric - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom Error page when Tomcat is down?
Eric, > I've been scouring the docs & newsgroups for the last hour or so, and have > been unable to find a solution to my problem. Currently, I have tomcat > being access through the Apache httpd server, configured via the jk_mod > connector/module. I have the same setup, and just use "ErrorDocument 500" for a particular URL space and send the user to the "down" page, like this: ErrorDocument 403 forbidden.html ErrorDocument 404 not_found.html ErrorDocument 500 down.html # This one means 'servlet unavailable' ErrorDocument 503 down.html Yes, Tomcat /can/ issue a "500" error code, but I have that caught in Tomcat and the user is sent to an error page (and the status code returned is 200, even for an error). In this case, Apache never inadvertently sends a user to the "down" page when Tomcat /is/ running, but encounters an error. Hope that helps. -chris signature.asc Description: OpenPGP digital signature
Re: Custom Error page when Tomcat is down?
On 7/24/06, Eric B. <[EMAIL PROTECTED]> wrote: Thanks for the pointer, but the problem that I see is that Apache is returning the status code 200 to the browser. If Apache is generating an "internal server error" as you indicated, it should be returning a 5xx status, I'd think. -- Hassan Schroeder [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom Error page when Tomcat is down?
"Hassan Schroeder" <[EMAIL PROTECTED]> wrote in message > >> Is there any way I can customize that error page to say/show something >> different? > > See the Apache doc for "ErrorDocument" Thanks for the pointer, but the problem that I see is that Apache is returning the status code 200 to the browser. Obviously I can't put an ErrorDOcument directive on status 200, or none of the pages would work. Should I be looking at some other status code instead? Thanks, Eric - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom Error page when Tomcat is down?
On 7/24/06, Eric B. <[EMAIL PROTECTED]> wrote: Is there any way I can customize that error page to say/show something different? See the Apache doc for "ErrorDocument" -- Hassan Schroeder [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Custom Error page when Tomcat is down?
Hi, I've been scouring the docs & newsgroups for the last hour or so, and have been unable to find a solution to my problem. Currently, I have tomcat being access through the Apache httpd server, configured via the jk_mod connector/module. My problem is I have to sometimes stop the tomcat server for general maintenance. When this happens, Apache will show an error page "The server encountered an internal error or misconfiguration and was unable to complete your request. ", because the jkWorker is no longer able to access the Tomcat server. Is there any way I can customize that error page to say/show something different? My workers file is pretty simple: JkWorkerProperty worker.host=localhost JkWorkerProperty worker.type=ajp13 JkWorkerProperty worker.list=jkWorker1 JkWorkerProperty worker.jkWorker1=8010 Then the httpd.conf file has the following: ServerName www.mydomain.com DocumentRoot "/var/www/html" JkMount /test/* jkWorker1 So if I ever try to access www.mydomain.com/test when tomcat is down, I get that general "server encountered internal error" error page. Is there anything I can do to avoid that? If anyone can point me in the right direction, I'd really appreciate it. Thanks! Eric - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom error page when ...
Exactly. That's why he wrote "You can add pages for HTTP response codes to you(r) web.xml file for each web application you deploy within Tomcat." Roberto Bottoni - AfterBit wrote: >Ok.. but if I make this change in web.xml in folder /conf of Tomcat I get >the same result for every web application? > >Thanks. >Roberto. > >- Original Message - >From: "Chris Birch" <[EMAIL PROTECTED]> >To: "Tomcat Users List" >Sent: Saturday, October 22, 2005 12:59 PM >Subject: Re: Custom error page when ... > > > > >>You can add pages for HTTP response codes to you web.xml file for each >>web application you deploy within Tomcat. >> >>Add the following to your web.xml file after and >>before declarations: >> >> >>404 >>/pages/error.jsp >> >> >>Regards, >>Chris. >> >>On 22 Oct 2005, at 10:12, Roberto Bottoni - AfterBit wrote: >> >> >> >>>Hi, >>>I would like to replace a custom error page when i get a : HTTP Status >>>404 >>>.. The requested resource (/..) is not available with Tomcat 5. >>>How I make this ? >>>Thanks. >>> >>>Roberto. >>> >>> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom error page when ...
Ok.. but if I make this change in web.xml in folder /conf of Tomcat I get the same result for every web application? Thanks. Roberto. - Original Message - From: "Chris Birch" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Saturday, October 22, 2005 12:59 PM Subject: Re: Custom error page when ... > You can add pages for HTTP response codes to you web.xml file for each > web application you deploy within Tomcat. > > Add the following to your web.xml file after and > before declarations: > > > 404 > /pages/error.jsp > > > Regards, > Chris. > > On 22 Oct 2005, at 10:12, Roberto Bottoni - AfterBit wrote: > > > Hi, > > I would like to replace a custom error page when i get a : HTTP Status > > 404 > > .. The requested resource (/..) is not available with Tomcat 5. > > How I make this ? > > Thanks. > > > > Roberto. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom error page when ...
You can add pages for HTTP response codes to you web.xml file for each web application you deploy within Tomcat. Add the following to your web.xml file after and before declarations: 404 /pages/error.jsp Regards, Chris. On 22 Oct 2005, at 10:12, Roberto Bottoni - AfterBit wrote: Hi, I would like to replace a custom error page when i get a : HTTP Status 404 .. The requested resource (/..) is not available with Tomcat 5. How I make this ? Thanks. Roberto. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Custom error page when ...
Hi, I would like to replace a custom error page when i get a : HTTP Status 404 .. The requested resource (/..) is not available with Tomcat 5. How I make this ? Thanks. Roberto. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]