H
H
HaruAtari2014-01-02 13:16:50
Apache HTTP Server
HaruAtari, 2014-01-02 13:16:50

Why can't Apache access the directory?

Good afternoon.
I have a directory that contains images.
/
-images/
--01/
--- 1.png
-previews/
--01/
--- 2.png
-icons/
--titles/
---3.png
The virtual host points to this directory:

virtual host config
<VirtualHost *:80>
        ServerName storage.site.loc
        DocumentRoot /var/site/storage
        <Directory /var/site/storage/>
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

For the purity of the experiment, the rights to these directories were set to 777:
ls-la
drwxrwxrwx   8 haru haru 4096 Jan  2 14:05 .
drwxrwxrwx   7 root root 4096 Jan  2 11:41 ..
drwxrwxrwx   2 haru haru 4096 Jan  2 14:05 icons
drwxrwxrwx 144 haru haru 4096 Jan  1 16:13 images

http://storage.site.loc/icons/titles/3.pngThe problem is this: apache gives a 404 code when accessing the address . At the same time, files from the images and previews directories are returned normally.
If you create a new directory and a file in it, the server will return it without errors.
If you delete the icons directory and then create it again, it still does not see the files.
The .htaccess file is missing. Apache version - 2.4.6
Tell me, what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HaruAtari, 2014-01-02
@HaruAtari

I found out what was the problem.
There /etc/apache2/mods-enabled/alias.confwas a line in the file Alias /icons/ "/usr/share/apache2/icons/". I commented it out and it worked.
Previously, the storage directory was not the root directory and links to it looked like site.com/storage/icons/1.png. Because of this, apparently, the alias did not work.
Now I'm scratching my head: where did this alias come from and why was it needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question