Hi all,

this one was fun to investigate. :) Here are my findings on this topic, 
hopefully they can clarify it a bit:

It looks like that CAS, *already in version 6.1.0-RC5,* switched to Spring 
Boot 2 (see here 
<https://github.com/apereo/cas/commit/8eb47933a91afdbdbc4994cc82b3b85e2f6f7c17>),
 
which means most of those "server.*" property names had to be changed to 
"server.servlet.*". This also includes using the "
*server.servlet.context-path*" property - which is confirmed by CAS 
archived docs 
<https://web.archive.org/web/20201015041023/https://apereo.github.io/cas/6.1.x/configuration/Configuration-Properties.html#embedded-container>
 
(available here 
<https://apereo.github.io/cas/6.1.x/installation/Configuring-Servlet-Container-Embedded.html>
 
for the actual 6.6.x version).

That said, it remains a bit mystery why in the linked thread 
https://groups.google.com/a/apereo.org/g/cas-user/c/ntVu5_b7TT8/m/wh3IL3qQCQAJ, 
they say "server.contextPath" did work for them with CAS *6.1*, when it 
apparently shouldn't have. Maybe they used a pre-release version, or forgot 
to notice the difference...

Regarding the "*cas.server.prefix*", I think we all agree that this 
property could surely be documented more (currently "A concatenation of the 
server name plus the CAS context path. Deployments at root likely need to 
blank out this value." -> not quite accurate and purpose of the property is 
also left out). But well, as authors would probably say, PRs are welcome... 
:)

Petr

On Friday, 11 August 2023 at 19:18:59 UTC+2 weillaer...@gmail.com wrote:

> I was getting a lot of trouble with this also.
> The cas.server.prefix is totally useless and does not modify the url like 
> you want.
> The parameter to use is : 
>
> server.servlet.context-path=/
>
> And then, it works perfectly !
> Le mercredi 16 février 2022 à 14:27:42 UTC+1, petr.f...@gmail.com a 
> écrit :
>
>> Hello,
>> I have no experience with embedded tomcat, sorry. I always used a 
>> standalone container.
>> One thing in your config stands out, though.
>>
>> You use:
>>
>>
>>
>> *cas.server.prefix=${cas.server.name <http://cas.server.name>} *But 
>> linked discussion mentions:
>>
>>
>>
>> *cas.server.prefix=${cas.server.name <http://cas.server.name>}/ *with 
>> the / at the end of server prefix.
>>
>> Fiisch
>>
>>
>> Dne středa 16. února 2022 v 13:02:50 UTC+1 uživatel Agustín Ezequiel 
>> Pereyra napsal:
>>
>>> Hello Fiisch, thank you very much for your answer. I am deploying CAS 
>>> with the embedded Tomcat, not another container. Should it work in this 
>>> case?  Do you have any clue what else I could be missing?
>>>
>>> Regards,
>>>
>>> El mié, 16 feb 2022 a las 4:19, Petr Fišer (<petr.f...@gmail.com>) 
>>> escribió:
>>>
>>>> Hello,
>>>> This looks like you are deploying CAS to your own app container.
>>>> It will not work, because "server.xxxxxxx" properties are made for 
>>>> configuring a tomcat container embedded in the war.
>>>>
>>>> Cheers,
>>>> Fiisch
>>>>
>>>> On 02/15/2022 05:08 PM, Agustín Ezequiel Pereyra wrote:
>>>>
>>>> Hello, 
>>>>
>>>> I want to deploy cas so it takes requests at http://myUrl.com/ instead 
>>>> of the default http://myUrl.com/cas.
>>>>
>>>> According to the documentation, and this thread: 
>>>> https://groups.google.com/a/apereo.org/g/cas-user/c/ntVu5_b7TT8/m/wh3IL3qQCQAJ,
>>>>  
>>>> setting the properties:
>>>>                     
>>>>
>>>> *                    cas.server.prefix=${cas.server.name 
>>>> <http://cas.server.name>}/                     server.contextPath=/*
>>>>
>>>> Should be enough (if I got it wright). Yet I can't make it work. I'm 
>>>> testing with the basic cas-overlay, version 6.4.2. The only thing I 
>>>> customized is the cas.properties file, with the following lines:
>>>>
>>>> *                cas.server.name 
>>>> <http://cas.server.name>=http://myUrl.com:8080 <http://myUrl.com:8080>*
>>>> *                cas.server.prefix=${cas.server.name 
>>>> <http://cas.server.name>}* 
>>>>
>>>>
>>>>
>>>> *                server.contextPath=/                 server.port=8080 
>>>>                 server.ssl.enabled=false *
>>>> When I navigate to http://myUrl.com:8080/login I get a 404 error. But 
>>>> when I go to http://myUrl.com:8080/cas/login, I do get the login page. 
>>>> Do you know what I may be doing wrong?
>>>> -- 
>>>> - Website: https://apereo.github.io/cas
>>>> - Gitter Chatroom: https://gitter.im/apereo/cas
>>>> - List Guidelines: https://goo.gl/1VRrw7
>>>> - Contributions: https://goo.gl/mh7qDG
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "CAS Community" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to cas-user+u...@apereo.org.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/a/apereo.org/d/msgid/cas-user/a18e9b2f-da86-49d2-8247-b5731b6445cbn%40apereo.org
>>>>  
>>>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/a18e9b2f-da86-49d2-8247-b5731b6445cbn%40apereo.org?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>>
>>>> -- 
>>>> - Website: https://apereo.github.io/cas
>>>> - Gitter Chatroom: https://gitter.im/apereo/cas
>>>> - List Guidelines: https://goo.gl/1VRrw7
>>>> - Contributions: https://goo.gl/mh7qDG
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "CAS Community" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to cas-user+u...@apereo.org.
>>>>
>>> To view this discussion on the web visit 
>>>> https://groups.google.com/a/apereo.org/d/msgid/cas-user/5c2b880b-6eaf-5302-7266-a8d399dc9590%40gmail.com
>>>>  
>>>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/5c2b880b-6eaf-5302-7266-a8d399dc9590%40gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/03af8ae9-f8e0-48a4-9384-1c7ffdde6cddn%40apereo.org.

Reply via email to