How do I set IP access / password restrictions in Apache?
I'd like to restrict access to my Rails app (running on Apache/Passenger) to just two IPs, but if the visitor doesn't fall into those two IPs, I would like for him/her to be prompted to enter a password that would allow any user with the proper credentials to access the site from anywhere.
I am new to configuring Apache and would appreciate any hints. Thanks!
You can do this with .htaccess files, something like:
AuthName "Lee's Secret Area" AuthType Basic <Limit GET POST> order deny,allow deny from all allow from 199.166.210. allow from .golden.net allow from proxy.aol.com allow from fish.wiretap.net </Limit>