Custom Error 503 Apache
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn 503 apache error code more about Stack Overflow the company Business Learn more about hiring developers or posting
Apache 503 Error Page
ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community apache custom error log virtualhost Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to Create A Custom Apache 503 Error Page up
Error 404 Apache
vote 6 down vote favorite 3 I created an HTML document that will display that the server is not ready yet, and then redirect to another page. I want this to be the 503 error page. What file do I need to edit in Apache to get this custom HTML to be my new 503 error page? I have tried following the instructions on multiple websites, but it error 403 apache still points to the original Apache one. This is the code that I have in my "httpd-vhosts.conf" file. ServerAdmin blah@blah.com ServerName blah.blah.com ServerAlias blah blah.blah.local ErrorLog "logs/blah-error.log" CustomLog "logs/blah-access.log" common ErrorDocument 503 "D:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/blah/error.html" LogLevel warn RewriteEngine On JkMount /* worker5 DocumentRoot "D:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/blah" Options All AllowOverride All Order allow,deny Allow from all In the "httpd.conf" file, it is including the "httpd-vhosts.conf" file, so I don't know why it is not working. Any help would be appreciated. Thanks. apache http-status-code-503 share|improve this question asked Feb 27 '13 at 20:20 snowfi6916 3392715 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote ErrorDocument takes in a absolute URL path instead of a file path. So it should be: ErrorDocument 503 /blah/error.html Assuming under your document root is a /blah/error.html file. share|improve this answer answered Oct 20 '13 at 6:01 Welsh 2,81411225 It will not work this way because some errors code have to be configured from: /etc/apache2/conf.d/localized-error-pages –moderns Apr 28 '14 at 22:24 1 No it doesn't. You can do ErrorDocuments in various contexts. See: httpd.apache.org/docs/2.2/mod/core.html#errordocument –Welsh May 3 '14
run Linux RedHat and want to find out
Error 500 Apache
how can I replace the standard Apache 503 error page
Tomcat Error 503
with my own? This is my configuration in the httpd.conf file for error pages. Can apache custom error pages I just edit the HTTP_SERVICE_UNAVAILABLE.html.var in /var/www/error directory and replace the content with my own , or how can I accomplish my goal? Thanks Alias http://stackoverflow.com/questions/15121599/how-to-create-a-custom-apache-503-error-page /error/ "/var/www/error/" AllowOverride None Options IncludesNoExec AddOutputFilter Includes html AddHandler type-map var Order allow,deny Allow from all LanguagePriority en es de fr ForceLanguagePriority Prefer Fallback # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var # ErrorDocument 405 https://www.howtoforge.com/community/threads/how-can-i-replace-503-error-page-in-apache.44205/ /error/HTTP_METHOD_NOT_ALLOWED.html.var # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var # ErrorDocument 410 /error/HTTP_GONE.html.var # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var ppawcio, Mar 19, 2010 #1 falko Super Moderator ISPConfig Developer # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var Code: That directive is not active; I guess there's some other (active) ErrorDocument 503 directive somewhere in your Apache configuration. Yes, you can simply modify the file. falko, Mar 19, 2010 #2 dbrumbaugh New Member Modification of Error Docs The previous responder is correct, the directives are commented out because of the "#" in the directive statement. However, this doesn't mean that the directive is stated elsewhere in the config file. Not having a "ErrorDocument" in the config file then defaults to
users (and SEO!), you should setup a custom 503 page. AskApache provides some documentation on this, but the examples require creating a PHP page. One of the commenters proposed https://szeryf.wordpress.com/2009/07/10/simplest-way-to-set-up-a-well-be-back-shortly-page/ a non-PHP version, but it's complicated and didn't work for me. So, this is the simplest way to set-up a custom "we'll be back shortly" error page in Apache 2 that also tells Googlebots to retry after 1 hour: ErrorDocument 503 /503.html RewriteEngine On RewriteCond %{REQUEST_URI} !^/503.html$ Header always set Retry-After "3600" RewriteRule .* - [R=503] Read on for explanation and a more advanced example. The above lines should be custom error placed in you Apache's site config file (e.g. /etc/apache2/vhosts.d/_vhost.conf) somewhere under DocumentRoot directive. The first line sets a custom file for HTTP 503 status. The path you provide here is relative to DocumentRoot, so if you have: DocumentRoot /var/sites/my_site/current/public ErrorDocument 503 /503.html then the file should be at /var/sites/my_site/current/public/503.html. Having a regular HTML means that you do not need anything except Apache itself to serve it. Inside it you can provide apache custom error a message about the cause of the break and when you expect your site to be back up. Next line (line #2 in first example) turns the RewriteEngine on, which is needed to process the following directives. Line #3 excludes from processing all the requests that go to our 503 page. Without it we would get an endless loop of redirections (which would not be endless in Apache, of course, but after exceeding the redirection limit would cause an error instead of producing the page). Line #4 sets Retry-After header for bots, which is set here for 3600 seconds. If you expect your break to be much shorter, you can use a lower value. The last line sets a 503 response for all requests that made it up to here (i.e. not excluded by line #2). Let the developers in Often you need to allow some people (the developers or the client) to play with site even if it's unavailable to the rest of the Internet. To do so, you can exclude them from getting the 503 page by entering their IPs: ErrorDocument 503 /503.html RewriteEngine On RewriteCond %{REMOTE_ADDR} !^1.2.3.4$ RewriteCond %{REQUEST_URI} !^/503.html$ Header always set Retry-After "3600" RewriteRule .* - [R=503] The only thing new here is line #3, whic