-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Darryl,

On 4/22/20 00:40, Darryl Philip Baker wrote:
> Thank you, Christopher,
>
> I do want to run both versions of the application and tomcat
> simultaneously. The current version of the app on using tomcat7 on
> the current ports 8009/8080/8443 I don't think it has 8005
> configured.

Port 8005 is used as the "shutdown" port. It's not a <Connector>; it's
at the very top of the conf/server.xml file:

<Server port="8005" shutdown="SHUTDOWN">
  ...

> I was thinking I could run the newer version of the app on tomcat9
> using alternate ports 9009/9080/9443. Any reason not to?
The port selection isn't really important. Just make it something
you'll remember / recognize later :)

> I wasn't sure if I should different path like
> myserver.example.com/tc9staging/blah or a second virtual host like
>  tc9staging.example.com/blah. I do only have one network interface
> to work with, but I could add a CNAME easily. What are the pros
> and cons of the two methods?
A different path is slightly simpler to configure, especially if you
aren't really well-versed in virtual hosts, mod_jk, and TLS configuratio
n.

If the application demands to be placed at a certain path (e.g.
/myapp) then you'll have to go with a separate virtual host.

> Yes, there is a workers.properties file. My predecessor used ajp13
>  as the name of the first worker so that was a bit confusing. I
> thought that was just an arbitrary string, thank you for
> confirming that. If I want both to work wouldn't the worker.list
> parameter look like "worker.list=ajp13,tc9staging"?
You can do that, or you can list them separately. When mod_jk sees
worker.list=[...], it will append the [...] to whatever list already
exists. It will not override a previously-confgiured worker list. This
is helpful if you have large lists of workers and want to comment-out
just a single worker. Instead of having to edit one, single, large
"worker.list" you can simply comment-out the single
worker.list=workerX and it will be removed from the complete list.

> I will rename the workers something more meaningful to help my
> successor just in case I have to leave the project. Even worker1
> would have been clearer than using a keyword as the worker name.
> Then the rest of the workers.property file will be just the
> configuration for both workers, two versions of each line, one for
> each worker.
You should also look at creating a "template" worker. Basically, you can
set all of the various values that all the workers will use, and then
each individual worker only needs to mention its template's name plus
override whatever settings you want (usually host/port). We use this at
$work for a bunch of workers that are all configured (nearly)
identically, including things like max-packet-sizes, timeouts,
connection-check behavior, etc.

But it looks like you are well on your way to getting this to work.

In my experience, upgrading Tomcat is a relatively painless
experience, especially if your application is well-written.

- -chris

> On 4/21/20, 5:29 PM, "Christopher Schultz"
<ch...@christopherschultz.net> wrote:
>
> Darryl,
>
> On 4/21/20 12:03, Darryl Philip Baker wrote:
>> We currently have an application running in Tomcat7 that is
>> connected to Apache HTTPD via the mod_jk plugin. I have been
>> asked to get a newer version of the same application running on
>> the same machine using Tomcat9. I know I will need to use
>> alternate ports and paths.
>
> Do you want to run them in parallel, or do you just want to upgrade
>  Tomcat underneath your application? (Or do you want to have a
> "staging" version in parallel with a plan to complete migration
> once you have fully tested everything?)
>
>> I am a bit overwhelmed trying to understand how to configure the
>>  second Tomcat and its workers so the connect to Apache
>> correctly.
> I'm going to make a few assumptions and then continue:
>
> 1. You want to run these two Tomcats in parallel, with the same
> application, on the same machine
>
> 2. You are only using one network interface (or "all" network
> interfaces )
>
> 3. You have a pretty simple AJP configuration mapping httpd ->
> Tomcat
>
> 4. You are using a single virtual host in httpd
>
> This should be fairly straightforward.
>
> First, you'll need to install your new version of Tomcat somewhere
>  and, probably, drop your WAR file into that new version's
> ""webapps" directory. (Here's where I tell you that using a
> "split" CATALINA_HOME and CATALINA_BASE can be your friend, but
> let's keep things simple for now. After you are all done, go and
> read the ""advanced" section of RUNNING.txt to see what I mean).
>
> When you put your WAR file into "webapps", change its name to
> something like "tc9staging.war". Just as long as it's not the same
>  name as the original. (This will come back up, later).
>
> Second, edit your conf/server.xml and configure all the ports:
>
> 1. The "shutdown" port (default: 8005) 2. The HTTP port (default:
> 8080) 3. The AJP port (default: 8009)
>
> Don't overthink these ports. Maybe just add "1" to each one for
> now?
>
> You might want to configure disabling AJP entirely and using
> mod_proxy_http to connect httpd -> Tomcat. For now, let's keep your
>  AJP connector for simplicity.
>
> Third, launch Tomcat and make sure that (a) there are no obvious
> errors in log/catalina.out and (b) your application seems to deploy
>  properly.
>
> Fourth, connect httpd -> [new] Tomcat.
>
> In httpd.conf (or one of the files it includes, perhaps), you
> should have lines like this:
>
> JkMount /myapp
>
> The text "" may be almost anything. That's the "worker name" and
> it's usually defined usually in a file specified by JkWorkersFile.
> If you don't have a "JkWorkersFile" directive anywhere, we'll have
> to dig a little deeper.
>
> In your jkworkers.properties file, all the workers are defined. We
>  will need to duplicate those to create new workers pointing to
> the new Tomcat. Something like this:
>
> [existing] worker.list=workerX worker.workerX.type=ajp13
> worker.workerX.host=localhost worker.workerX.port=8009
>
> We'll add a new worker called tc9staging:
>
> worker.list=tc9staging worker.tc9staging.type=ajp13
> worker.tc9staging.host=localhost worker.tc9staging.port=8010
>
> Note that the "worker.list" property is in dded repeated, and it is
>  indeed different than the previous one. That's okay: they are
> cumulative and you won't lose the old config.
>
> Now, back to httpd.conf. Duplicate your JkMounts for the new URL
> path (remember when we chose the new name of the web application
> above?)
>
> JkMount /tc9staging tc9staging
>
> Now restart httpd and you should be able to get to your old app
> here:
>
> https://example.com/myapp
>
> and the new app here:
>
> https://example.com/tc9staging
>
> *crosses fingers*
>
> Hope that helps, -chris
>
> ---------------------------------------------------------------------
>
>
>
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
>
> ---------------------------------------------------------------------
>
>
>
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl6gWfUACgkQHPApP6U8
pFj+cw//T4/MPPKNXp3+XasVtojRqWgRn00kucB7IEtm39VdwwI1og1yjKy7f7JW
crWpSO8UOyHTJLmH7LR+2DUAO3lmJOe81TI7IC7LU6+wMuVajPL3jCAzMR3wyI9P
Y/T7Uexwxq61AjgyqJIZwd1I6UpgW/4ekOBPJW8ZFcGH+ag5NSrPHzGWwAXYJePy
WgqrFgJ3BdBODFg7HpKsGYApLN2zhpwK2AurFweY06rjFsI0gquIPA9L0ehg/4Gb
uu0Uvm2xlLW5l71NQoFQ6NIDB+xpVCIk7gSgFd0POY8q0fSnSQs8Q/kf6mCoxDYm
Nfzri3+4wYzDCweN98nbg2EzvfAC38vuihcSzpHPwz9ohT+LvTlTJMt88TQExlG/
oD+9lXdM4KwDd26RUOKd+1kpkuV4p5nLN5mk06gxbQ9utoCRR8jsrsSIRCrSNz0i
oFfX8MLhH3Ea7vG0Bvh48/Rph8ezPhfwHvmWLZ/nveyXO01kSr5NkkFZhLB7L4AE
2J+3TkyPSwANat+5MZ+LMx+l8zKCq87qNMXukdvJGEMBUCgkx2H41Arzu8Jwfndf
BT1BWhazZ/OZcgliR2df48xS2JKdSYUErVzIUuyLTTVyDWn+AFA7Sa5xIz6ChOjC
6H2TnrxQf0zk8Vv6KwfujDWaoNPJnZylOHosqR6pR/G5/JUO2qY=
=JgLF
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to