• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

ErrorDocument being ingnored - Using Virtual Servers and Apache 2.x and Fedora core3

I am running Apache 2.x on Fedora Core 3
I have only 17 Virtual domains.
Apache seems to be ignorning the ErrorDocument line.
I created a 404.html file and it is in the virtual servers root.

Here is the virtual config in httpd.conf:
SuexecUserGroup "#501" "#501"
ServerName everythingwine.net
ServerAlias www.everythingwine.net
DocumentRoot /home/everythingwine/public_html
ErrorLog /home/everythingwine/logs/error_log
CustomLog /home/everythingwine/logs/access_log combined
ScriptAlias /cgi-bin/ /home/everythingwine/cgi-bin/
ErrorDocument 404 /404.html
<Directory /home/everythingwine/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks
allow from all
AllowOverride All
  • 3
  • 2
1 Solution
ErrorDocument which appears under <VirtualHost> will be available only for that Virtual host. Other virtaul hosts will have standard 404 error output.
Put ErrorDocument outside the VirtualHost.
This line: ErrorDocument 404 /404.html

Do not include the /, since then you are referring to the system's root directory, not the vhost root. Just put:

ErrorDocument 404 404.html

inside the vhost config and it should work like a charm. Make sure you restart the server for the config changes to take effect.
jbrashear72Author Commented:
Thank you both but That is not the issue.
I need for each virtual site to have it's own custom 404 page.
Apache server is totally ignoring it and when you get a 404 a ie error page comes up, meaning no 404 page showing.
Maybe this will help.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

There is known issue with IE explorer.
"Microsoft Internet Explorer (MSIE) will by default ignore server-generated error messages when they are "too small" and substitute its own "friendly" error messages. The size threshold varies depending on the type of error, but in general, if you make your error document greater than 512 bytes, then MSIE will show the server-generated error rather than masking it. More information is available in Microsoft Knowledgebase article Q294807."

How big is your 404 file
jbrashear72Author Commented:
OK No that is totally not wahat I was saying...... No default 404 error page is coming up. Most web pages are around 33k in size.
That is not the issue.
The 404 page uses the same page layout as the site.
This issue:

virtuall hosts have a ErrorDocument  loaded
Apache is not recognizing that that dirrective in in there.
I think that apache is misconfigured some place else in the httpd.conf file

So I guess is there another place I need to comment out a line or ad a line in apache?
I have tried the default server ErrorDocument both commented out and not same issue both times.
did you check ErrorLog file ? maybe there you will have some detailed info about your problem?
Could it be that permisiion to file is wrong ?

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now