Forum Moderators: phranque
I have only used this type of Auth in the past:
AuthType Basic
AuthName 'Username and Password Required'
AuthBasicProvider dbm
AuthDBMType SDBM
AuthDBMUserFile /var/www/auth_user_pass
AuthDBMGroupFile /var/www/auth_user_pass
<Limit GET POST>
require valid-user
</Limit>
Within the <Directory> tag. Can I do something like that using the same auth file in a Virtual Host?
Have you tried using your example auth code or something similar at the <VirtualHost> level? If so, what were the results and how did those results fail to met your expectations and/or needs?
Answering a question like "What is the best method?" is difficult. It's similar to "What is the best car?" or "What is the best computer?" -- impossible to answer without a very long list of goals and requirements.
Jim
Within the <Directory> tag. Can I do something like that using the same auth file in a Virtual Host?
Not directly. You can put your <Directory> section with the directives above into the <virtualhost> if they should apply to the specific <virtualhost> only. Auth and access directives are valid in per-directory context only.