June 2020
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

WordPress Quotes

Be Content with what you have; rejoice in the way things are. When you realize there is nothing lacking, the whole world belongs to you.
Lao Tzu
June 2020
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
2930  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (270)
centos8 (3)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (2)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Ubuntu (1)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

0 visitors online now
0 guests, 0 bots, 0 members

Hit Counter provided by dental implants orange county

Apache – Custom Error Page

Error handling is one of the important parts when running a server. The application running inside the server provides the necessary services to the client but it is the responsibility of the server to serve custom pages for errors. In this article we will see how we can configure custom error page 404 for Apache web server along with Tomcat.

  1. Create a 404 error page as

<html>

<head> Hello This a 404 Error page </head>

<body bgcolor=”green”>

</h3> this is green and 404 </h3>

</body>

</html>

Copy the file to /var/www/webroot/ROOT/ location

  1. Once the file is created, configure Apache Configuration file as

<VirtualHost *:80>

ServerAdmin webmaster@dummy-host.example.com

DocumentRoot /var/www/webroot/ROOT/

 ErrorDocument 404 /404.html

ServerName dummy-host.example.com

ErrorLog logs/dummy-host.example.com1-error_log

CustomLog logs/dummy-host.example.com1-access_log common

ProxyRequests Off

ProxyPreserveHost On

<Proxy *>

Order deny,allow

Allow from all

Options +Indexes

</Proxy>

ProxyPass /application1 http://localhost:8080/myApp/

ProxyPass /application2 http://localhost:8080/Sample-app/test.html

ProxyPassReverse /application1/ http://localhost:8080/myApp/

ProxyPassReverse /application2/ http://localhost:8080/Sample-app/test.html

</VirtualHost>

All we need to do is add an ErrorDocument entry to our http.conf file. On the ErrorDocument line, we specify the error code, which in this case is a 404. After that, we can specify either a text message or the page to display and then file to be displayed ( 404.html ). Restart the Apache server.

Now once we access a different path, we see the 404 error page as,

apache

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam