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.

About JSP (Tomcat)

Discussion in 'General Discussion' started by Domenico, Oct 4, 2002.

  1. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    360
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    I installed Tomcat for a user and now he asks me about where his java classpath is.

    I really don't have a clue what he is asking because we don't have any experiences with Tomcat whatsoever so I hope someone can give me the answer.

    Thank you!
    Domenico
     
  2. portman

    portman Well-Known Member

    Joined:
    May 23, 2002
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    We just installed a few weeks ago...

    I think you will get what you want if to SSH into the server (as root) and type this:

    echo $CLASSPATH

    Case IS important.
     
  3. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    360
    Likes Received:
    0
    Trophy Points:
    16
    Hi Portman,

    I will send the output to the client and hope it will be what he needed.

    Thanks for helping!
    Domenico
     
  4. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    360
    Likes Received:
    0
    Trophy Points:
    16
    I just got a reply from the client and he says that this is the classpath for the Java JRE engine.

    He needs all the info about WEB-INF.
    Does he need to create that himself?
     
  5. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Create this directory structure in his /public_html directory:

    /WEB-INF/classes

    Then restart Tomcat. The customer can then put his servlets in the /classes subdirectory and call them like so (assuming you added servlet support to his domain in WHM):

    http://www.hisdomain.com/servlet/NameOfServlet


    Jaz
     
  6. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    360
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for replying.
    How must I chmod the new directories?
    755?
     
  7. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
  8. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    360
    Likes Received:
    0
    Trophy Points:
    16
    I'm awaiting the clients reply on this and will let you know if it worked for him...
     
  9. Vital

    Vital Active Member

    Joined:
    Nov 17, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Here's another very important thing:

    if you have installed Tomcat 4.x Plugin from CPanel, you will need to edit /scripts/gentomcatlist

    find this line in it:

    &Host name=&$nhost&&
    &Context path=&& reloadable=&true& docBase=&$nhosts{$nhost}& debug=&1&/&
    &/Host&

    and change to this:

    &Host name=&$nhost& appBase=&$nhosts{$nhost}&&
    &Context path=&& reloadable=&true& docBase=&$nhosts{$nhost}& debug=&1&/&
    &/Host&

    then execute this file, and restart tomcat.

    Otherwise his JSP pages will work,but he won't be able to run servlets at all.

    Note to CPanel DEV. Team - would you be so kind to include this little mod by default? ;)
     
  10. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Afraid you are wrong there Vital. We don't have the appBase parameter on any of our accounts and everyone's servlets work just fine.

    Jaz
     
  11. Vital

    Vital Active Member

    Joined:
    Nov 17, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Mmm... And war files too? Have you changed anything else after default installation? 'Cause it didn't worked, till i figured out this appBase parameter in server.xml...
     
  12. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Haven't tried WAR files yet. Do you have them working? If so, how are you calling them from a URL? I'd like to do a test on my machine without the appBase.

    Jaz
     
  13. Vital

    Vital Active Member

    Joined:
    Nov 17, 2001
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    [quote:c9e135e671][i:c9e135e671]Originally posted by jsteel[/i:c9e135e671]
    Haven't tried WAR files yet. Do you have them working? If so, how are you calling them from a URL? I'd like to do a test on my machine without the appBase.
    [/quote:c9e135e671]

    Yeah i do. ;) Here's the deal:

    you put the file into public_html, restart tomcat, and file gets unpacked into directory of it's name.

    then you'll need to add mapping, like:

    JkMount /warname/* ajp13

    into virtualhost...

    And it works just fine. ;))


    A question to everyone: any idea, why i can't use JkMount through .htaccess? ;) It would be extremely useful thing to have for customers.
     
  14. moronhead

    moronhead Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    706
    Likes Received:
    0
    Trophy Points:
    16
    [quote:838b6e0e21][i:838b6e0e21]Originally posted by Vital[/i:838b6e0e21]

    you put the file into public_html, restart tomcat, and file gets unpacked into directory of it's name.

    ......
    [/quote:838b6e0e21]
    Does that mean every time the client puts a new WAR file in his web root you have to restart tomcat?
     
  15. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    [/quote]
    Does that mean every time the client puts a new WAR file in his web root you have to restart tomcat?[/quote]

    Yes. Not very effective obviously. I'm also wondering what kind of effect unPack=false would have on Vital's setup. Vital, have you tried this yet? Would this allow new version to be uploaded and read without a restart?

    Jaz
     
  16. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    When we tried to implement that little mod to the gentomcatlist script we get the following error and Tomcat dies. Our users cannot get jsp/servlets to execute properly on a sub-domain.

    Scanning httpd.conf...X..X..X.X..X..X..X..X..X...X..X..X.X...X..X.X...X.X...X.X...X
    Using CATALINA_BASE: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
    Using CATALINA_HOME: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
    Using CATALINA_TMPDIR: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/temp
    Using JAVA_HOME: /usr/local/jdk
    &b&ERROR reading /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/conf/server.xml
    At Element type &Host& must be followed by either attribute specifications, &&& or &/&&.
    &/b&
    Catalina.stop: org.xml.sax.SAXException: Element type &Host& must be followed by either attribute specifications, &&& or &/&&.
    org.xml.sax.SAXException: Element type &Host& must be followed by either attribute specifications, &&& or &/&&.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:979)
    at org.xml.sax.helpers.XMLReaderAdapter.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:228)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:822)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:683)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
    httpd: no process killed
    Using CATALINA_BASE: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
    Using CATALINA_HOME: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build
    Using CATALINA_TMPDIR: /usr/local/jakarta/jakarta-tomcat-4.0.3-src/build/temp
    Using JAVA_HOME: /usr/local/jdk
     
  17. futuron

    futuron Active Member

    Joined:
    Jul 26, 2004
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Where do I enable that support?
     
  18. futuron

    futuron Active Member

    Joined:
    Jul 26, 2004
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    I think that someone knows this. :confused:
     
Loading...

Share This Page