You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Shashi <sh...@gmail.com> on 2013/06/17 15:41:31 UTC
[users@httpd] Want to replace 503 Maintenance page with custom page on Apache 2.2.23
Hi All,
Need some help here, want to replace the standard 503 page of Apache with
my custom maintenance page. Read some blogs which gives direction of
replacing the page with my html page and just do some rewrite of URL to
display it.with help of .htaccess.
I am not able to find the .htaccess file on the server, could some one
please help me on that, where is htaccess file by default on the server.
Could some body also suggest if there is any other solution to achieve
maintenance page.
Thanks,
Shashi. .
Re: [users@httpd] Want to replace 503 Maintenance page with custom
page on Apache 2.2.23
Posted by Sean Alderman <sa...@udayton.edu>.
The .htaccess files are in the content directories, e.g. DocumentRoot and
its subdirectories. You would normally create these file by hand on a per
directory basis.
You can create custom error messages by following this doc:
https://httpd.apache.org/docs/current/custom-error.html
In the past, I have found a good maintenance mode solution to be starting
Apache with an alternative config that changes the document root to a
maintenance directory. This directory has no index files, but instead
serves custom error documents.
The method I have used for starting Apache with an alternative config, is
to add a new option to the init.d script like "maint". One could simply
specify the -f <config file> argument as $OPTIONS in the environment before
running # service httpd restart, but I have found it this way for simple
apache configs. The maint option in /etc/init.d/httpd might look like:
<snip>
# See how we're called.
case "$1" in
start)
start
;;
maint)
stop
OPTIONS="$OPTIONS -f $MAINTCONFIG
start
;;
<snip>
Where $MAINTCONFIG is either coded into the init script (preferred) or set
in the environment. Then to go into maintenance, simply:
# service httpd maint
Which would stop apache, then start apache with the maintenance config.
Perhaps not the most elegant, but it served its purpose and is expandable
to handle maintenance for individual virtual hosts by devising additional
config files for each vhost that maintenance mode should apply.
Hope this helps!
--
Sean M. Alderman
Senior Engineer, UDit Systems Integration and Engineering
University of Dayton
On Mon, Jun 17, 2013 at 9:41 AM, Shashi <sh...@gmail.com> wrote:
> Hi All,
>
> Need some help here, want to replace the standard 503 page of Apache with
> my custom maintenance page. Read some blogs which gives direction of
> replacing the page with my html page and just do some rewrite of URL to
> display it.with help of .htaccess.
>
> I am not able to find the .htaccess file on the server, could some one
> please help me on that, where is htaccess file by default on the server.
>
> Could some body also suggest if there is any other solution to achieve
> maintenance page.
>
> Thanks,
> Shashi. .
>
>