淡定哥头像

技术文档

Linux ApacheDS, OpenLDAP, Fortress 安装配置

Linux ApacheDS, OpenLDAP, Fortress 安装配置

1. 安装 ApacheDS

Linux 32位(as root):
wget http://mirror.nexcess.net/apache//directory/apacheds/dist/2.0.0-M19/apacheds-2.0.0-M19-64bit.bin
chmod a+x *.bin
./apacheds-2.0.0-M19-64bit.bin

Linux 64位(as root):
wget http://mirror.nexcess.net/apache//directory/apacheds/dist/2.0.0-M19/apacheds-2.0.0-M19-64bit.bin
chmod a+x *.bin
./apacheds-2.0.0-M19-64bit.bin
            
在wrapper.conf文件添加如下: 
vi /opt/apacheds-2.0.0-M19/conf/wrapper.conf
------------------------------------------------------
wrapper.java.command=/opt/jdk1.8.0_05/bin/java
------------------------------------------------------

vi /var/lib/apacheds-2.0.0-M19/start/conf/wrapper.conf
------------------------------------------------------------------
wrapper.java.command=/opt/jdk1.8.0_05/bin/java
------------------------------------------------------------------

vi /var/lib/apacheds-2.0.0-M19/stop/conf/wrapper.conf
------------------------------------------------------------------
wrapper.java.command=/opt/jdk1.8.0_05/bin/java
------------------------------------------------------------------

启动apacheds
/etc/init.d/apacheds-2.0.0-M19-default start

检查apacheds状态
/etc/init.d/apacheds-2.0.0-M19-default status


2. 安装配置 Apache Directory Studio LDAP Browser

Linux 32位(as root):
wget http://mirrors.ibiblio.org/apache//directory/studio/dist/2.0.0.v20130628/ApacheDirectoryStudio-linux-x86-2.0.0.v20130628.tar.gz
tar xvf ApacheDirectoryStudio-linux-x86-2.0.0.v20130628.tar.gz
cd ApacheDirectoryStudio-linux-x86-2.0.0.v20130628/

Linux 64位(as root):
wget http://mirror.bit.edu.cn/apache/directory/studio/2.0.0.v20150606-M9/ApacheDirectoryStudio-2.0.0.v20150606-M9-linux.gtk.x86_64.tar.gz
tar xvf ApacheDirectoryStudio-linux-x86_64-2.0.0.v20130628.tar.gz
cd ApacheDirectoryStudio-linux-x86_64-2.0.0.v20130628/

./ApacheDirectoryStudio

在LDAP Browser里添加一个Connection


设置Authentication


3. 安装配置 Fortress Core

安装Git
yum install git-daemon
yum install git
用Git下载Fortress项目代码
cd /home/web/git/
git clone https://git-wip-us.apache.org/repos/asf/directory-fortress-core.git
git clone https://git-wip-us.apache.org/repos/asf/directory-fortress-enmasse.git
git clone https://git-wip-us.apache.org/repos/asf/directory-fortress-realm.git
git clone https://git-wip-us.apache.org/repos/asf/directory-fortress-commander.git

cd /home/web/git/directory-fortress-core/
cp build.properties.example build.properties

编译生成fortress core包, 这步将根据build.properties生成config artifacts.

mvn install -DskipTests


3.1 配置初始化AapacheDS Fortress数据,参考如下:

使用Apache Directory Studio 从文件 ldap/schema/apacheds-fortress.ldif 中加载fortress schem 到ApacheDS 
在Apache Directory Studio LDAP Browser视图中,选择 Root DSE, 右键,选择 Import->LDIF Import


在下一个对话框中,输入fortress schema的文件路径,比如: /home/web/git/directory-fortress-core/ldap/schema/apacheds-fortress.ldif

浏览 cn=fortress 的Schema节点,验证成功

3.2 配置初始化OpenLdap Fortress 数据,参考如下:

ant load-slapd

如何安装配置 Ant,请参考文档:Linux CentOS6.5 Ant安装、环境变量配置  

如何安装配置 Java,请参考文档:centos 6.5配置java环境


3.3 加载xml data

生成 fortress LDAP DIT , 创建 config node, 加载 A/RBAC policies:
mvn install -Dload.file=./ldap/setup/refreshLDAPData.xml -DskipTests
mvn install -Dload.file=./ldap/setup/DelegatedAdminManagerLoad.xml -DskipTests

运行Fortress Core Regression Test:
mvn -Dtest=FortressJUnitTest test

4. 安装Fortress Realm 
cd /home/web/git/directory-fortress-realm/
mvn clean install

5. 安装Tomcat Web Server   
cd /opt/soft
wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.61/bin/apache-tomcat-7.0.61.tar.gz
tar xzf apache-tomcat-7.0.61.tar.gz -C /opt/
/opt/apache-tomcat-7.0.61/bin/startup.sh

查看tomcat是否运行
ps -ef | grep tomcat

复制 fortress-realm proxy jar 到tomcat lib 目录
cp /home/web/git/directory-fortress-realm/proxy/target/fortress-realm-proxy-1.0-RC41-SNAPSHOT.jar /opt/apache-tomcat-7.0.61/lib/

给tomcat tcmanager用户添加权限,通过maven可以访问GUI和deploy
vi /opt/apache-tomcat-7.0.61/conf/tomcat-users.xml
------------------------------------------------------

<role rolename="manager-script"/> 

<role rolename="manager-gui"/> 

<user username="tcmanager" password="m@nager123" roles="manager-script"/> 

<user username="tcmanagergui" password="m@nager123" roles="manager-gui"/>

------------------------------------------------------

重启Tomcat:
/opt/apache-tomcat-7.0.61/bin/shutdown.sh
/opt/apache-tomcat-7.0.61/bin/startup.sh

查看tomcat日志:
tail -500f /opt/apache-tomcat-7.0.61/logs/catalina.out

登录Tomcat Manager app,用户名:tcmanagergui 密码:m@nager123
http://localhost:8080/manager 

6. 安装配置 Fortress Web
cd /home/web/git/directory-fortress-commander/
cp /home/web/git/directory-fortress-core/config/fortress.properties /home/web/git/directory-fortress-commander/src/main/resources

用maven部署 fortress web:
mvn tomcat:deploy

加载用户测试数据
cd /home/web/git/directory-fortress-commander
mvn install -Dload.file=src/main/resources/FortressWebDemoUsers.xml

重新部署:
mvn tomcat:redeploy

访问fortress-web web app: 
http://localhost:8080/fortress-web,

测试登录账号
userId: test, password: password
userId: test1, password: password
userId: test2, password: password
userId: test3, password: password

运行Selenium Web driver integration tests:
mvn verify -DskipTests=false -Dnoload


分享到: 

* 发表评论:
Top