1. Install jdk1.8
Https://www.cnblogs.com/kgdxpr/p/6824093.html
2. install Tomcat 8
3. Install Maven
Https://www.cnblogs.com/kgdxpr/p/9849856.html
4. Download cas-Overlay
Https://github.com/apereo/cas-overlay-template/tree/5.3
Https://pan.baidu.com/s/11xHLsGiUplmARRdI4PRtCA address:
Decompress cas-overlay-template-5.3.zip
Go to cas-overlay-template-5.3 directory
Run: MVN clean package
Copy the generated CAS directory to Tomcat
5. Download the dependency package for connecting to the database for CAS
The content of POM. XML is as follows:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>fxma</groupId> <artifactId>Word2Html</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>Word2Html</name> <url>http://maven.apache.org</url><dependencies> <dependency> <groupId>org.apereo.cas</groupId> <artifactId>cas-server-support-jdbc-drivers</artifactId> <version>${cas.version}</version> </dependency> <dependency> <groupId>org.apereo.cas</groupId> <artifactId>cas-server-support-jdbc</artifactId> <version>${cas.version}</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.12</version> </dependency> </dependencies> <properties> <cas.version>5.3.4</cas.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <mysql.driver.version>8.0.12</mysql.driver.version> </properties></project>
Copy the downloaded jar package to the lib directory of CAS.
Set the CAS configuration file application. Properties
Comment out the default static user name and password configuration
# Cas. Authn. Accept. Users = casuser: Mellon
Add the following content:
# Configure the database connection cas. Authn. JDBC. Query [0]. url = JDBC: mysql: // 127.0.0.1: 3306/dsideal_db? Useunicode = true & characterencoding = UTF-8 & autoreconnect = true & usessl = false # database username CAS. authn. JDBC. query [0]. user = root # Database Password CAS. authn. JDBC. query [0]. password = 123456 # MySQL driver CAS. authn. JDBC. query [0]. driverclass = com. mySQL. JDBC. driver # Add JDBC-certified CAS. authn. JDBC. query [0]. SQL = select * from login where login_name =? # Which field is used as the password field cas. Authn. JDBC. Query [0]. fieldpassword = login_password
Note: The above configuration is a plaintext password.
Add MD5 encryption configuration for passwords
Modify the configuration file application. properties and add the following content:
# Configure the Encryption Policy CAS. authn. JDBC. query [0]. passwordencoder. type = defaultcas. authn. JDBC. query [0]. passwordencoder. characterencoding = UTF-8cas.authn.jdbc.query [0]. passwordencoder. encodingalgorithm = MD5
Note: The above configuration MD5 encryption is 32-bit lower case
Good
Install CAS server on centos