Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    May 2004
    Posts
    56

    Default Tomcat directory structure

    What is tomcat directory structure?
    After I've installed Tomcat with easyapache 3 and clicked "install servlets" for an account, so now I can run jsp pages, but how can I install servlets, what is the directory structure?
    Is it possible to deploy war files with tomcat? (I was able to do it with modresin)

  2. #2
    Member
    Join Date
    Sep 2004
    Location
    inside a catfish
    Posts
    963
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by labahost View Post
    What is tomcat directory structure?
    After I've installed Tomcat with easyapache 3 and clicked "install servlets" for an account, so now I can run jsp pages, but how can I install servlets, what is the directory structure?
    Is it possible to deploy war files with tomcat? (I was able to do it with modresin)
    If you have installed Tomcat via WHM, then under WHM / Account Functions you'll find the option to 'Install Servlets'

    If you click on 'Install Servlets', and then select a domain and click Install, it will create the following folder structure in the public_html directory of that account:

    /WEB-INF
    /WEB-INF/classes
    /WEB-INF/lib

    It will also install a jsptest.jsp file in public_html

    In your httpd.conf it will add the following under the VirtualHost directive for that domain:
    <IfModule mod_jk.c>
    JkMount /*.jsp ajp13
    JkMount /servlet/* ajp13
    JkMount /servlets/* ajp13
    </IfModule>

    On one site where a customer installed a Java servlet they installed it in a subdirectory called /billing. They then created /billing/WEB-INF , /billing/WEB-INF/lib , /billing/WEB-INF/classes and /billing/WEB-INF/lib. Their .jar files are in /billing/WEB-INF/lib. Their index.jsp file is in /billing/index.jsp.

    I'm not a Java person, so I don't know how things are supposed to go. But it looks like you can put your .jsp files in any directory and just make sure you have a WEB-INF under that directory containing all of your java classes, jar files, etc. in the appropriate directories.


    Mike
    Last edited by mtindor; 10-01-2007 at 09:10 AM.

  3. #3
    Member
    Join Date
    May 2004
    Posts
    56

    Default

    Quote Originally Posted by mtindor View Post
    If you have installed Tomcat via WHM, then under WHM / Account Functions you'll find the option to 'Install Servlets'

    In your httpd.conf it will add the following under the VirtualHost directive for that domain:
    <IfModule mod_jk.c>
    JkMount /*.jsp ajp13
    JkMount /servlet/* ajp13
    JkMount /servlets/* ajp13
    </IfModule>

    Mike
    Thank you very much Mike.
    Does anybody know if I'll modify that fragment in http.conf to add something like this:
    JkMount /*.* ajp13 will modification persist after CPanel update? Or is there another way to launch servlets from root, like jsps? (may be by somehow modifying local web.xml ?)

  4. #4
    Member
    Join Date
    May 2004
    Posts
    56

    Default update

    I think that Mike response was regarding Tomcat added by previous version of CPanel as plugin. (what I mean: there is no ajp13 substring in httpd.conf)
    Latest version of CPanel with Easyapache 3 looks like have a completely different way of configuring tomcat with apache. Can anybody post some help on it?
    Last edited by labahost; 10-02-2007 at 08:21 AM.

  5. #5
    Member
    Join Date
    May 2004
    Posts
    56

    Default

    Sorry for replying to me again, but it seems that I found a solution:
    You should edit the file in
    /usr/local/apache/conf/userdata/std/$version_of_apache/$username/$domainname/

    where
    $version_of_apache is 1 for 1.3 and 2 for apache 2.0 and 2.2

    the file name is cp_jkmount.conf

    then you should restart httpd

  6. #6
    Member
    Join Date
    May 2003
    Location
    Hokkaido, JAPAN
    Posts
    91

    Default New Version of Tomcat

    I think that Mike response was regarding Tomcat added by previous version of CPanel as plugin. (what I mean: there is no ajp13 substring in httpd.conf)
    Latest version of CPanel with Easyapache 3 looks like have a completely different way of configuring tomcat with apache. Can anybody post some help on it?
    You are right.

    Here is the newly added lines when Install Servlet is done to a domain:

    Include "/usr/local/apache/conf/userdata/*.conf"
    Include "/usr/local/apache/conf/userdata/*.owner-root"
    Include "/usr/local/apache/conf/userdata/std/*.conf"
    Include "/usr/local/apache/conf/userdata/std/*.owner-root"
    Include "/usr/local/apache/conf/userdata/std/2/*.conf"
    Include "/usr/local/apache/conf/userdata/std/2/*.owner-root"
    Include "/usr/local/apache/conf/userdata/std/2/aljlmnbe/*.conf"
    Include "/usr/local/apache/conf/userdata/std/2/aljlmnbe/seishojuku.jp/*.conf"

    It just adds bunch of Include statements in httpd.conf.

    hope this helps.

    asiams

  7. #7
    Member FeeL's Avatar
    Join Date
    Apr 2004
    Location
    Rio de janeiro
    Posts
    142
    cPanel/Enkompass Access Level

    Reseller Owner

    Default got it, but the /servlet/ is not working

    Now I understood how apache 2.x works with tomcat.
    I hope that this gets stable from now on

    Yet, my domains are not working properly with the www.domain/servlets, showing this

    HTTP Status 404 - /servlets/

    type Status report

    message /servlets/

    description The requested resource (/servlets/) is not available.
    Apache Tomcat/5.5.25

    What else can be checked?

    Thanks!
    -----------
    FeeL Buarque
    SysAdmin.

Similar Threads & Tags
Similar threads

  1. Directory Structure
    By fkatzenb in forum Data Protection
    Replies: 4
    Last Post: 12-30-2009, 07:48 PM
  2. c panel directory structure
    By webofunni in forum New User Questions
    Replies: 0
    Last Post: 05-06-2007, 12:22 AM
  3. Directory Structure?
    By moetus in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-27-2006, 07:23 PM
  4. Subdomain Directory Structure
    By alanpollenz in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-01-2004, 01:54 PM
  5. Directory Structure
    By Soheil in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-26-2003, 05:19 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube