The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I have installed tomcat, how do I enable jsp for a domain?

Discussion in 'General Discussion' started by BianchiDude, Sep 7, 2005.

  1. BianchiDude

    BianchiDude Well-Known Member
    PartnerNOC

    Joined:
    Jul 2, 2005
    Messages:
    619
    Likes Received:
    0
    Trophy Points:
    16
    I have installed tomcat, how do I enable jsp for a domain?
     
  2. destr0yr

    destr0yr Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kelowna, BC.
    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:
    Code:
    	AddType text/html .jsp
    
    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.
     
  3. BianchiDude

    BianchiDude Well-Known Member
    PartnerNOC

    Joined:
    Jul 2, 2005
    Messages:
    619
    Likes Received:
    0
    Trophy Points:
    16
    Is there a way to do it from WHM?
     
  4. destr0yr

    destr0yr Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kelowna, BC.
    Not that I am aware of (apparently "no" is too short of a post for these forums).

    ... unless you have a plugin through WHM that lets you edit files directly, such as File Manager/Console for WHM - http://www.configserver.com/cp/fmconsole.html
     
  5. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Under the Account Functions in whm -> Install Servlets, that is for adding jsp/servlet support to an account.
     
  6. ghazizadeh

    ghazizadeh Registered

    Joined:
    Sep 13, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    in account function i don't have "Install Servlets" option ,please help me and tell me what i can do
     
  7. destr0yr

    destr0yr Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kelowna, BC.
    Did tomcat install? Is it running? Try reinstalling it... or go to /usr/local/cpanel/modules-install/tomcat-Linux-i386/ and run the install script. If the install servlet still doesn't show up, try /scripts/installservlet (SSH as root) or https://your.hostname.tld:2087/scripts/servletlist
     
  8. ghazizadeh

    ghazizadeh Registered

    Joined:
    Sep 13, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    thanks for your answer,
    i reinstalled tomcat but "install servlets" not added to acount function,
    and i tryd to access with this link:

    https://myserverIP:2087/scripts/servletlist

    but i get this error:

    "Sorry you must install the cPanel java servlets addon module"
     
  9. destr0yr

    destr0yr Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kelowna, BC.
    Any my other two suggestions? If you want this to work you're going to need to try all possibilities.

    If a re-install doesn't work, goto the directory above and run the install script manually. You might even see some errors if it fails. Goodluck. I won't be replying again.
     
  10. FeeL

    FeeL Well-Known Member

    Joined:
    Apr 17, 2004
    Messages:
    135
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Rio de janeiro
    cPanel Access Level:
    Reseller Owner
    404

    Everithing here seems to be ok, but when I point my browser to the jsptest.jsp IO recieve the 404 page of tomcat..

    But the file is there!

    What can be wrong?

    sds
     
  11. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Go to /usr/local/jakarta/tomcat/conf/server.xml and make sure that

    are in the proper order (as above) at the end of the file. If not, fix them and restart tomcat.
     
Loading...

Share This Page