I have some docker containers and one of them handle the server with apache2. Also, I handle multiple subdomains with VirtualDocumentRoot, but the problem is, I can't setup VirtualDocumentRoot alongside ErrorDocument with a custom file. The ErrorDocument can't find my custom file either in "/usr/local/apache2/" or "/sites/live". I can use a URL and it works but it's not I want. Can someone help me please?
Dockerfile:
server:
build: ./server
environment:
- SITES_PATH=/sites/live
ports:
- "8888:80"
volumes:
- sites:/sites:ro
httpd.conf
UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog "logs/access_log" vcommon
VirtualDocumentRoot "${SITES_PATH}/%0"
VirtualScriptAlias "${SITES_PATH}/%0/cgi-bin"
<Directory ${SITES_PATH}>
ErrorDocument 404 /custom_404.html
AllowOverride all
Require all granted
</Directory>