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 have developed an internal website for a firm and then need to restrict access to only the internal workers. i.e. connected to their own wireless network. For anyone outside the network, the website should not open up at all. For those in the network, username/password should be prompted?

How can I:
1 > Check for the access depending on IP address?
2 > Check for username/password prompt if IP address is valid?

share|improve this question

migrated from May 18 '11 at 0:57

This question came from our site for professional and enthusiast programmers.

We need more information: 1. what web server are you running. 2. where is the username/password stored? – toneplex May 17 '11 at 21:42
More information as in ? Please be specific. Since I have never done this before, I don't know what would be needed – name_masked May 17 '11 at 21:43
up vote 0 down vote accepted

I'm going to post my answer assuming you used apache. You can do this but you need to generate the users/password file so have a look at the documentation for that.

<Location />
  Order Deny,Allow
  Allow from
  Deny from all
  Require user someuser
  Require user someotheruser
share|improve this answer

Unless you have requirements other than protecting the site from users in the outside world, you don't need to do any form of authentication as the intranet site should be hosted on a server local to the intranet and with no form of connection to the outside world.

share|improve this answer
In other words, the website is behind the firewall, invisible to internet users. – Robert Harvey May 17 '11 at 22:14

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.