1、liferay cas ldap tomcat单点登录门户Liferay cas ldap tomcat single sign on portalliferay+cas+ldap+tomcat_单点登录门户(Liferay+cas+ldap+tomcat_ single sign on portal)java versionant - versionant 配置(1) the ant _ home: ant 的安装目录(2) path: 把% ant _ home% bin目录加到path变量修改配置文件新增 release. $username.properties 扩展环境配置文件进入
2、liferay portal 目录, 你会看到 release.properties配置文件 按照官方的说法, 此文件不能修改的, 但是同目录下要创建一个release. $username.properties 文件, 他是relese.properties的扩展文件, release. $username.properties中的属性会覆盖release.properties中的属性.username $ 是计算机的登陆用户名: shawn.zhang如: release.shawn.zhang.propertiesant.installer.dir = d: / apache ant -
3、 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 文
4、件在里面添加一下内容:app.server.type = tomcat 指定服务器类型app.server.tomcat.dir = d: / program / liferay / server /apache-tomcat-6.o.24 app.server.tomcat.dir 指定tomcat安装路径* 修改build.xml文件找到 liferay + cas + ldap + tomcat 单点登录门户(如果没有域名)将计算机改名: 右击我的电脑 - 属性 - 计算机名 - 更改 - (我的为smallun, 后面很多地方用到) 重启cas部分1、下载cas server 3.2c
5、as-client-3.1.10http: / / www.jasig.org / cas / download2、使用keytool配置tomcat的ssl支持在dos窗体运行以下指令 (可以使用bat):clsrem please see the env java _ home before run this bat filerem delete alia tomcat if it is existedkeytool - delete - a.k.a. smdc - keystore% java _ home% / right / lib / security / cacerts - st
6、orepass changeit(注释: 清除系统中可能存在的名字为smdc的同名证书)rem list all alias in the cacertskeytool list keystore% java _ home% / right / lib / security / cacerts - storepass changeit(注释: 列出系统证书仓库中存在证书名称列表)rem generator a keykeytool - genkey - keyalg rsa alias smdc - dname cn = url storepass changeit(注释: 指定使用rsa算法
7、, 生成别名为smdc的证书, 存贮口令为changeit, 证书的dn为 cn = url, 这个dn必须是cas工程url或者当前主机完整名称 我的为smallun, 切记!REM导出密钥以上出口别名部文件% java_home % /嘉园/ lib /安全/ smdc.crt - storepass修改(注释:从keystore中导出别名为SMDC的证书,生成文件SMDC。CRT)REM导入信任cacerts可以导入别名部文件% % / java_home JRE / lib /安全/ smdc.crt - keystore % java_home % /嘉园/ lib /安全/ cac
8、erts - storepass修改(注释:将SMDC。CRT导入JRE的可信任证书仓库。注意,安装JDK是有两个JRE目录,一个在底下一个是独立的JDK,JRE,这里的目录必须同Tomcat使用的JRE目录一致,否则后面Tomcat的HTTPS通讯就找不到证书了)REM列出所有别名在cacerts以上列表java_home keystore % % /嘉园/ lib /安全/ cacerts - storepass修改(注释:列出JRE可信任证书仓库中证书名单,验证先前的导入是否成功,如果导入成功,应该在列表中能找到SMDC这个别名,如下图)引用同时,在D: jdk1.6.0_04 JRE
9、java库安全目录下能找到”部。CRT”这个文件;在C:文件和设置用户名目录下能找到”。私钥”文件改名”部。密钥库”满足上述条件则部署完成。3、配置Tomcat的HTTPS服务编辑% % 会议下的Apache Tomcat服务器。XML文件,在连接器的配置位置添加以下的配置:(。keystore放到在Tomcat根目录)引用4、定制CAS在% catalina_home % /程序/ CAS /下/ deployerconfigcontext XML文件中修改:java.naming.security.authentication值 COM。太阳。JNDI。LDAP连接超时值 /。 20000
10、 COM。太阳。JNDI。LDAP。读。超时值 / 20000 添加ldap认证:- bean id = attributerepositoryclass = org.jasig.services.persondir.support.stubpersonattributedao - property name = backingmap (map)map / / bean注意: 一定要将cas所依赖的包导入.liferay部分1.关于liferayliferay 是一个完整的门户解决方案, 基于j2ee的应用, 使用了ejb以及jms等技术, 前台界面部分使用struts mvc框架, 基于xm
11、l的portlet配置文件可以自由地动态扩展, 使用了web服务来支持一些远程信息的获取, 使用lucene实现全文检索功能.(lucene是一套用于全文检索和搜寻的开源程式库, 由apache软件基金会支持和提供.lucene提供了一个简单强大的应用程式接口, 能够做全文索引和搜寻, 在java开发环境里lucene是一个成熟的免费开放源代码工具; 就其本身而论, lucene是现在并且是这几年, 最受欢迎的免费java资讯检索程式库.人们经常提到资讯检索程式库, 就像是搜寻引擎, 但是不应该将资讯检索程式库与网搜索引擎相混淆.)主要特点如下:1、提供单一登陆接口, 多认证模式 (ldap或
12、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 下载liferay 5.2.3liferay源
13、码包liferay-portal-src-5.2.3.ziporacle数据文件 liferay-portal-sql-oracle-10-5.2.3.dmp(下载地址: http: / / / project / showfiles.php? group _ id = 49260)2.2 开发工具jdk 1.6 以上;ant 1.7 以上;tomcat 6.0 以上;myeclipse 5.1以上;3.环境配置3.1 jdk配置(1) java _ home: jdk的安装目录(2) path: 把% java _ home% bin目录加到path变量(检查jdk是否安装正确, 通过 ja
14、va version 命令来判断.同样下边的ant也是同样的方式进行检查 ant version )3.2 ant配置(1) ant _ home: ant的安装目录(2) path: 把% ant _ home% bin目录加到path变量3.3 myeclipse配置(1) 设置myeclipse的jdkmyeclipse的jdk采用上面安装过的jdk1.6(2) 设置字符编码字符编码统一采用utf - 8(3) tomcat server 选择6.x, 目录为tomcat的目录, jdk采用上面安装过的jdk1.6.在后面的 部署ext扩展工程 会详细说明.4.部署liferay源码4.
15、1 build directory structureCreate a workspace directory Liferay, then create two directories in the Liferay directory, one is the service directory, and copy the Tomcat;And then build a new portal directory, the liferay-portal-src-5.2.3.zip compression package in the source file decompression to the
16、 directory. My workspace is D:pRogramLiferay.As shown in the directory structure:4.2 import Liferay source code(1)Switching workspaceStart Myeclipse and switch to the new Liferay workspace.Method of operation: select menu File, Switch, Workspace, Other, select Liferay directory, click to confirm the
17、 completion of the operation.(2)Import source codeSelect menu: File to Import;In the pop-up window, select Existing Projects into WorkspaceClick NEXT and enter the source file directory selection window. In Select rootDirectory, select the front of the new good storage Liferay source file directory
18、portal.Click Finish to import, wait for Myeclipse to load and compile the workspace, and then the following directory structure appears:4.3 modify configuration file 4.3.1New release.$username.properties extension environment configuration fileWhen you enter the D:programLiferayportal directory, you
19、ll see the release.properties configuration file.According to Liferay, the file cannot be modified, but it is necessary to create a release.$username.properties file in the same directoryIts an extension file for release.properties, and the property configuration in release.$username.properties over
20、rides the release.propertiesAttribute.$username is a computer login, official configuration documentation provides a view of the CMD input method: user name set.As shown in the figure, my computer username is recky, then were going to create the release.recky.properties file, and then add the follow
21、ingVolume:#lp.eclipse.dir tells Liferay where you installed Eclipse.#lp.ext.dir tells Liferay where to create the EXT environment.# Extension Environment#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.0Explanati
22、on: lp.ext.dir points to extended environment directory. After the directory is set up, a series of extended files are automatically generated by ant.Lp.eclipse.dir is the eclipse installation directory, which can be default.Lp.eclipse.project.name extends the name of the project, which seems to be
23、default.Ant.installer.dir is the ANT installation directory.4.3.2Add new app.server. $username.properties server configuration fileIn the D:programLiferayportal directory, youll see the app.server.properties configuration file. This is a custom server configuration script file. Here were going to cr
24、eate app.server. in the same directory$username.properties file, use your computer login user name to replace $username.Create a new file app.server.recky.properties, and add the following:App.server.type=tomcatApp.server.tomcat.dir=D:/program/Liferay/service/apache-tomcat-6.0.24#app.server.type tel
25、ls Liferay which server it will deploy to#app.server.tomcat.迪尔告诉Liferay Tomcat的位置说明:app.server.type指定服务器类型app.server.tomcat.dir指定Tomcat安装目录4.3.3修改建立XML文件。修改下面的操作找到添加一个如下:在Liferay官方文档中是没有此操作的,那为什么这样做呢?在官方文档中是这样说明的:新增释放。$ 用户名文件之后。性质,通过命令创建扩展环境下一步才是创建app.server蚂蚁。$ 用户名。性能文件(它在前边指定的扩展文件夹根目录)。原建立XML文件执行时
26、是不拷贝你新建的APP。服务器。$ 用户名。性能文件到扩展环境的,所以这里我们要加上这段代码。这样,执行建立文件创建扩展文件的同时也将对应的自定义服务器配置文件复制到扩展环境中。4.4编译生成Ext扩展工程4.4.1打开蚂蚁视图选择菜单窗口显示视图其他弹出选择框,选中蚂蚁,蚂蚁视图打开点击好4.4.2添加建立文件点击蚂蚁视图工具栏中的添加建立文件按钮,打开选择页面如下图,展开门户项目文件夹,选中建立XML,点击好完成添加。4.4.3执行建立文件右键单击刚才添加蚂蚁任务门户,选择菜单运行对外开放打开外部工具界面:在执行任务之前配置JRE和JVM参数JRE使用前边安装好的JDK1.6,在VM参数中
27、输入如下参数以加大蚂蚁运行内存:- xms256m - xmx512m- xxermsize = 256m XX:maxpermsize = 512m。配置完成之后,点击适用。然后切换到目标任务对象标签,依次选择清洁的开始建立外部任务,如图:点击阶按钮,配置选中任务的执行顺序。确保按清洁开始建立EXT的顺序:点击“OK”,回到刚才的页面上,点击“跑”运行任务。提示:在蚂蚁视图中双击任务名称即可运行。选中某个任务,然后单击蚂蚁视图工具栏中的运行按钮也可执行该任务。MyEclipse在执行蚂蚁任务时,控制台会打印出任务执行的日志信息,任务成功执行完毕之后,在D:/程序/系统目录下会生成一系列文件和目录这样Ext扩展工程生成完毕/分机。4.5为什么要生成扩展工程开发者为了把自己开发的客户化代码和Liferay源代码分离开Liferay推荐开发者
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1