I've got a server with several scponly accounts and I want to provide http access under Basic Auth.
The first part of the problem is solved, using mod_rewrite to chop and select the right directory for each user. But the problem arise when I try to stablish a different auth user file for each user. Simply I can't find how to do it.
Here's a sample config.
<VirtualHost an-ip-number-and:a-port>
ServerName *.example.com
RewriteEngine On
UseCanonicalName Off
RewriteCond %{HTTP_HOST} ^(.*).example.com
RewriteCond /server/scponly/%1/incoming -d
RewriteRule ^(.+) %{SERVER_NAME}$1 [C]
RewriteRule ^([^.]+)\.example\.com/(.*) /server/scponly/$1/incoming/$2 [L]
RewriteRule ^(.+) http://FAIL.example.com
<Directory /server/scponly/*/incoming>
AuthType Basic
AuthName "SFTP-HTTP Area"
AuthUserFile ??????? # <-- this!
require valid-user
</Directory>
</VirtualHost>
Notes:
- I can't drop mod_rewrite beacuse actual config is mixed with other servername / directory-check / rewrites for other purposes.
- I can't move auth details to .htaccess files because users could erase them. But I'm interested if this approach would be a partial solution.
- I'm also interested on other approaches
- I need differenciate auth files for each directory, having only one file will grant access to all directories to each user