Multiple Connnectors in Tomcat server.xml

168 views
Skip to first unread message

Mark Fisher

unread,
Feb 25, 2016, 7:50:00 AM2/25/16
to Codehaus Cargo
I'm trying to configure multiple connectors (1 x http on 8080, 1 x https on 8443) in tomcat's server.xml (allows me to have securtiy-constraints in web.xml that force redirects from http to https using the redirectPort value on the Connector).

Are multiple connectors possible with cargo? As I'm having trouble setting them up.

When I add properties like 'cargo.protocol', 'cargo.tomcat.connector.keystoreFile' etc, they affect the first and only connector in the configuration, so it seems I can have only 1.
I was hoping for something like the datasource1,2 etc to allow multiple definitions, but can't find it.

I read on another thread about removing ajp port that you're manipulating existing elements in server.xml, and as there's only one default connector configured (the other is a comment), I'm guessing not, but wanted to ask.

Cheers,
Mark

S. Ali Tokmen

unread,
Feb 25, 2016, 5:18:05 PM2/25/16
to codehau...@googlegroups.com
Hi Mark

For Tomcat, I see there is a property TomcatPropertySet.HTTP_SECURE which enables HTTPS - Is this maybe what you're looking for? Or do you actually want to have two completely different connectors for HTTP and HTTPS?

Cheers

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/c761b244-8d91-4c54-828d-3ae15ac37f9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Fisher

unread,
Feb 25, 2016, 6:16:13 PM2/25/16
to Codehaus Cargo
Definitely 2 different connectors. One for normal traffic, and one for (e.g.) shopping/admin pages etc, where https is required.

S. Ali Tokmen

unread,
Feb 28, 2016, 3:09:38 AM2/28/16
to codehau...@googlegroups.com
Hi Mark

OK, so in this case I understand you really want the two connectors to perform two fully different actions.

Out of the box Codehaus Cargo doesn't support that, but you can inject "the file you want" using https://codehaus-cargo.github.io/cargo/Configuration+files+option.html

What you could do as well is to "misuse" the ANT tasks documented in https://codehaus-cargo.github.io/cargo/Ant+support.html and use them via the Maven environment to create and then modify your configuration. That's for example the kind of thing we do in the https://codehaus-cargo.github.io/cargo/Maven2+Archetypes.html#Maven2Archetypes-Archetypeshowingthestartingandstoppingofmultiplecontainerssimultaneously example.

Hope this helps
Reply all
Reply to author
Forward
0 new messages