Discussions

Performance and scalability: tomcat w/ different connector

  1. tomcat w/ different connector (7 messages)

    hi here;
    i am doing a normal (testing) java web app. currently i am running tomcat4.1 on linux. i have change the port from 8080 to 8888 and i am using context path to point to the source (jsp file) directory.

    so, the port 8080 will have a context path look like this:


    <Context path="/jsp" docBase="/home/swx/jspAdm" debug="0"
                    reloadable="true" crossContext="true"/>

    so the connection url to point to it will be
    http:ip:8888/jsp/login.jsp

    my question now is, i have put another version (slightly change the content of jsp) in the dir "/home/csb/jspAdm" is it possible if i want to access it like this

    http:ip:7777/jsp/login.jsp

    how do i conf in my server.xml???

    Threaded Messages (7)

  2. tomcat can't do that[ Go to top ]

    I think tomcat can't do that.
    It only supply one port to access when starting.
  3. any idea then?[ Go to top ]

    i try b4 to use port 7777, it will still go to the context path which i declared as "/home/swx/jspAdm"

    coz wat i want is
    port : 7777
    refer: /home/csb/jspAdm

    port : 8888
    refer: /home/swx/jspAdm
  4. any idea then?[ Go to top ]

    If you want to use different ports for different apps, then you should be running two instances of Tomcat. One listening in 8888 and the other in 7777. but you cannot share the common session et al.
  5. any idea then?[ Go to top ]

    hi there;

    appreciate for ur suggestion.

    would it be possible to show me how to do that? (the 2 instance for tomcat thingy?) or maybe u can point me to the url w/ sample?

    10s ;)
  6. Server has 1..n service
    Service has n connectors and 1 engine
    Engine has 1..n hosts
    Host has 1..n context

    All connectors belong to service and can reach all host and context underneath.

    For 2 connectors to reach only their own host/context, you need 2 services with 1 connector.

    If you really want only 1 service with 2 connectors over 1 host with 2 contexts, you must create your own javax.servlet.Filter in front of your contexts, one that returns 403 (forbidden) if server port doesn't match the context path requested.
  7. Hi Quartz;

    is it possible u able to show me ur example?

    i really need ur guidance.

    appreciate ;)

    rgd/ yoke yew
  8. sample conf[ Go to top ]

    <Server port="8005" shutdown="SHUTDOWN" debug="1">
    [ ....... std crap: loggers, listeners, naming stuff .....]

    <Service name="aaaaa">
    <Connector port="7777" ...... />
    <Engine name="TrueSight" defaultHost="localhost">
    <Host name="localhost" appBase="/home/csb" ....... >
    <Context path="/jsp" docBase="/home/csb/jspAdm" ...... />
    </Host>
    </Engine>
    </Service>

    <Service name="bbbbb">
    <Connector port="8888" ....... />
    <Engine name="TrueSight" defaultHost="localhost">
    <Host name="localhost" appBase="/home/swx/jspAdm" ......... >
    <Context path="/jsp" docBase="/home/swx/jspAdm" ........ />
    </Host>
    </Engine>
    </Service>
    </Server>