Results 1 to 6 of 6

Thread: How to give "site is temporarily offline" message?

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    27

    Default How to give "site is temporarily offline" message?

    Hello,

    My project is in spring mvc 2.5, and I have hosted it on tomcat 6. For maintenance purpose sometimes I shutdown tomcat, mean while if any user hits the URL they will see tomcat's http 404 page. I want to add a page with the message "site is temporarily offline" only when tomcat is shutdown.

    Any suggestions how can I achieve this? Thanks a lot in advance.

  2. #2
    Join Date
    Mar 2007
    Posts
    128

    Default

    Technically you wouldn't be getting a 404 error from tomcat since you shut it down. You'd be getting a message from the browser saying it couldn't connect to the server.

  3. #3
    Join Date
    Mar 2011
    Posts
    27

    Default

    Hi sbirnie,

    Thanks for your reply. Yes you are absolutely correct. So, how to avoid that situation and display "Site is temporarily unavailable" message?

  4. #4
    Join Date
    Dec 2008
    Location
    India
    Posts
    295

    Default

    Hi Tejas,
    You can setup custom error page in Apache for error code 503. But again this is at server level not Spring.


    http://httpd.apache.org/docs/2.2/mod...#errordocument

    example
    Code:
    ErrorDocument 503 /maintance.html
    Enjoy
    Rohan Chauhan
    ------------------------------------------------------------------------------
    SpringSource Certified Spring 3.0 Professional


  5. #5
    Join Date
    Mar 2011
    Posts
    27

    Default

    Thanks a lot Rohan. But I have deployed my application on tomcat, can you please tell me where to find httpd.conf file where in i need to configure ErrorDocument?
    Last edited by tejaspatel; Jul 12th, 2012 at 05:26 AM.

  6. #6

    Default

    No idea, it should just be a simple case of copying everything over from the beta site, and then just changing a couple of lines in the code to point at the right database, use the correct cookies etc

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •