0

I'm trying to enable directory listing for a folder outside the web root that uses Basic Authentication, but I'm getting an empty list and no logged errors. What's strange is that if I put in the known location of a file under this directory in my browser, it downloads the file just fine. This tells me it's not a read permissions issue.

Here's my example.conf file:

<virtualhost *:80>

  ServerAdmin [email protected]
  ServerName  example.com
  ServerAlias www.example.com


  DirectoryIndex index.php
  DocumentRoot /var/www/example.com
    <Directory />
    Options FollowSymLinks
    AllowOverride All
    </Directory>

  LogLevel warn
  ErrorLog  /var/apachelogs/error.log
  CustomLog /var/apachelogs/access.log combined

  Alias /blah2 "/blah1/blah2"
    <Location /blah2>
              Options +Indexes +MultiViews +FollowSymLinks
              IndexOptions +FancyIndexing
    </Location>


</virtualhost>

And here's my .htaccess

AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/home/myusername/.htpasswd"
Require valid-user

Also, I've commented IndexIgnore out in /etc/apache2/mods-enabled/autoindex.conf

#IndexIgnore .??* *~ *# RCS CVS *,v *,t
6
  • btw authentication is working just fine.
    – user255406
    Aug 27, 2019 at 13:06
  • increase LogLevel to debug or trace4 and try using Require valid-user in the location tag. I used inline AuthType in httpd.conf under Location and worked fine.
    – Dextro67
    Aug 28, 2019 at 7:12
  • thanks for the advice. moving auth didn't resolve the issue. also, removing auth completely and replacing it with Require all granted doesn't resolve the issue. Here's my trace4 pastebin.com/nXz2rzb9
    – user255406
    Aug 28, 2019 at 11:32
  • looks like w3cache was adding a bunch of noise to that log, so I renamed my root .htaccess and reran the log. much simpler now. pastebin.com/uB2kctQi
    – user255406
    Aug 28, 2019 at 12:16
  • I've just determined that this is a permissions issue. Made a directory in /home/username/, gave it 750 permissions and then pointed my alias there. Worked as expected.
    – user255406
    Aug 28, 2019 at 12:38

0

You must log in to answer this question.

Browse other questions tagged .