Isn’t .jsp Page Supported On Your Website?

‘.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.

root@server[~]#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

root@server[~]# cd /usr/local/apache/conf/userdata/std/1/
root@server[~]# mkdir username
root@server[~]# cd username
root@server[~]# mkdir domainname
root@server[~]# cd domainname
root@server[~]# 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 the tomcat configuration file.

root@server[~]# 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.

root@server[~]# /usr/local/jakarta/tomcat/bin/./shutdown.sh
root@server[~]# /usr/local/jakarta/tomcat/bin/./startup.sh
root@server[~]# /scripts/restartsrv tomcat

And now restart the httpd service

root@server[~]# /etc/init.d/httpd stop
root@server[~]# /etc/init.d/httpd startssl