Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

328
Views
How to setup ErrorDocument alongside VirtualDocumentRoot in apache2?

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>
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!