Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create A Custom Apache 503 Error Page

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 still points to the original Apache one.

This is the code that I have in my "httpd-vhosts.conf" file.

<VirtualHost *:80>
ServerAdmin [email protected]
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"
<Directory "D:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/blah">
            Options All
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>
</VirtualHost>

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.

like image 653
snowfi6916 Avatar asked Feb 27 '13 20:02

snowfi6916


Video Answer


1 Answers

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.

like image 82
Welsh Avatar answered Oct 14 '22 06:10

Welsh