Several CAS webapps in one tomcat server

35 views
Skip to first unread message

Alberto Cabello Sánchez

unread,
May 20, 2019, 5:06:23 AM5/20/19
to cas-...@apereo.org
Hi all,

I have the need of setting up a few CAS servers with different auth backends,
if possible in the same server (I'm not familiar with Spring config, so I'm
using just old-fashioned config files). Indeed, it is easy to do it just
changing the line

# cas.standalone.config=/etc/cas/config

or

spring.application.name=cas

in bootstrap.properties. But, as it is not recommended to modify this file
or application.properties, I'm trying to override that value with a
WEB-INF/classes/application.yml file like this one:

cas:
standalone:
config : /usr/local/etc/cascert

which has no effect. Is this correct? Can I safely modify the

spring.application.name

property in bootstrap.properties (as I did previoulsy with success)?

Best regards,

--
Alberto Cabello Sánchez
Servicio de Informática
Universidad de Extremadura

Andy Ng

unread,
May 21, 2019, 8:32:36 AM5/21/19
to CAS Community
Hi Alberto,

See if the below info helps you:
- depends on your CAS version, you might need to use cas.standalone.configurationDirectory=/etc/cas/config instead of cas.standalone.config=/etc/cas/config
- bootstrap.properties load before application.properties or application.yml, that's why your modification didn't work
- One way to do it (I don't know if recommended or not...) is to put your cas.standalone.config: /etc/cas/config inside bootstrap.yml instead
- yml load after properties, so bootstrap.yml will override bootstrap.properties.

I also agrees that using config is the sometime the better option, especially when you already have a system to manage config files, just didn't see the benefit of switching to spring config.

Hope the info helps you!

Cheers!
- Andy
 

Alberto Cabello Sánchez

unread,
May 23, 2019, 6:48:48 AM5/23/19
to cas-...@apereo.org
On Tue, 21 May 2019 05:32:35 -0700 (PDT)
Andy Ng <lon...@gmail.com> wrote:

> instead of cas.standalone.config=/etc/cas/config
> - bootstrap.properties load before application.properties or
> application.yml, that's why your modification didn't work
> - One way to do it (I don't know if recommended or not...)
> is to put your cas.standalone.config:
> /etc/cas/config inside *bootstrap.yml* instead
> - yml load after properties, so bootstrap.yml will override
> bootstrap.properties.

Thank you, Andy.

This worked like a charm. For anyone interested, I have now

<properties>
...
<springApplicationName>casldap1</springApplicationName>
<casStandaloneConfig>/usr/local/etc/casldap1/</casStandaloneConfig>
...
</properties>

in the <profile> section of the pom.xml, and the command

mvn -Pldap1 clean package

fills the values in my src/main/resources/bootstrap.yml, which reads

cas:
standalone:
config : ${casStandaloneConfig}
spring:
application:
name : ${springApplicationName}


> I also agrees that using config is the sometime the better option,
> especially when you already have a system to manage config files,
> just didn't see the benefit of switching to spring config.

Sure, I'll look into spring config, but at this stage I'm just
trying to avoid brain overload.

Thank you very much again,
Reply all
Reply to author
Forward
0 new messages