Я сталкиваюсь с периодически возникающей проблемой, когда apache дает мне несоответствующий DirectoryIndex даже с существующими файлом и папкой, которые он ищет. Я работаю с угловым приложением прямо рядом с приложением php и, в основном, псевдонимом некоторых областей клиентского пространства URL-адресов на стороне сервера.
Я пытался отлаживать conf-файл столько, сколько мог, но могу »Кажется, я не могу понять, что пошло не так, и почему я не могу воспроизвести проблему, но другие ясно, как ошибка в моих журналах.
Вот ошибка.
[Fri Nov 08 20:25:28.578814 2019] [autoindex:error] [pid 18260:tid 140678868711168] [client x.x.x.x:25058] AH01276: Cannot serve directory /var/www/html/project/client/dist/: No matching DirectoryIndex (index.html,index.html.var,index.cgi,index.pl,index.php,index.xhtml,index.php) found, and server-generated directory index forbidden by Options directive
(08:36 PM) [root client]# pwd
/var/www/html/project/client
(08:36 PM) [root client]# ls -la
total 408
drwxrwsr-x 6 webdr apache 219 Nov 8 01:12 .
drwxrwsr-x 7 webdr apache 91 Aug 20 19:23 ..
...
drwxrwsr-x 4 webdr apache 4096 Nov 8 01:11 dist
...
(08:36 PM) [root client]# ls -la dist
...
-rw-rw-r-- 1 webdr apache 2437 Nov 8 01:11 index.html
...
<VirtualHost *:443>
ServerName server.com
## Vhost docroot
DocumentRoot "/var/www/html/project/client/dist"
## Alias declarations for resources outside the DocumentRoot
Alias /alias "/var/www/html/project/server/public"
Alias /alias1 "/var/www/html/project/server/public/alias1"
Alias /alias2 "/var/www/html/project/server/public/alias2"
## Directories, there should at least be a declaration for /var/www/html/project/client/dist
<Directory "/var/www/html/project/client/dist">
AllowOverride all
Require all granted
</Directory>
<Directory "/var/www/html/project/server/public">
AllowOverride all
Require all granted
</Directory>
## Load additional static includes
Include "/etc/letsencrypt/options-ssl-apache.conf"
## Logging
ErrorLog "/var/log/httpd/server ssl_error_ssl.log"
ServerSignature Off
CustomLog "/var/log/httpd/server ssl_access_ssl.log" combined
## Rewrite rules
RewriteEngine On
RewriteCond %{HTTP_HOST} !=""
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
## SSL directives
SSLEngine on
SSLCertificateFile "/etc/cert/path/cert.pem"
SSLCertificateKeyFile "/etc/cert/path/privkey.pem"
SSLCertificateChainFile "/etc/cert/path/chain.pem"
## Custom fragment
Protocols h2 http/1.1
</VirtualHost>
Я, конечно, не ожидал бы случайных проблем 403, когда в системе ничего не меняется, и любая помощь будет принята с благодарностью, потому что у меня нет идей.