問題
環境: cas-overlay-template 6.6
在網路上尋找將 Apereo CAS 安裝在 Windows 上的文章,
1.安裝 OpenJDK
2.安裝 Tomcat 10
3.透過 keytool
來建立自簽憑證,來設定 Tomcat 啟用 TLS 走 8443 Port
4.建置 cas-overlay-template
5.將 建置好的 war 檔(build\lib\cas.war)放到 Tomcat webapps 目錄中,Browser 到 https://localhost:8443/cas
就搞定了。
結果,我一跑,就噴 404,如下,

解法
詢問同事 Willy 大大,他測試 透過 gradlew clean build
, createKeystore
再 run
,
Browser 到 https://localhost:8443/cas
就可以了… 傻眼 …
所以 …
前面的 Tomcat 不需要裝,也不需要把 war 放到 Tomcat 的 WebApps 目錄中 。
可以 Work 的 Step 如下,
1.下載 cas-overlay-template,或是開啟命令視窗執行 git clone https://github.com/apereo/cas-overlay-template.git cas-server
來下載。
2.開啟命令視窗,cd cas-server
,切換到要使用的版本,可透過 git checkout -b 6.6 origin/6.6
來切換。

3.在cas-overlay-template檔案的根目錄下,新增 etc\cas
目錄

4.在命令視窗中執行 gradlew clean build
5.在命令視窗中執行 gradlew createKeystore
,這個 task 會在c:\etc\cas
目錄中,建立自簽憑證。

6.在命令視窗中執行 gradlew run

7.開啟 Browser ,網址列輸入 https://localhost:8443/cas/login
就會出現 CAS 的登入畫面,使用 casuser/Mellon 登入。


以上是 單獨跑,那如果要放到 tomcat 中呢??
目前 cas-overlay-template 6.6 ,要使用 Tomcat 9 哦~
改用 Tomcat 9 ,把前面 Build 好的 war 放到 webapps 目錄就可以了 , QQ