Apache custom error pages not working
I have a virtualhost setup and I wanted to make custom error pages for it and only it. I don't want the entire apache server host collection to display these types of error pages. I have my virtualhost setup like this
Code:
<IFModule mod_log_config> Code:
chown apache:apache crash.html |
I ran into a similar problem recently. It may help to view the log file for apache (mine was /var/log/httpd/{access.log,error.log}).
My issue was that apache was looking for my file starting at the DocumentRoot. So in my httpd.conf file my DocumentRoot was /var/www/html but I wanted it to look at /var/www/testDir/sample.html The error log said /var/www/html/testDir/sample.html doesn't exist! I resolved my issue by putting a symbolic/soft link in the /var/www/html to the testDir Hope that can get you started....or help somehow |
As Linux MR pointed out the ErrorDocument directive if it starts with a / is in relation to the DocumentRoot directive. In your case the file /var/www/html/crash.html would be called on a 404.
How did you restart the apache? I sometime experienced that apache2ctl -k restart does not take all changes in effect. Mostly with rewrite rules. I have to stop and then restart the service. |
All times are GMT -5. The time now is 01:00 AM. |