< CUSTOM ERROR pages with Virtual Hosts>

Before you start, you need to make 5 custom error pages.
Make them as standard html pages in your favourite editor, and name them as follows.

error400.html 	(Bad Request)
error401.html 	(Authentification Required)
error403.html 	(Access Denied)
error404.html 	(Page Not Found)
error500.html 	(Internal Server Error)

now create and save them into the folder /errordocuments/ of your website

If you include an image, make sure its "href" is an absolute URL

eg http://www.yoursite.com/errordocuments/picture.jpg
and not /picture.jpg

If you didn't create the files on your web server, transfer them now:
Copy the files to your virtual hosts website eg /srv/www/htdocs/yoursite.com/errordocuments/

================================================================
Open in an Editor the following file:

/etc/apache2/vhosts/yoursite.conf

yoursite.conf should look similar to this:

<VirtualHost *:80>
ServerName www.yoursite.com
DocumentRoot /www/yoursite.com
</VirtualHost>

Now add the following lines:

<VirtualHost *:80>
ErrorDocument 400 /errordocuments/error400.html
ErrorDocument 401 /errordocuments/error401.html
ErrorDocument 403 /errordocuments/error403.html
ErrorDocument 404 /errordocuments/error404.html
ErrorDocument 500 /errordocuments/error500.html
ServerName www.yoursite.com
DocumentRoot /www/yoursite.com
</VirtualHost>

================================================================

STOP & START APACHE

<END>