README.md 2.71 KB
Newer Older
Misagh Moayyed's avatar
Misagh Moayyed committed
1
CAS Overlay Template
Dmitriy Kopylenko's avatar
Dmitriy Kopylenko committed
2
3
============================

Misagh Moayyed's avatar
Misagh Moayyed committed
4
Generic CAS WAR overlay to exercise the latest versions of CAS. This overlay could be freely used as a starting template for local CAS war overlays. The CAS services management overlay is available [here](https://github.com/apereo/cas-services-management-overlay).
Dmitriy Kopylenko's avatar
Dmitriy Kopylenko committed
5
6

# Versions
Misagh Moayyed's avatar
updated    
Misagh Moayyed committed
7

Dmitriy Kopylenko's avatar
Dmitriy Kopylenko committed
8
```xml
Misagh Moayyed's avatar
Misagh Moayyed committed
9
<cas.version>5.2.x</cas.version>
Dmitriy Kopylenko's avatar
Dmitriy Kopylenko committed
10
11
```

Misagh Moayyed's avatar
Misagh Moayyed committed
12
# Requirements
Misagh Moayyed's avatar
Misagh Moayyed committed
13
* JDK 1.8+
Dmitriy Kopylenko's avatar
Dmitriy Kopylenko committed
14

15
16
# Configuration

Misagh Moayyed's avatar
Misagh Moayyed committed
17
The `etc` directory contains the configuration files and directories that need to be copied to `/etc/cas/config`.
18

Misagh Moayyed's avatar
Misagh Moayyed committed
19
20
# Build

Misagh Moayyed's avatar
updated    
Misagh Moayyed committed
21
22
23
24
25
26
27
28
To see what commands are available to the build script, run:

```bash
./build.sh help
```

To package the final web application, run:

Misagh Moayyed's avatar
Misagh Moayyed committed
29
```bash
Misagh Moayyed's avatar
Misagh Moayyed committed
30
./build.sh package
Misagh Moayyed's avatar
Misagh Moayyed committed
31
32
```

Misagh Moayyed's avatar
updated    
Misagh Moayyed committed
33
34
35
36
37
38
To update `SNAPSHOT` versions run:

```bash
./build.sh package -U
```

Dmitriy Kopylenko's avatar
Dmitriy Kopylenko committed
39
40
# Deployment

Misagh Moayyed's avatar
Misagh Moayyed committed
41
42
- Create a keystore file `thekeystore` under `/etc/cas`. Use the password `changeit` for both the keystore and the key/certificate entries.
- Ensure the keystore is loaded up with keys and certificates of the server.
Misagh Moayyed's avatar
Misagh Moayyed committed
43

Misagh Moayyed's avatar
Updated    
Misagh Moayyed committed
44
45
46
47
48
49
50
51
On a successful deployment via the following methods, CAS will be available at:

* `http://cas.server.name:8080/cas`
* `https://cas.server.name:8443/cas`

## Executable WAR

Run the CAS web application as an executable WAR.
Misagh Moayyed's avatar
Misagh Moayyed committed
52
53

```bash
Misagh Moayyed's avatar
Misagh Moayyed committed
54
./build.sh run
Misagh Moayyed's avatar
Misagh Moayyed committed
55
56
```

Misagh Moayyed's avatar
Updated    
Misagh Moayyed committed
57
## Spring Boot
Misagh Moayyed's avatar
Misagh Moayyed committed
58

Misagh Moayyed's avatar
Updated    
Misagh Moayyed committed
59
60
61
62
63
Run the CAS web application as an executable WAR via Spring Boot. This is most useful during development and testing.

```bash
./build.sh bootrun
```
Misagh Moayyed's avatar
Misagh Moayyed committed
64

Misagh Moayyed's avatar
Misagh Moayyed committed
65
66
67
68
### Warning!

Be careful with this method of deployment. `bootRun` is not designed to work with already executable WAR artifacts such that CAS server web application. YMMV. Today, uses of this mode ONLY work when there is **NO OTHER** dependency added to the build script and the `cas-server-webapp` is the only present module. See [this issue](https://github.com/apereo/cas/issues/2334) and [this issue](https://github.com/spring-projects/spring-boot/issues/8320) for more info.

Hal Deadman's avatar
Hal Deadman committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

## Spring Boot App Server Selection
There is an app.server property in the pom.xml that can be used to select a spring boot application server.
It defaults to "-tomcat" but "-jetty" and "-undertow" are supported. 
It can also be set to an empty value (nothing) if you want to deploy CAS to an external application server of your choice and you don't want the spring boot libraries included. 

```xml
<app.server>-tomcat<app.server>
```

## Windows Build
If you are building on windows, try build.cmd instead of build.sh. Arguments are similar but for usage, run:  

```
build.cmd help
```

Misagh Moayyed's avatar
Misagh Moayyed committed
86
## External
Misagh Moayyed's avatar
updated    
Misagh Moayyed committed
87

Misagh Moayyed's avatar
Misagh Moayyed committed
88
Deploy resultant `target/cas.war`  to a servlet container of choice.
89
90
91
92
93
94
95
96
97
98


## Command Line Shell

Invokes the CAS Command Line Shell. For a list of commands either use no arguments or use -h. To enter the interactive shell use -sh.

```bash
./build.sh command
```