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.

Location of tomcat files?

Discussion in 'General Discussion' started by labahost, Dec 29, 2008.

  1. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Where is location of tomcat log files on CPanel server?
    It seems like there is no logs directory in /usr/local/jakarta/tomcat/
    Is there another place where I can find logs?
    I have a problem with servlets stopping working each few weeks and needing a tomcat restart so I would like to look in logs what is the problem.
     
    #1 labahost, Dec 29, 2008
    Last edited: Dec 30, 2008
  2. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    There should be logs in /usr/local/jakarta/tomcat/logs/catalina.out

    Since Tomcat on cPanel is done through mod_jk with Apache, it may be unfamiliar territory for some. I'd recommend taking a look at this overview of our Tomcat implementation:

    http://www.cpanel.net/conference/08/files/Tomcat.pdf
     
  3. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    I have no directory logs in /usr/local/jakarta/tomcat
    What should I do?
     
  4. cPanelStephen

    cPanelStephen Active Member
    Staff Member

    Joined:
    Aug 7, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    If the directory is missing, you can recreate it by executing:

    mkdir /usr/local/jakarta/tomcat/logs
    /scripts/restartsrv_tomcat

    When Tomcat restarts, it will recreate all of the necessary log files in that directory, and begin logging to them. If this does not work, please open a support request, and our technicians will log in and investigate further.
     
  5. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    It worked, now I have log files there, I will wait for the app to hang again and see what logs will show.
    Thank you.
     
  6. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    It was a out of memory exception.
    Is there a way to debug why is it?

    Also how to increase allocated memory for Tomcat?
     
  7. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    You can customize your min and max memory by placing memory directives in /var/cpanel/tomcat.options

    max is -Xmx${mem}M i.e. for 200MB use -Xmx200M

    min is -Xms${mem}M i.e. for 100MB use -Xms100M

    after setting these values, run /scripts/restartsrv_tomcat

    Note that Tomcat takes a while to restart as it has to load all applications into memory during the restart. You should also note that Tomcat pre-allocates memory so that when you increase it's maximum memory limit, you're taking memory away from other server applications.
     
  8. labahost

    labahost Well-Known Member

    Joined:
    May 4, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    there is no tomcat.options in /var/cpanel is there a file structure or it should just contain command line parameters for tomcat?
     
  9. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    You should add each command line parameter to the file (1 per line) and they will be added to the startup of Tomcat.
     
  10. asiams

    asiams Well-Known Member

    Joined:
    May 28, 2003
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hokkaido, JAPAN
  11. mailhaim

    mailhaim Registered

    Joined:
    Feb 8, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    With customers under shared hosting environment, is it possible for each customer/account to view the tomcat logs for its own web application(s)?

    If yes, can you elaborate how?

    Thanks
     
  12. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page