Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 3 webapps running on my machine on different ports like:

xxx.domain.com:8080
yyy.domain.com:8181
zzz.domain.com:8282

If I add to my httpd.conf:

<Location "/">
AuthUserFile /my/file/with/users
AuthName "This is a protected area"
AuthGroupFile /dev/null
AuthType Basic
Require valid-user
</Location>

The authentication works fine, but I want to be able to have Apache authentication only when the user enters "xxx.domain.com" and not yyy/zzz, is it possible without using .htaccess files and the <Location>?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

yes, use virtual hosts: http://httpd.apache.org/docs/2.2/vhosts/

share|improve this answer

Yes, you can do it by putting in the Directory directive (into VirtualHost) instead of using .htaccess.

share|improve this answer

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.