Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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've a subdomain that I only want to be accessible internally; I'm trying to achieve this in Apache by editing the VirtualHost block for that domain. Can anybody see where I'm going wrong? Note, my internal IP address here are My code is as follows:

<VirtualHost *:80>
  DocumentRoot /var/www/test
  ErrorLog /var/log/apache2/error_test_co_uk.log
  LogLevel warn
  CustomLog /var/log/apache2/access_test_co_uk.log combined
  <Directory /var/www/test>
    Order allow,deny
    Allow from
    Allow from 127


share|improve this question

This should do the trick.

<Directory /var/www/test>
  Order  deny, allow
  deny from all
  Allow from
  Allow from 127

Reload apache.

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.