Announcement Announcement Module
Collapse
No announcement yet.
How to give "site is temporarily offline" message? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      Hi sbirnie,

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

      Comment


      • #4
        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

        Comment


        • #5
          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, 06:26 AM.

          Comment


          • #6
            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

            Comment

            Working...
            X