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

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

Now search domain name and remove 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
</IfModule>

Now you need to verify the entry in 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”>
<Alias>www.domainname</Alias>
<Context path=”” reloadable=”true” docBase=”/home/username/public_html” debug=”1″/>
<Context path=”/manager” debug=”0″ privileged=”true”
docBase=”/usr/local/jakarta/tomcat/server/webapps/manager”>
</Context>
</Host>

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