‘.jsp’ is a widely used format for webpages but sometimes your web hosting service does not support it and as a result, a .jsp page is unable to produce a proper appearance of the webpage and it shows some sort of coding, So following are some changes you need to perform so that your website a display .jsp pages as normal webpages.

[email protected][~]#vi /etc/httpd/conf/httpd.conf


Now search the domain name and remove the comment attribute from the following line.

Include “/usr/local/apache/conf/userdata/std/1/username/domainname/*.conf”

Make sure your save before exit

[email protected][~]# cd /usr/local/apache/conf/userdata/std/1/
[email protected][~]# mkdir username
[email protected][~]# cd username
[email protected][~]# mkdir domainname
[email protected][~]# cd domainname
[email protected][~]# vi cp_jkmount.conf


Now find the file ‘cp_jkmount.conf.’ in which you need to insert the following code.

<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
JkMount /*.do ajp13


Now you need to verify the entry in the tomcat configuration file.

[email protected][~]# vi /usr/local/jakarta/tomcat/conf/server.xml


After checking the entry you need to insert the following code in the same file.

<Host name=”domainname” appBase=”/home/username/public_html”>
<Context path=”” reloadable=”true” docBase=”/home/username/public_html” debug=”1″/>
<Context path=”/manager” debug=”0″ privileged=”true”

Make sure you save the file before you exit and now restart the tomcat.

[email protected][~]# /usr/local/jakarta/tomcat/bin/./shutdown.sh
[email protected][~]# /usr/local/jakarta/tomcat/bin/./startup.sh
[email protected][~]# /scripts/restartsrv tomcat

And now restart the httpd service

[email protected][~]# /etc/init.d/httpd stop
[email protected][~]# /etc/init.d/httpd startssl