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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to restrict the acess based on the ip address of the client. I have different url each client they should access.

Should I say

<VirtualHost client1:443> 
<VirtualHost client12:443>
<VirtualHost client3:443>

thanks for you help in advance

share|improve this question

No, the IP:Port mapping specified in the VirtualHost block is the IP address on your server that this vhost will be served from, not the client's IP address.

To restrict access based on client IP, use mod_access rules, either in your VirtualHost stanza or via .htaccess files.

For instance:

Order deny,allow
Deny from all
Allow from

More details here.

share|improve this answer
Avoid using .htaccess files when possible and instead do the config in the main httpd.conf. Since apache will check the .htaccess file for changes continually, using it will decrease the server performance. – Jenny D Sep 7 '12 at 5:01
@JennyD - I'd be impressed if you could demonstrate this actually decreasing performance. For frequently-used sites, this file will remain in the kernel read cache, meaning access to it (in RAM) may add a single millisecond to the request. Hardly anything to be concerned about. – EEAA Sep 7 '12 at 5:08
If there is only one .htaccess file on the system - yes. But as this is Serverfault, not Superuser, I'm considering larger systems than that. – Jenny D Sep 7 '12 at 7:35

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.