Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

If I have 3 domain names: siteA, siteB, and siteC. Lets say all of these sites are stored on the same server, however I want to lock siteB down to only a certain subnet and siteC to a broader subnet.

Is there any way to achieve this using only IPTables and Apache?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Sure, apache's mod_access will take care of this nicely. Throw something like this into the .htaccess for the sites to which you want to restrict access:

Deny from all
Allow from
Allow from
share|improve this answer

Your Answer


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.