Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to be able to put our site into maintenance mode, excepting certain users to allow for QA/Dev to be able to test changes to the site/database during the maintenance mode.

The problem is that the list of IPs will be changing every time we do it and do to policies, we cannot modify the main apache configuration file with a different list of IPs each time we do it. We can do a one-time modifications of the apache config in order to support reading in or using some other file that would have the exception list.

What options do I have for providing apache with a list of IPs that should not be redirected? Would an .htaccess file that we add do it? What about a file of key value pairs?

I'm looking at doing something like this in the apache config:

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/maintenance.mode -f
#RewriteCond %{REMOTE_ADDR} ## check list of exceptions??
RewriteRule !^maintenance/.*$ /maintenance/ [R,L]
share|improve this question

1 Answer 1

You can have the blacklist/whitelist in a separate file. Have a look at http://httpd.apache.org/docs/2.2/rewrite/access.html#host-deny - it should give you enough to go on to start with.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.