Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Are we, Apache Commandos, able to do this:

Open the HTTP Basic Authentication dialog box in a browser only if I request some URL from a specific domain name/server name/host name?

For instance:

If I'd be requesting:

localhost
some_custom_localhost
127.0.0.1
192.168.1.123
etc...

I shouldn't be poping up the HTTP Basic Authentication. But if I'd do this:

www.somehost.com
sub.somehost.com
213.214.15.16 *(meaning a public internet IP)*

I should get my HTTP Basic Auth poped out, and have my credentials stored under my ".htpasswd", etc.

Is this even posible as I've described it?

share|improve this question

1 Answer

As the documentation describes, HTTP auth can be as granular as you need.

You can certainly decide access by (name-based) vhost, as long as the content they serve is different.

share|improve this answer
meaning I should just add a virtualhost for my specific IP/Hostname/Domainname, and it's directives I can setup the HTTP Basic Auth? – Zlatan O. Jan 28 at 15:13
You should probably spend some time on basic virtual hosting with apache – adaptr Jan 28 at 15:17
that's not the answer to my question: should I just add a directive on the specific domain or not? – Zlatan O. Jan 28 at 15:24
Your question makes bad assumptions; the documentation I pointed you to explains how authentication works. – adaptr Jan 28 at 15:33

Your Answer

 
discard

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.