pls help regarding instruction

Discussion in 'Java' started by jayipee@gmail.com, Feb 22, 2006.

  1. Guest

    I have installed the latest version of knoppix. it's a debian based
    distro. now I want to run tomcat on my server to run servlet.

    I have already installed tomcat4 but in the instructions given from
    this site: http://cymulacrum.net/writings/tomcat4/c260.html I don't
    know what it means under this line: 4.2.2. Adding a Context inside
    server.xml. I look for server.xml and I can see it under /etc/tomcat4/
    and also in /var/lib/tomcat4/conf/server.xml which makes me confuse
    which one to edit or if this is the right file to edit. When looking
    through the file I don't know also what to put there. The instruction
    to put to that file is this:

    <!-- MyFirst Context -->

    <Context path="/MyFirst" docBase="MyFirst" debug="0" reloadable="true"
    />

    And also the web.xml under this line 4.2.3. Creating a web.xml file for
    the web application.

    I can put my server.xml and web.xml here if you like.

    Thanks in advance.
    , Feb 22, 2006
    #1
    1. Advertising

  2. SMC Guest

    On Wed, 22 Feb 2006 11:52:32 +1100, jayipee wrote:

    > I have installed the latest version of knoppix. it's a debian based
    > distro. now I want to run tomcat on my server to run servlet.
    >
    > I have already installed tomcat4 but in the instructions given from this
    > site: http://cymulacrum.net/writings/tomcat4/c260.html I don't know what
    > it means under this line: 4.2.2. Adding a Context inside server.xml. I
    > look for server.xml and I can see it under /etc/tomcat4/ and also in
    > /var/lib/tomcat4/conf/server.xml which makes me confuse which one to
    > edit or if this is the right file to edit.


    You'll probably find that /var/lib/tomcat4/conf is a symlink to
    /etc/tomcat4, so whichever you edit, it's the same file.

    > When looking through the file
    > I don't know also what to put there. The instruction to put to that file
    > is this:
    >
    > <!-- MyFirst Context -->
    >
    > <Context path="/MyFirst" docBase="MyFirst" debug="0" reloadable="true"
    > />


    Add the above line inside the <Host> tags in the server.xml

    You'll probably have an entry similar to:

    <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">

    so just put your Context after that. There may already be an example one
    in there, so you could add it before that one.

    > And also the web.xml under this line 4.2.3. Creating a web.xml file for
    > the web application.


    This is a file you need to create. Just create the file and drop in the
    content they provide. This file will go in

    $CATALINA_HOME/webapps/MyFirst/WEB-INF/


    --
    Sean

    Work expands to occupy the time available - Parkinson's 1st law
    SMC, Feb 22, 2006
    #2
    1. Advertising

  3. Guest

    Thank you very much for the reply. I can't find this line under host:

    <!-- Tomcat Root Context -->
    <!--
    <Context path="" docBase="ROOT" debug="0">
    -->

    So I added it together with:

    <!-- MyFirst Context -->

    <Context path="/MyFirst" docBase="MyFirst" debug="0" reloadable="true"
    />

    The instruction also said that I have to access that on port 8080 but
    after running startup.sh can running netstat I can't find port 8080
    opened.

    And also what is the right path of JAVA_HOME ? because when I run
    startup.sh it says:

    The JAVA_HOME environment variable is not defined
    This environment variable is needed to run this program

    I don't know if this is the right command to enter in the terminal:

    export JAVA_HOME=/usr/lib/kaffe/

    Thanks again.


    SMC wrote:
    > On Wed, 22 Feb 2006 11:52:32 +1100, jayipee wrote:
    >
    > > I have installed the latest version of knoppix. it's a debian based
    > > distro. now I want to run tomcat on my server to run servlet.
    > >
    > > I have already installed tomcat4 but in the instructions given from this
    > > site: http://cymulacrum.net/writings/tomcat4/c260.html I don't know what
    > > it means under this line: 4.2.2. Adding a Context inside server.xml. I
    > > look for server.xml and I can see it under /etc/tomcat4/ and also in
    > > /var/lib/tomcat4/conf/server.xml which makes me confuse which one to
    > > edit or if this is the right file to edit.

    >
    > You'll probably find that /var/lib/tomcat4/conf is a symlink to
    > /etc/tomcat4, so whichever you edit, it's the same file.
    >
    > > When looking through the file
    > > I don't know also what to put there. The instruction to put to that file
    > > is this:
    > >
    > > <!-- MyFirst Context -->
    > >
    > > <Context path="/MyFirst" docBase="MyFirst" debug="0" reloadable="true"
    > > />

    >
    > Add the above line inside the <Host> tags in the server.xml
    >
    > You'll probably have an entry similar to:
    >
    > <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
    >
    > so just put your Context after that. There may already be an example one
    > in there, so you could add it before that one.
    >
    > > And also the web.xml under this line 4.2.3. Creating a web.xml file for
    > > the web application.

    >
    > This is a file you need to create. Just create the file and drop in the
    > content they provide. This file will go in
    >
    > $CATALINA_HOME/webapps/MyFirst/WEB-INF/
    >
    >
    > --
    > Sean
    >
    > Work expands to occupy the time available - Parkinson's 1st law
    , Feb 22, 2006
    #3
  4. SMC Guest

    On Wed, 22 Feb 2006 13:23:11 +1100, jayipee wrote:

    > Thank you very much for the reply. I can't find this line under host:
    >
    > <!-- Tomcat Root Context -->
    > <!--
    > <Context path="" docBase="ROOT" debug="0">
    > -->
    >
    > So I added it together with:
    >
    > <!-- MyFirst Context -->
    >
    > <Context path="/MyFirst" docBase="MyFirst" debug="0" reloadable="true"
    > />
    >
    > The instruction also said that I have to access that on port 8080 but
    > after running startup.sh can running netstat I can't find port 8080
    > opened.


    Look for the <Connector> tags in your server.xml. Make sure there is one
    and it's uncommented. It should be something like

    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8080" minProcessors="5" maxProcessors="15"
    enableLookups="false" redirectPort="8443" acceptCount="10"
    debug="0" connectionTimeout="10000"
    useURIValidationHack="false"/>

    Check the port attribute value.

    > And also what is the right path of JAVA_HOME ? because when I run
    > startup.sh it says:
    >
    > The JAVA_HOME environment variable is not defined This environment
    > variable is needed to run this program
    >
    > I don't know if this is the right command to enter in the terminal:
    >
    > export JAVA_HOME=/usr/lib/kaffe/


    You should probably add this to your shell profile (e.g. .bash_profile).

    --
    Sean

    The users that I support would double-click on a landmine to see what it
    did. --slashdot poster
    SMC, Feb 23, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eqbal Z
    Replies:
    3
    Views:
    5,085
    Eqbal
    Nov 16, 2003
  2. Kirby Turner

    Re: Proper Instruction Format

    Kirby Turner, Aug 30, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    391
    Kirby Turner
    Aug 30, 2004
  3. Simon G Best
    Replies:
    3
    Views:
    311
  4. Colin J. Williams
    Replies:
    0
    Views:
    615
    Colin J. Williams
    Nov 9, 2006
  5. Replies:
    2
    Views:
    1,337
    Mike Young
    Jun 10, 2012
Loading...

Share This Page