How to enabled the .jsp page support for the domain

How to enabled the .jsp page support for the domain.
If the .jsp page is showing coding instead of real webpage then you need to check the server settings such as
For example
Domain name    = example.com
username       = test
Root directory = /home/test/public_html
1) root@server[~]#vi  /etc/httpd/conf/httpd.conf
Search domin name and remove the comment from the following line.
Include “/usr/local/apache/conf/userdata/std/1/username/example.com/*.conf”
save and exit
2)root@server[~]# cd /usr/local/apache/conf/userdata/std/1/
root@server[~]# mkdir test
root@server[~]# cd test
root@server[~]# mkdir example.com
root@server[~]# cd example.com
root@server[~]# vi cp_jkmount.conf
Enter the following code into the file
<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
JkMount /*.do ajp13
</IfModule>
root@server[~]# /etc/init.d/httpd stop
root@server[~]# /etc/init.d/httpd start
Then check the entry into the tomcat configuration file.
3) root@server[~]# vi /usr/local/jakarta/tomcat/conf/server.xml
Open above file and add the following code at the end of the file.
<Host name=”example.com” appBase=”/home/test/public_html”>
<Alias>www.example.com</Alias>
<Context path=”” reloadable=”true” docBase=”/home/test/public_html” debug=”1″/>
<Context path=”/manager” debug=”0″ privileged=”true”
docBase=”/usr/local/jakarta/tomcat/server/webapps/manager”>
</Context>
</Host>
Save and exit
root@server[~]#/usr/local/jakarta/tomcat/bin/./shutdown.sh
root@server[~]#/usr/local/jakarta/tomcat/bin/./startup.sh
root@server[~]#/script/restartsrv tomcat
Note : Please replace the “test”  with original Username and the “example.com” with original domain name .

Leave a Comment