CentOS安裝CAS服務端

來源:互聯網
上載者:User

標籤:logs   select   安裝tomcat   rac   安裝jdk   html   type   size   靜態   

1、安裝jdk1.8

https://www.cnblogs.com/kgdxpr/p/6824093.html

2、安裝tomcat8

3、安裝maven

https://www.cnblogs.com/kgdxpr/p/9849856.html

4、下載cas-overlay

https://github.com/apereo/cas-overlay-template/tree/5.3

百度地址:https://pan.baidu.com/s/11xHLsGiUplmARRdI4PRtCA

解壓cas-overlay-template-5.3.zip

進入cas-overlay-template-5.3目錄

執行:mvn clean package

將產生的cas目錄複寫到tomcat下

5、為cas下載串連資料庫的依賴包

pom.xml內容如下:

<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>

將下載的jar包複製到cas的lib目錄下

設定cas的設定檔application.properties

將預設的靜態使用者名稱和密碼配置注釋掉

#cas.authn.accept.users=casuser::Mellon

增加如下內容:

#設定資料庫串連cas.authn.jdbc.query[0].url=jdbc:mysql://127.0.0.1:3306/dsideal_db?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false#資料庫使用者名稱cas.authn.jdbc.query[0].user=root#資料庫密碼cas.authn.jdbc.query[0].password=123456#mysql驅動cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver#添加jdbc認證cas.authn.jdbc.query[0].sql=SELECT * FROM login WHERE login_name =?#哪個欄位作為密碼欄位cas.authn.jdbc.query[0].fieldPassword=login_password

註:如上配置為純文字密碼

增加密碼MD5加密配置

修改設定檔application.properties增加如下內容:

#配置加密策略cas.authn.jdbc.query[0].passwordEncoder.type=DEFAULTcas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8cas.authn.jdbc.query[0].passwordEncoder.encodingAlgorithm=MD5

註:上面的配置md5加密為32位小寫

 

CentOS安裝CAS服務端

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.