Restricting a Virtual Host to only a certain subnet/subnets


Results 1 to 2 of 2

Thread: Restricting a Virtual Host to only a certain subnet/subnets

  1. #1
    Join Date
    Aug 2002
    Posts
    128

    Restricting a Virtual Host to only a certain subnet/subnets

    Hi, Not sure if this has been done before, but I could not find a directive on it off of apache.org

    I'd like to limit a virtual host to only be accessible by certain subnets. In this case, I have an app server that is accessing the apache server and I only want to allow the app server to access this virtual host.

    They are both internet accessible, but the app server does the authentication.

    I would appreciate any and all suggestions!
    terets

    Gentoo is a way of life...

    Registered Linux User #138016

  2. #2
    Join Date
    Nov 2003
    Posts
    105
    I guess you can do it using .htaccess. Create a file named .htaccess in your virtual server's docroot with something like this:
    Code:
    <limit GET>
    deny from all
    allow from 192.168.0.
    allow from 192.168.1.
    </limit>
    use the subnets you want to allow access.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •