I've done this before, but have apparently forgotten what I did. I have apache 2.4.16 and Tomcat 8.0.23 on Linux Slackware 64 14.1, kernel 3.10.17.
My Apache DocumentRoot is /srv/httpd/htdocs. My Tomcat $CATALINA_HOME is /srv/tomcat. I have a folder: /srv/tomcat/webapps/ohprs/downloads/jones that I want only user "jones" to have access to. Jones is not a local user. In the jones folder I have a .htaccess file as follows:
AuthType Basic
AuthName "SLC"
AuthUserFile /etc/httpd/passwords
Require user jones
I've added jones to the /etc/httpd/passwords file.
in /etc/httpd/httpd.conf I have:
<Directory /srv/tomcat/webapps/ohprs/downloads/jones>
Options +Indexes
AllowOverride All
</Directory>
<Location /ohprs/downloads/jones>
AuthType Basic
AuthName "Restricted"
AuthUserFile /etc/httpd/passwords
Require valid-user
AuthBasicProvider file
</Location>
When I enter my URL,
https://www.mydomain.com/ohprs/downloads/jones, I get the login dialog. I enter the login info which is accepted. However, I get a 404 status, "The requested resource is not available - Apache Tomcat 8.0.23".
The message in /var/log/httpd/access_log is:
Code:
[30/Jul/2015:02:41:40 -0400] 76.181.65.196 TLSv1.2 ECDHE-RSA-AES256-SHA384 "GET /ohprs/downloads/jones HTTP/1.1" -
[30/Jul/2015:02:41:40 -0400] 76.181.65.196 TLSv1.2 ECDHE-RSA-AES256-SHA384 "GET /ohprs/downloads/jones/ HTTP/1.1" 1040
Nothing logged in $CATALINA_HOME/logs/catalina.out
What am I doing wrong?