LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-30-2015, 10:40 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
Problem accessing list of files in directory with Apache/Tomcat


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?
 
Old 07-31-2015, 05:38 AM   #2
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
It's been quite some time since I myself have set up Tomcat, but I have a feeling you are pointing to the wrong directory. Always use full paths in Apache configurations.

Try changing:

Code:
 <Location /ohprs/downloads/jones>
to:

Code:
<Location /srv/tomcat/webapps/ohprs/downloads/jones>
Restart Tomcat, then restart apache. hard refresh browser window with CTRL + R.
 
  


Reply

Tags
apache authentication, index, tomcat



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Apache/Tomcat web server via host name vs. DNS alias dcarrington Linux - Server 5 01-17-2013 01:04 PM
[SOLVED] Accessing Tomcat created pages from Apache-- Client denied by server configuration x201s Linux - Server 2 12-09-2012 11:40 PM
User rights setup, Tomcat and Apache users both need access to a directory zeeshan12 Linux - Server 6 11-10-2011 05:38 AM
[SOLVED] List files/directory names without directory contents? littlebigman Linux - Software 2 05-03-2011 04:42 AM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 06:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration