tomcat 6 help

Hi!

1) I have changed my domain so that it points to my linode IP address.

2) I have already installed tomcat6 to my linode. Uploaded neccesary WAR file, and can see the results by typing

http://www.virbank.ru:8080/PIconstructionWeb/

My question is: what kind of extra work should I do, so that the above site opens when I just type www.virbank.ru (i.e. without port number AND /PiconstructionWeb words)

Thank you for your answer.

6 Replies

@aboronov:

Hi!

1) I have changed my domain so that it points to my linode IP address.

2) I have already installed tomcat6 to my linode. Uploaded neccesary WAR file, and can see the results by typing

http://www.virbank.ru:8080/PIconstructionWeb/

My question is: what kind of extra work should I do, so that the above site opens when I just type www.virbank.ru (i.e. without port number AND /PiconstructionWeb words)

Thank you for your answer.

The "usual" way to do this is to run apache and use mod_jk to link it up to tomcat. I'm sure it's possible with nginx as well. Basically, you want to get a webserver up on port 80 that'll forward appropriate traffic to tomcat on 8080

I don't use the modjk I use modproxy I think it is in Apache and use Apache's proxy capability to connect to whatever backend server I want without further need for mods.

Try this in the virtual config for the root Apache site:

ProxyPass / http://127.0.0.1:8080/PIconstructionWeb/

ProxyPassReverse / http://127.0.0.1:8080/PIconstructionWeb/

:

:

This may or may not work with nginx as the front end.

@jebblue:

I don't use the modjk I use modproxy

Oh yeah, that would work too, wouldn't it. Sorry, never actually setup tomcat myself. At work I use it, but another group set it up and they used mod_jk, but that's on a monster solaris box.

Makes it handy for cutting over to a new site change and back if needed. Just change the config and tell Apache to reload. I guess it could be used in A/B testing.

All I know is it works and it's simple. GWT isn't bothered by it. :-)

Just found a great proxy directive to go with ProxyPass which makes Apache pass in the full Host header:

ProxyPreserveHost On

This solved a cookie issue I was having.

Well first of all let me say that my application has been developed using struts2, java, jsp, tomcat6. For preventing double form submission I have made use of tokenSession interceptor. Additionally I have 2 wars namely PIconstructionWeb and PIdistributionWeb. And goal is to make switching between these wars when needed, WITHOUT removing anything from tomcat and restarting tomcat.

I have tried both mod-proxy and mod_jk. To be honest mod-proxy is more simple.

In mod-proxy everything has worked. And necessity for NOT restarting tomcat to make chages has been reached. BUT as I said above I am using tokenSession interceptor, and with mod-proxy EVERY form submission is recieving "invalid.token" result. May be you know how to solve this issue. The configuration has been made with mod-proxy is as following:

ServerName virbank.ru

ProxyRequests Off

ProxyPreserveHost On

Order deny,allow

Allow from all

ProxyPass /PIconstructionWeb http://localhost:8080/PIconstructionWeb/

ProxyPassReverse /PIconstructionWeb http://localhost:8080/PIconstructionWeb/

ProxyPass /PIdistributionWeb http://localhost:8080/PIdistributionWeb/

ProxyPassReverse /PIdistributionWeb http://localhost:8080/PIdistributionWeb/

ProxyPass / http://localhost:8080/PIdistributionWeb/

ProxyPassReverse / http://localhost:8080/PIdistributionWeb/

On the other hand with mod_jk everything is working (including tokenSession issue). But necessity for NOT restarting tomcat has not been reached. Because one of my wars should reside in ROOT directory of tomcat, and whenever I want to switch I have to restart tomcat. The worker I have defined, is as following:

Define 1 real worker using ajp13

worker.list=piworker

Set properties for piworker (ajp13)

worker.piworker.type=ajp13

worker.piworker.host=localhost

worker.piworker.port=8009

I wonder is there any thechnique here to define meaning of the following?

worker.piworker1.host=localhost:8009/PIconstructionWeb

worker.piworker1.host=localhost:8009/PIdistributionWeb

If somebody has solved similar problem please help.

PS with mod_jk: defining workers with differenent ports, and in tomcat server.xml setting different listening ports to 2 wars is tedious and not preferred.

My tomcat should not be restarted because system should always respond to 3rd party external payment systems. And they are working 24 hours a day.

@aboronov:

as I said above I am using tokenSession interceptor, and with mod-proxy EVERY form submission is recieving "invalid.token" result. May be you know how to solve this issue.

I'd look into Tomcat's emptySessionPath attribute to see if it applies to your situation.

Also look into Loader delegate setting in context.xml.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct