liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx

上传人:b****7 文档编号:10634109 上传时间:2023-02-22 格式:DOCX 页数:23 大小:27.26KB
下载 相关 举报
liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx_第1页
第1页 / 共23页
liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx_第2页
第2页 / 共23页
liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx_第3页
第3页 / 共23页
liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx_第4页
第4页 / 共23页
liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx_第5页
第5页 / 共23页
点击查看更多>>
下载资源
资源描述

liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx

《liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx》由会员分享,可在线阅读,更多相关《liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx(23页珍藏版)》请在冰豆网上搜索。

liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portal.docx

liferaycasldaptomcat单点登录门户Liferaycasldaptomcatsinglesignonportal

liferay+cas+ldap+tomcat_单点登录门户(Liferay+cas+ldap+tomcat_singlesignonportal)

javaversion

ant-version

ant配置

(1)theant_home:

ant的安装目录

(2)path:

把%ant_home%\bin目录加到path变量

修改配置文件

新增release.${username}.properties扩展环境配置文件

进入liferay\portal目录,你会看到release.properties

配置文件按照官方的说法,此文件不能修改的,但是同目

录下要创建一个release.${username}.properties文件,他

是relese.properties的扩展文件,release.${username}.properties

中的属性会覆盖release.properties中的属性.

username${}是计算机的登陆用户名:

shawn.zhang

如:

release.shawn.zhang.properties

ant.installer.dir=d:

/apacheant-1.8.0

...

说明:

lp.ext.dir指向阔转环境的目录,这个环境设置后,通过ant

自动生成一系列扩展文件

lp.eclipse.dir为eclipse安装目录,可省

lp.eclipse.project.name扩展项目名称,也可生

ant.installer.dir为ant的安装目录

新增app.server.${username}.porperties服务器配置文件

liferay\portal目录下你会看到app.server.properties

配置文件这个是自定义服务器脚本文件.这里我们要在同目录创建

app.server.${username}.properties文件

在里面添加一下内容:

app.server.type=tomcat指定服务器类型

app.server.tomcat.dir=d:

/program/liferay/server/

apache-tomcat-6.o.24app.server.tomcat.dir指定tomcat安装路径

*修改build.xml文件

找到

liferay+cas+ldap+tomcat单点登录门户

(如果没有域名)

将计算机改名:

右击我的电脑-属性-计算机名-更改-(我的为smallun,后面很多地方用到)重启

cas部分

1、下载

casserver3.2

cas-client-3.1.10

http:

//www.jasig.org/cas/download

2、使用keytool配置tomcat的ssl支持

在dos窗体运行以下指令(可以使用bat):

cls

rempleaseseetheenvjava_homebeforerunthisbatfile

remdeletealiatomcatifitisexisted

keytool-delete-a.k.a.smdc-keystore%java_home%/right/lib/security/cacerts-storepasschangeit

(注释:

清除系统中可能存在的名字为smdc的同名证书)

remlistallaliasinthecacerts

keytoollistkeystore%java_home%/right/lib/security/cacerts-storepasschangeit

(注释:

列出系统证书仓库中存在证书名称列表)

remgeneratorakey

keytool-genkey-keyalgrsaaliassmdc-dname"cn=url"storepasschangeit

(注释:

指定使用rsa算法,生成别名为smdc的证书,存贮口令为changeit,证书的dn为"cn=url",这个dn必须是cas工程url或者当前主机完整名称我的为smallun,切记!

!

!

REM导出密钥

以上出口别名部文件%java_home%/嘉园/lib/安全/smdc.crt-storepass修改

(注释:

从keystore中导出别名为SMDC的证书,生成文件SMDC。

CRT)

REM导入信任cacerts

可以导入别名部文件%%/java_homeJRE/lib/安全/smdc.crt-keystore%java_home%/嘉园/lib/安全/cacerts-storepass修改

(注释:

将SMDC。

CRT导入JRE的可信任证书仓库。

注意,安装JDK是有两个JRE目录,一个在底下一个是独立的JDK,JRE,这里的目录必须同Tomcat使用的JRE目录一致,否则后面Tomcat的HTTPS通讯就找不到证书了)

REM列出所有别名在cacerts

以上列表java_homekeystore%%/嘉园/lib/安全/cacerts-storepass修改

(注释:

列出JRE可信任证书仓库中证书名单,验证先前的导入是否成功,如果导入成功,应该在列表中能找到SMDC这个别名,如下图)[引用]

同时,在D:

\\\\jdk1.6.0_04JREjava库\安全目录下能找到”部。

CRT”这个文件;在C:

\文件和设置\用户名目录下能找到”。

私钥”文件改名”部。

密钥库”

满足上述条件则部署完成。

3、配置Tomcat的HTTPS服务

编辑%%\会议下的ApacheTomcat服务器。

XML文件,在连接器的配置位置添加以下的配置:

(。

keystore放到在Tomcat根目录)

引用

<连接器端口=“8443”=“http协议/1.1“sslenabled=“true”

maxthreads=“150”minsparethreads=“25”

maxsparethreads=“75”enablelookups=“假”

disableuploadtimeout=“true”acceptcount=“100”

方案=“HTTPS”安全=“true”

clientauth=“false”SSL协议=“TLS”

keystorefile=“肤。

私钥”keystorepass=“修改”

uriencoding=“UTF-8”/>

4、定制CAS

在%catalina_home%/程序/CAS/下/deployerconfigcontextXML文件中修改:

springframework.LDAP。

核心。

支持。

LdapContextSource”>

<属性名称=“汇集”值=“true”/>

<属性名称=“URL”的值为“LDAP:

//172.16.16.163:

389”/>

<属性名称=“userdn”值=“CN==jlusoftadmin,DC,DC=“/>

<属性名称=“密码”值=“7626277”/>

<属性名称=“baseenvironmentproperties”>

<图>

<输入>

<关键>

<值>

java.naming.security.authentication

<值>

<键>

<简单>值>

<输入>

<输入>

<关键>

<值>COM。

太阳。

JNDI。

LDAP连接超时值>

<键>

<值>20000<值>

<输入>

<输入>

<关键>

<值>COM。

太阳。

JNDI。

LDAP。

读。

超时值>

<键>

<值>20000<值>

<输入>

<地图>

<属性>

添加ldap认证:

-beanid="attributerepository"

class="org.jasig.services.persondir.support.stubpersonattributedao">

-propertyname="backingmap">

(map)

map

/

>

注意:

一定要将cas所依赖的包导入.

liferay部分

1.

关于liferay

liferay是一个完整的门户解决方案,基于j2ee的应用,使用了ejb以及jms等技术,前台界面部分使用strutsmvc

框架,基于xml的portlet配置文件可以自由地动态扩展,使用了web服务来支持一些远程信息的获取,使用

lucene实现全文检索功能.

(lucene是一套用于全文检索和搜寻的开源程式库,由apache软件基金会支持和提供.lucene提供了一个简单强大的

应用程式接口,能够做全文索引和搜寻,在j

ava开发环境里lucene是一个成熟的免费开放源代码工具;就其本身而论,lucene是现在并且是这几年,最受欢迎的免

费java资讯检索程式库.人们经常提到资讯

检索程式库,就像是搜寻引擎,但是不应该将资讯检索程式库与网搜索引擎相混淆.)

主要特点如下:

1、提供单一登陆接口,多认证模式(ldap或sql);

2、管理员能通过用户界面轻松管理用户,组,角色;

3、用户可以根据需要定制个性化的门户布局;

4、能够在主流的j2ee应用服务器上运行;

5、支持主流的数据库;

6、使用了第三方的开源项目,如hibernate,lucene,struts;

7、支持包括中文在内的多种语言;

8、采用最先进的技术java,ejb,jms,soap,xml;

9、提供扩展模式下开发;

10、提供插件模式下开发;

11、多数据库支持;

这里我们就是利用liferay源码通过ant发布liferay扩展包进行portal项目的发布和开发工作.

2.

准备工作2.1下载liferay5.2.3

liferay源码包

liferay-portal-src-5.2.3.zip

oracle数据文件liferay-portal-sql-oracle-10-5.2.3.dmp

(下载地址:

http:

///project/showfiles.php?

group_id=49260)

2.2开发工具

jdk1.6以上;

ant1.7以上;

tomcat6.0以上;

myeclipse5.1以上;

3.

环境配置3.1jdk配置

(1)java_home:

jdk的安装目录

(2)path:

把%java_home%\bin目录加到path变量

(检查jdk是否安装正确,通过"java–version命令来判断.同样下边的ant也是同样的方式进行检查"ant"

version")

3.2ant配置

(1)ant_home:

ant的安装目录

(2)path:

把%ant_home%\bin目录加到path变量

3.3myeclipse配置

(1)设置myeclipse的jdk

myeclipse的jdk采用上面安装过的jdk1.6

(2)设置字符编码

字符编码统一采用utf-8

(3)tomcatserver选择6.x,目录为tomcat的目录,jdk采用上面安装过的jdk1.6.

在后面的"部署ext扩展工程"会详细说明.

4.

部署liferay源码4.

1builddirectorystructure

CreateaworkspacedirectoryLiferay,thencreatetwodirectoriesintheLiferaydirectory,oneistheservicedirectory,andcopytheTomcat;

Andthenbuildanewportaldirectory,theliferay-portal-src-5.2.3.zipcompressionpackageinthesourcefiledecompressiontothedirectory.MyworkspaceisD:

\p

Rogram\Liferay.

Asshowninthedirectorystructure:

4.2importLiferaysourcecode

(1)

Switchingworkspace

StartMyeclipseandswitchtothenewLiferayworkspace.

Methodofoperation:

selectmenuFile,Switch,Workspace,Other,selectLiferaydirectory,clicktoconfirmthecompletionoftheoperation.

(2)

Importsourcecode

Selectmenu:

FiletoImport;

Inthepop-upwindow,select"ExistingProjectsintoWorkspace""

Click"NEXT"andenterthesourcefiledirectoryselectionwindow.In"Selectroot"

"Directory",selectthefrontofthenewgoodstorageLiferaysourcefiledirectoryportal.

Click"Finish"toimport,waitforMyeclipsetoloadandcompiletheworkspace,andthenthefollowingdirectorystructureappears:

4.3modifyconfigurationfile4.3.1

Newrelease.${username}.propertiesextensionenvironmentconfigurationfile

WhenyouentertheD:

\program\Liferay\portaldirectory,you'llseetherelease.propertiesconfigurationfile.

AccordingtoLiferay,thefilecannotbemodified,butitisnecessarytocreatearelease.${username}.propertiesfileinthesamedirectory

It'sanextensionfileforrelease.properties,andthepropertyconfigurationinrelease.${username}.propertiesoverridestherelease.properties

Attribute.

${username}isacomputerlogin,officialconfigurationdocumentationprovidesaviewoftheCMDinputmethod:

usernameset.

Asshowninthefigure,mycomputerusernameisrecky,thenwe'regoingtocreatetherelease.recky.propertiesfile,andthenaddthefollowing

Volume:

##lp.eclipse.dirtellsLiferaywhereyouinstalledEclipse.

##lp.ext.dirtellsLiferaywheretocreatetheEXTenvironment.

##ExtensionEnvironment

##

Lp.ext.dir=D:

/program/Liferay/ext

##

##Eclipse

##

##lp.eclipse.dir=

Lp.eclipse.project.name=ext

##

##AntInstaller

##

#ant.installer.dir=D:

/apache-ant-1.8.0

Explanation:

lp.ext.dirpointstoextendedenvironmentdirectory.Afterthedirectoryissetup,aseriesofextendedfilesareautomaticallygeneratedbyant.

Lp.eclipse.diristheeclipseinstallationdirectory,whichcanbedefault.

Lp.eclipse.project.nameextendsthenameoftheproject,whichseemstobedefault.

Ant.installer.diristheANTinstallationdirectory.

4.3.2

Addnewapp.server.${username}.propertiesserverconfigurationfile

IntheD:

\program\Liferay\portaldirectory,you'llseetheapp.server.propertiesconfigurationfile.Thisisacustomserverconfigurationscriptfile

.Herewe'regoingtocreateapp.server.inthesamedirectory

${username}.propertiesfile,useyourcomputerloginusernametoreplace${username}.

Createanewfileapp.server.recky.properties,andaddthefollowing:

App.server.type=tomcat

App.server.tomcat.dir=D:

/program/Liferay/service/apache-tomcat-6.0.24

##app.server.typetellsLiferaywhichserveritwilldeployto

##app.server.tomcat.

迪尔告诉LiferayTomcat的位置

说明:

app.server.type指定服务器类型

app.server.tomcat.dir指定Tomcat安装目录

4.3.3

修改建立XML文件。

修改下面的操作

找到

<复制todir=“${LP。

ext.dir}”preservelastmodified=“true”>

包括=“应用程序服务器。

性质”/>

添加一个如下:

包括=“应用程序服务器。

瑞克室内。

性质”/>

在Liferay官方文档中是没有此操作的,那为什么这样做呢?

在官方文档中是这样说明的:

新增释放。

${用户名}

文件之后。

性质,通过命令创建扩展环境下一步才是创建app.server蚂蚁。

${用户名}。

性能文件(它在前边指定的扩展文件夹根目录)。

原建立XML文件执行时是不拷贝你新建的APP。

服务器。

${用户名}。

性能文件到扩展环境的,所以这里我们要加上这段代码。

这样,执行建立文件创建扩展文件的

同时也将对应的自定义服务器配置文件复制到扩展环境中。

4.4编译生成Ext扩展工程

4.4.1

打开蚂蚁视图

选择菜单窗口→显示视图→其他

弹出选择框,选中蚂蚁,蚂蚁视图打开点击好

4.4.2

添加建立文件

点击蚂蚁视图工具栏中的添加建立文件按钮

,打开选择页面如下图,展开门户项目文件夹,选中建立XML,点击好完成添加。

4.4.3

执行建立文件

右键单击刚才添加蚂蚁任务门户,选择菜单运行→对外开放

打开外部工具界面:

在执行任务之前配置JRE和JVM参数

JRE使用前边安装好的JDK1.6,在VM参数中输入如下参数以加大蚂蚁运行内存:

-xms256m-xmx512m

-xxermsize=256mXX:

maxpermsize=512m。

配置完成之后,点击适用。

然后切换到目标任务对象标签,依次选择

清洁的

开始

建立外部任务,如图:

点击阶按钮,配置选中任务的执行顺序。

确保按清洁开始建立EXT的顺序:

点击“OK”,回到刚才的页面上,点击“跑”运行任务。

提示:

在蚂蚁视图中双击任务名称即可运行。

选中某个任务,然后单击蚂蚁视图工具栏中的

运行按钮也可执行该任务。

MyEclipse在执行蚂蚁任务时,控制台会打印出任务执行的日志信息,任务成功执行完毕之后,在D:

/程序/系统

目录下会生成一系列文件和目录这样Ext扩展工程生成完毕/分机。

4.5为什么要生成扩展工程

开发者为了把自己开发的客户化代码和Liferay源代码分离开Liferay推荐开发者

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1