Solved

Tomcat virtual server addition

Posted on 2004-10-28
461 Views
Last Modified: 2010-03-17
Hi

I have Tomcat v5 installed running on port 80 which is my production version.  I wanted to run another version of tomcat on port 8080 for a development version of my code on the same box.

How can I create a virtual server to accomplish this?
0
Question by:fareedakhan
    3 Comments
     
    LVL 19

    Accepted Solution

    by:
    add following line into your server.xml just after <Connector port="80"...../> element:
        <Connector port="8080"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" redirectPort="8443" acceptCount="100"
                   debug="0" connectionTimeout="20000"
                   disableUploadTimeout="true" />

    Your server will listen then in ports 80 and 8080
    0
     

    Author Comment

    by:fareedakhan
    Thanks!

    How can I direct the different ports to different webapp folders?
    0
     
    LVL 19

    Expert Comment

    by:ramazanyich
    Ok. Now it is more clear.
    So you have following config for a moment (I show only part which is important):
    <Server .....>
    ..
        <Service name="Catalina">
        <Connector port="80"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" redirectPort="8443" acceptCount="100"
                   debug="0" connectionTimeout="20000"
                   disableUploadTimeout="true" />
        <Engine name="Catalina" defaultHost="localhost" debug="0">
         ....
          <Host name="localhost" debug="0" appBase="webapps"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false">
            ....
            </Host>
         </Engine>
        </Service>
    </Server>

    It means that you have a Service which has connector on port 80 and invokes applications for host with appbase on webapps dir.

    If you want to have another listener for another appBase directory you should copy element (and subelements) <Service> and change port number of conenctor, name of service and appBase for <Host> element. Example:

       <Service name="Catalinadev">
        <Connector port="8080"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" redirectPort="8443" acceptCount="100"
                   debug="0" connectionTimeout="20000"
                   disableUploadTimeout="true" />
        <Engine name="Catalinadev" defaultHost="localhost" debug="0">
         ....
          <Host name="localhost" debug="0" appBase="webappsdev"
           unpackWARs="true" autoDeploy="true"
           xmlValidation="false" xmlNamespaceAware="false">
            ....
            </Host>
         </Engine>
        </Service>

    In that eample appBase will be webappsdev.

     
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
    This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
    This video Micro Tutorial is the first in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles al…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now