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 192.168.10.xxx. My code is as follows:

<VirtualHost *:80>
  ServerName test.epiphanydev2.co.uk
  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 192.168.10.0/24
    Allow from 127
  </Directory>
</VirtualHost>

Thanks

link|improve this question

70% accept rate
feedback

1 Answer

This should do the trick.

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

Reload apache.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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