BianchiDude said:
I have installed tomcat, how do I enable jsp for a domain?
I haven't used this for a while, but it should work:
In Cpanel Addon Modules, enable and install the module. It will install java (/scripts/installjava) and install Tomcat (/usr/local/jakarta/jakarta-tomcat-5.5.7/) as well as mod_jk. A username (root) and password (random chars - different every time) will be generated during the install process. Verify Tomcat is running with "ps ax | grep java" or "nmap localhost | grep 8080". Point Browser to
http://x.y.w.z:8080. Login, run some of the test jsp's, servlets, etc.
To enable mod_jk and have .jsp files parsed by Tomcat, edit server.xml (/usr/local/jakarta/jakarta-tomcat-5.5.7/conf/server.xml) and add a <Host> entry for every VirtualHost in the Apache httpd.conf. Example:
Code:
<Host name="domain.tld" debug="0" unpackWARs="true" appBase="/home/USERNAME/public_html">
<Context path=""
docBase="/home/USERNAME/public_html" debug="0"
crossContext="false"
reloadable="true" />
</Host>
(METHOD 1) In the Apache httpd.conf (/etc/httpd/conf/httpd.conf), edit the VirtualHost and add the following two lines:
Code:
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
(METHOD 2) Add the following for the entire system:
Code:
<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
<Location "/examples/WEB-INF/">
AllowOverride None
deny from all
</Location>
</IfModule>
Verify the following lines exist:
Code:
LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c
Include "/usr/local/apache/conf/jk.conf"
Add the following line below the other AddType's:
Restart Apache. Point your brower to
http://yourdomain.tld, you should see a jsptest.jsp file, click it and the world should be a better place. All workers.properties, jk.conf entries are suffient and autocreated by Cpanel upon installation of the Tomcat addon module.