Password protecting sub-domains?
-
My "newbieness" will definitely be obvious in this question. Is it possible to password protect an entire sub-domain?
more info below:My goal is to setup a simple search tool webapp that indexes and searches academic content (all are pdf's). Since this material is copy protected, I need to take extra caution so that the content is only viewable to my classmates (about 200 students, each will have a username and password).
I have already built a Rails app that does this (via use of apache solr), and I've already setup an authentication method that is internal to the Rails framework (called authlogic).
But, I'm curious if there is another way to password protect at a higher level, e.g. at the sub-domain level or at the web-server level. To clarify, say I setup a sub-domain search.example.com which directs to the app; is it possible to password protect the entire sub-domain? Can this be done at the level of apache config? or Nginix config?
Posted 2 years ago # -
So, I guess I should be more proactive at reading all the featured vpsbible articles. apparently, this guide answers part of my question:
http://vpsbible.com/security/password-protect-website-files/
any thoughts on if this method would be easily adapted to Rails apps?
Posted 2 years ago # -
Hi Ginger, yes, that would work with Rails.
Posted 2 years ago # -
Great, thanks Guv. Will definitely try this soon.
Posted 2 years ago # -
What about if I want to password protect the entire web directory?
I put location ~ and it just stops my css from working. Thanks!
Posted 1 year ago # -
hey joe .. there's a tutorial somewhere round here to show exactly what to do :P .. look in the Admin section of the Nginx VPS INdex (at bottom of the standalone tutorials)
Posted 1 year ago # -
Hey guv, do you mean this? http://vpsbible.com/security/password-protect-website-files/ I read through it and configured everything, but it doesn't show how to password protect the entire doc root, only certain subfolders. And I know it should be easy, but I just can't figure out the right syntax to password protect the entire doc root, so that when I type my web address in I'm prompted for a password, so that i can prep a site for launch behind that password protection for a bit. Thanks
Posted 1 year ago # -
hi Joe,
let me get this right .. you only want to protect the root of some site in development, while allowing access to production sites, right?
.. in that case, add the location directive to the pertinent virtual host file, something like:-
location ^~ /path/to/site-ROOT {
foo
blah
}.. must reboot nginx.
for the whole public_html you'd add the directive to your default virtual host instead.
Posted 1 year ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
