Apache2 does not display files inside directory

Hello,
I have been running Ubuntu14.04 + apache2.
000-default.conf:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory "/~boris/A">
        AuthType Basic
        AuthName "Authentication Required"
            AuthUserFile "/etc/apache2/.webroot"
            Require valid-user
          </Directory>

        <Directory "/~boris/B">
        AuthType Basic
        AuthName "Authentication Required"
            AuthUserFile "/etc/apache2/.webroot"
            Require valid-user
          </Directory>

</VirtualHost>

In Chrome, when I paste the url, it shows all files inside directory A.
urlA:

http://public_ip/~boris/A

It shows all files inside directory A.

urlB:

http://public_ip/~boris/B

url of directory B downloads html file.

Is there a limitation that would causing the issue or am I wrong with this conf file.
Or should I make it like:

        <Directory1 "/~boris/A">
        <Directory2 "/~boris/B">

Thank you
Boris

Please reply with the results of ls -la in both directories.

It makes a difference (what files are in the directories), especially the presence or lack of an index.html or index.php file, etc.

Hello Neo,
Both A & B directories have _index.html
As I need to display all files via Chrome, I moved index.html to _index.html earlier.

Thank you
Boris

Is there an index.php file?

Because it is hard to guess since we cannot see into the directory (because you will not post that information)

So, we will play a guessing game ... I guess :slight_smile:

You post minimal configuration info, and we guess what might be wrong :slight_smile:

(You do realize I have done this for many years and am very busy, so if I ask for a directory listing, I'm not joking and expect to see what I ask for .... there is no problem we cannot solve if we have the correct and full information we ask for ... )

1 Like

Hello Neo,
As there were 20.000 files inside each directory I have not shared the full list.
Now, I have found the problem.
When I need to list html files, I was typing like ls *.html which was giving the result _index.html
I see now that there is a file named index.html.ts which is causing the issue.

Thank you
Boris

1 Like

There ya go.....

You could have also posted:

ls -la *index*

.... since there are (way too many) 20K files in a directory (to post them all).

Well, glad you understood what I was trying to show you and you sorted it all out.

Cheers and have a great day!