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

Posted on 2005-04-11
Last Modified: 2013-11-18
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"
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
Question by:jbrashear72
    LVL 19

    Expert Comment

    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.
    LVL 2

    Accepted Solution

    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.
    LVL 3

    Author Comment

    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.
    LVL 19

    Expert Comment

    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
    LVL 3

    Author Comment

    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.
    LVL 19

    Expert Comment

    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

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now