httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yehuda Katz <yeh...@ymkatz.net>
Subject Re: [users@httpd] simple easy way to turn to maintenance mode
Date Tue, 29 May 2012 02:14:15 GMT
On Mon, May 28, 2012 at 12:43 PM, Mark Montague <mark@catseye.org> wrote:

> On May 27, 2012 7:42 , Miguel Gonzalez <miguel_3_gonzalez@yahoo.es> wrote:
>
>>    I'm administering Apache and Tomcat web servers. From time to time we
>> have to turn the web server down and would be nice to have a maintenance
>> mode message to the users.
>>
>
> If what you are doing maintenance on is actually a web application and
> it's database, then you may be able to keep Apache HTTP Server running to
> provide the maintenance mode message.  The easiest way to do this is with
> login in the web application itself.  However, you could also have a second
> set of Apache HTTP Server configuration files that cause httpd to do
> nothing but serve the static maintenance message for all URLs under your
> web virtual hosts -- when you begin maintenance, stop httpd and start it up
> again using the new configuration files, and when you end maintenance stop
> httpd and start it using your regular configuration files.
>

We use mod_rewrite:
RewriteEngine On
# TO ALLOW YOURSELF TO VISIT THE SITE, CHANGE 111 222 333 444 TO YOUR IP
ADDRESS.
 # RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444$
RewriteRule .* - [R=503,L]

Courtesy of http://25yearsofprogramming.com/blog/20070704.htm

Mime
View raw message