Configuring IIS for Multiple Tomcat instances

Post any questions regarding Installing or Upgrading Ebase, including problems starting up the Ebase Xi Server or Designer

Moderators: Jon, Steve, Ian, Dave

User avatar
Andy McMaster
Ebase User
Posts: 33
Joined: Fri Feb 29, 2008 12:08 pm
Location: Newcastle upon Tyne
Contact:

Configuring IIS for Multiple Tomcat instances

#1

Postby Andy McMaster » Thu Apr 17, 2008 4:40 pm

Hi,

I have three instances of Tomcat running, one for each of my Ebase Live (Port 3030), Test (port 3031) and Dev (Port 3032). I'm using IIS as web listener and have successfully installed ISAPI so that when I have just the Live system running IIS correctly serves the default install of Ebase.

What I know need to do is get IIS to serve when all three Tomcat instances are running.

I'm not sure on how this should work. I can see the possibility of adding additional worker settings for the ISAPI connector and these seem to allow me to specify the port as well.

Do I need to set a different connector port for each instance - rather than 8009 - and do I need to create separate virtual directories in IIS e.g. dev or test and use these to direct to the correct Tomcat instance?

I'd appreciate some pointers if anyone has tried this as the Tomcat/Apache documentation seems to have similar configs but nothing that quite fits/works.

Cheers

Andy
0 x
<b>Do not despise the snake for having no horns for who is to say it will not become a dragon</b>

ehmd
Ebase User
Posts: 53
Joined: Thu Sep 13, 2007 9:02 am
Contact:

#2

Postby ehmd » Fri Apr 18, 2008 10:49 am

Andy,

To get this to work as you want to, you will need 3 different webapp urls.
You only need one 'virtual directory' on IIS which loads the ISAPI Connector.

e.g. Live http://localhost/ufs/, Test http://localhost/ufstest/, Dev http://localhost/ufsdev

*** Before making any changes, ensure IIS and Ebase instances are not running ***

The first thing you need to do is re-configure each tomcat instance to listen on a different port for the Isapi Connector.

In your Tomcat / Conf / server.xml amend the entry :-

Code: Select all

    
<Connector port="8009" 
               enableLookups="false" redirectPort="3443" protocol="AJP/1.3" tomcatAuthentication="false"/>
Use a unique port for each instance, e.g. Live - 3009, Test - 3019, Dev - 3029

If you are using an SSL connection as well, ie https://localhost/ you will need unique port numbers as well on each instance i.e. replace the 3443 port.

Now you need amend your connector definition files normally in
C:\Program Files\Apache Software Foundation\tomcat_connector\conf\ directory :-

uriworkermap.properties

Code: Select all


# uriworkermap.properties - IIS

/ufs/*=worker1
/ufstest/*=worker2
/ufsdev/*=worker3

#
# Mount jkstatus to /jkmanager
# For production servers you will need to
# secure the access to the /jkmanager url
#
/jkmanager=jkstatus


and workers.properties file

Code: Select all


# An entry that lists all the workers defined
worker.list=worker1, worker2, worker3

# Entries that define the host and port associated with these workers
worker.worker1.host=localhost
worker.worker1.port=3009
worker.worker1.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=3019
worker.worker2.type=ajp13
worker.worker3.host=localhost
worker.worker3.port=3029
worker.worker3.type=ajp13

Restart Tomcat instances and then IIS.

Hopefully all should work if you can access http://localhost/ufs/, http://localhost/ufstest/ & http://localhost/ufsdev/

Hope this helps,


Regards,


Mark
0 x

User avatar
Andy McMaster
Ebase User
Posts: 33
Joined: Fri Feb 29, 2008 12:08 pm
Location: Newcastle upon Tyne
Contact:

#3

Postby Andy McMaster » Tue Apr 22, 2008 9:57 am

Hi Mark,

Thanks for your reply. Only just got round to trying to get this working and not having much luck.

Although I have three instances of tomcat and ebase running the default site for each is still ufs. Does your setup assume the site name is changed for the other two instances? (to ufstest and ufsdev?)

So, with your config do you have an instance of Tomcat running ufs, another running ufstest and another running ufsmain?

If these were just separate sites within the same instance of Tomcat would the only difference be that the ports would all be the same?

If the above is correct I assume there's not an easy way of pointing to the three separate ufs sites if the names stay the same?

Hope that lot makes sense :)

NB. When I do any changes either the page cannot be found or it prompts me for a login.

Andy
0 x
<b>Do not despise the snake for having no horns for who is to say it will not become a dragon</b>

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

Configuring IIS for Multiple Tomcat instances

#4

Postby AJDulk » Tue Apr 29, 2008 1:59 pm

Andy,

If you follow the instruction you should have the following situation if you approach locally:

Direct connection to the various Tomcats
Ebase Live: http://localhost:3030/ufs/...
Ebase Test: http://localhost:3031/ufs/...
Ebase Dev: http://localhost:3032/ufs/...

Indirect connection via IIS:
Ebase Live: http://localhost/ufs/...
Ebase Test: http://localhost/ufstest/...
Ebase Dev: http://localhost/ufsdev/...

The ISAPI connector does not use the 3030 through 3032 to connect, it also does not use the name "ufs" to connect. Rather it connects via an internal port defined in each web-context (that is initially the 8009 for HTTP and 3443 for HTTPS) using the AJP/13 protocol.

The 8009 and 3443 need to be changed to some unique number within your system, otherwise you will get conflicts as 2 or more services try to serve information to IIS at the same time.

In the given example we have the following:
/ufs/* is handled by worker 1
which is defined as follows:
worker.worker1.host=localhost
worker.worker1.port=3009
worker.worker1.type=ajp13


/ufstest/* is handled by worker 2
which is defined as follows:
worker.worker2.host=localhost
worker.worker2.port=3019
worker.worker2.type=ajp13


/ufsdev/* is handled by worker 3
which is defined as follows:
worker.worker3.host=localhost
worker.worker3.port=3029
worker.worker3.type=ajp13


uriworkermap.properties defines which workers are used for which URL's.
workers.properties defines where to connect.

So your answer is that the names on the Tomcat side remain the same, the names on the IIS side are different.

If you were running 3 instances under the same Tomcat, you would have to create 3 web-contexts, all with a different name. To connect IIS you would still need to change the 8009 and 3443 ports to unique numbers for each of the web-contexts (at least as far as I remember from when I did this).

Regards,
Antony
0 x

User avatar
Andy McMaster
Ebase User
Posts: 33
Joined: Fri Feb 29, 2008 12:08 pm
Location: Newcastle upon Tyne
Contact:

#5

Postby Andy McMaster » Wed Apr 30, 2008 11:50 am

Hi Antony,

Thanks for the reply. Still having no joy here, though.

Here are the files:

uriworkermap.properties

Code: Select all

/ufstest/*=test
/ufstest/*.jsp=test
/ufstest/servlet/*=test

/ufs/*=dev
/ufs/*.jsp=dev
/ufs/servlet/*=dev

/vqwiki-2.7.91/*=wiki
/vqwiki-2.7.91/*.jsp=wiki
/vqwiki-2.7.91/servlet/*=wiki
workers.properties.minimal

Code: Select all

worker.list=dev,test,wiki
worker.dev.type=ajp13
worker.dev.host=localhost
worker.dev.port=8029

worker.wiki.type=ajp13
worker.wiki.host=localhost
worker.wiki.port=8029

worker.test.type=ajp13
worker.test.host=localhost
worker.test.port=8019
I can access the dev worker with http://server_name/ufs/

I can access the wiki worker with http://server_name/vqwiki-2.7.91/ - the wiki is running in the same Tomcat instance as dev.

When I try http://server_name/ufstest/ I get

Code: Select all

HTTP Status 404 - /ufstest/

--------------------------------------------------------------------------------

type Status report

message /ufstest/

description The requested resource &#40;/ufstest/&#41; is not available.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.23
I can access the test system using its port with no problems.

I've been looking through the redirector docs and it looks like ufstest has to match the context within that instance of Tomcat? So, as the context in the test instance of Tomcat is ufs then when using ufstest it doesn't exist?

If this is the case do I need to rename the ebase context ufs in the test setup? If so, how straight forward is this? I assume a lot of the internal config relies on this?

Cheers

Andy

PS. Just to add to this: I'm trying to look in the connector logs to see what's going on with the redirection but NOTHING is getting written to any log file. I've added a isapi_redirect.properties file in the same directory as the DLL and it seems to be using this - it failed when I had the worker filename wrong - and a log is specified there at DEBUG level but nothing ever gets written to the file. It's not helping to sort this out.
0 x
<b>Do not despise the snake for having no horns for who is to say it will not become a dragon</b>

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

Configuring a Tomcat web-context instance

#6

Postby AJDulk » Tue May 06, 2008 10:24 am

To rename the web-context from ufs to ufstest, follow the following steps:
1. Stop Tomcat
2. In UfsServer\tomcat\conf\Catalina\localhost rename ufs.xml to ufstest.xml
3. In UfsServer\tomcat\webapps rename ufs to ufstest
4. Delete the ufs directory from UfsServer\tomcat\work\Catalina\localhost (this is more of a cleanup than a necessary step)
5. Open designer.vmoptions in UfsClient and change -DServerWebapp=ufs to -DServerWebapp=ufstest
7. Open start_ebase_designer.bat in UfsClient and add the following line under the set SERVER_PORT line:

Code: Select all

set SERVER_WEBAPP=ufstest
8. Restart Tomcat
0 x

User avatar
Andy McMaster
Ebase User
Posts: 33
Joined: Fri Feb 29, 2008 12:08 pm
Location: Newcastle upon Tyne
Contact:

#7

Postby Andy McMaster » Tue May 06, 2008 10:50 am

Hi Antony,

That works great! I can now pull up the test instance of tomcat via IIS with no problems.

It's taking a while to work out how Ebase/Tomcat/IIS interract but things are starting to come together now.

Thanks again

Andy
0 x
<b>Do not despise the snake for having no horns for who is to say it will not become a dragon</b>


Who is online

Users browsing this forum: No registered users and 67 guests