Results 1 to 9 of 9

Thread: how to change 503 page and server info

  1. #1
    Join Date
    Sep 2008
    Beans
    721
    Distro
    Ubuntu 12.04 Precise Pangolin

    how to change 503 page and server info

    How do you change the default 503 page on the server?

    I want to get rid of this message down below and put a different page.
    Code:
    Service Temporarily Unavailable
    
    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
    --------------------------------
    Apache/2.2.11 (Ubuntu)
    also, I would like to get rid of the server info that prints on the browser

  2. #2
    Join Date
    Aug 2006
    Location
    Canada
    Beans
    389
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: how to change 503 page and server info

    One way is edit /etc/apache2/apache2.conf and setup custom ErrorDocument's for the particular error message(s) you want.

    Code:
    sudo nano /etc/apache2/apache2.conf
    and then search for "ErrorDocument" to see some examples.
    Last edited by amac777; August 7th, 2009 at 06:24 AM. Reason: httpd.conf is empty on my system so I deleted that comment

  3. #3
    Join Date
    Sep 2008
    Beans
    721
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to change 503 page and server info

    # You can modify the messages' appearance without changing any of the
    # default HTTP_<error>.html.var files by adding the line:
    # Alias /error/include/ "/your/include/path/"

    it is not really clear to me... am I suppose to uncomment the alias line and give my own path. I figured I would just change the default HTTP_<error>.html.var file...

    I really appreciate any suggestions you have...

    # You can modify the messages' appearance without changing any of the
    # default HTTP_<error>.html.var files by adding the line:
    #
    # Alias /error/include/ "/your/include/path/"
    #
    # which allows you to create your own set of files by starting with the
    # /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
    # even on a per-VirtualHost basis. The default include files will display
    # your Apache version number and your ServerAdmin email address regardless
    # of the setting of ServerSignature.
    #
    # The internationalized error documents require mod_alias, mod_include
    # and mod_negotiation. To activate them, uncomment the following 30 lines.

  4. #4
    Join Date
    Aug 2006
    Location
    Canada
    Beans
    389
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: how to change 503 page and server info

    I was looking around to see how I shut off the ServerTokens on my apache configuration because I did it a long time ago and couldn't remember. Anyway, I found it:

    To get rid of the signature line at the bottom of the standard error messages showing Ubuntu and the version number:

    Code:
    sudo nano /etc/apache2/conf.d/security
    and change the "ServerSignature" to "Off".

    Then restart apache2 by running:

    Code:
    sudo /etc/init.d/apache2 restart
    I'll play around with the custom error messages now to see if I can figure that out (I have not done that before myself.)

  5. #5
    Join Date
    Aug 2006
    Location
    Canada
    Beans
    389
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: how to change 503 page and server info

    Ok, custom error messages are very easy too:

    Code:
    sudo nano /etc/apache2/apache2.conf
    Then add this line to the bottom:

    Code:
    ErrorDocument 503 /my_custom_error_message_503.html
    Then create your my_custom_error_message_503.html in the root file of your websever (for example in /var/www)

    Then restart apache2:

    Code:
    sudo /etc/init.d/apache2 restart

  6. #6
    Join Date
    Sep 2008
    Beans
    721
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to change 503 page and server info

    Thank you. I tried that... there is a bit of a problem. I got mod_proxy on... because of that it doesnt pick up /var/www/. I tried to use mod_jk but I was getting problems, so switch to mod_proxy. I dont know how to block proxy for certain instances.

    Trying your example I got...
    Code:
    The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
    
    Additionally, a 503 Service Temporarily Unavailable error was encountered while trying to use an ErrorDocument to handle the request.

  7. #7
    Join Date
    Aug 2006
    Location
    Canada
    Beans
    389
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: how to change 503 page and server info

    I've never used mod_proxy so not really sure how that effects things.

    Where do you want to put your custom error message .html file on your filesystem? I am just experiementing here, but assuming you wanted to put it in /var/www/my_errors, does it work if you change apache2.conf to:

    Code:
    Alias /my_errors/ "/var/www/my_errors/"
    ErrorDocument 503 /my_errors/my_custom_error_message_503.html

  8. #8
    Join Date
    Sep 2008
    Beans
    721
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to change 503 page and server info

    Thank you. I found out that you can do it also...
    http://askubuntu.com/questions/53199...pache-404-page
    Using 12.04 Ubuntu

  9. #9
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: how to change 503 page and server info

    Another 4 year old, without anything new added, thread closed.

Bookmarks

Posting Permissions

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