To make your maintenance mode more flexible, set 503 when a special file exists, ala:
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/.maintenance -f
RewriteRule .* - [R=503]
NOTE: The location of DOCUMENT_ROOT can differ between httpd 2.2 and 2.4
This way all you need to do is "touch /path/to/docroot/.maintenance" and your site will instantly start returning 503's. Then to make it all purdy, create a custom nicely formatted html error page and add this to the correct apache server's config file:
ProxyErrorOverride on
ErrorDocument 503 /error/503.html
And for bonus points if you have multiple web servers either make the location of .maintenance on a shared filesystem, or for even more bonus points:
pdsh -w $web1_ip,$web2_ip,$web3_ip "sudo touch /path/to/docroot/.maintenance"
The advantage of making the maintenance mode file based is that it works when your application doesn't, it's quick and simple, and it's easier for a frontend caching proxy to handle because you can handle all backend 503's in one fell swoop.
Sources: