openLDAP install guide

This steps is a sample of installing openLDAP on Solaris 10

 

 

 

-- install BerkeleyDB
1. Download BerkelayDB (db-4.7.25.NC.tar.gz)
2. gunzip ..., tar -xvf ...   
3. cd .../db-4.7.25.NC
2.  cd build_unix
3. ../dist/configure --prefix=...
4. make
5. make install
 
-- install OpenLDAP
1. download openLDAP from openLDAP.org (openldap-stable.tgz)
2. gunzip ..., tar -xvf ...
3.export environment
    export CFLAGS="-D_AVL_H"   # see comment 1
    export CPPFLAGS="-I/ $(BerkeleyDBInstalled) /include "
    export LDFLAGS="-L/ $(BerkeleyDBInstalled) /lib"
    export LD_LIBRARY_PATH="/$(BerkeleyDBInstalled)/lib"
 
2. cd /.../openldap-2.4.16
3. ./configure --prefix=/... --with-tls=no
4. make depend
5. make
6. make install

comment 1:
If following compile error you met, this CFLAGS must be defined.

"//include/avl.h", line 86: identifier redeclared: avl_insert
current : function(pointer to pointer to struct avlnode {pointer to void
avl_data, array[2] of pointer to struct avlnode {} avl_link, array[2] of char
avl_bits, signed char avl_bf}, pointer to void, pointer to function()
returning int, pointer to function() returning int) returning int
previous: function(pointer to struct avl_tree {pointer to struct
avl_node {} avl_root, pointer to function() returning int avl_compar,
unsigned long avl_offset, unsigned long avl_numnodes, unsigned long avl_size},
pointer to void, unsigned long) returning void : "/usr/include/sys/avl.h", line
154
"//include/avl.h", line 92: identifier redeclared: avl_find
current : function(pointer to struct avlnode {pointer to void avl_data,
array[2] of pointer to struct avlnode {} avl_link, array[2] of char avl_bits,
signed char avl_bf}, pointer to const void, pointer to function() returning
int) returning pointer to void
previous: function(pointer to struct avl_tree {pointer to struct
avl_node {} avl_root, pointer to function() returning int avl_compar,
unsigned long avl_offset, unsigned long avl_numnodes, unsigned long avl_size},
pointer to void, pointer to unsigned long) returning pointer to void :
"/usr/include/sys/avl.h", line 146


-- define LDAP server configure file
#:> cat /tmp/donot_delete_it_hui/build_openldap/tests/testrun/slapd.1.conf
include         /u/huishen/tmp/install/etc/openldap/schema/core.schema
include         /u/huishen/tmp/install/etc/openldap/schema/cosine.schema
include         /u/huishen/tmp/install/etc/openldap/schema/inetorgperson.schema
include         /u/huishen/tmp/install/etc/openldap/schema/openldap.schema
include         /u/huishen/tmp/install/etc/openldap/schema/nis.schema

#
pidfile         /tmp/donot_delete_it_hui/build_openldap/tests/testrun/slapd.1.pid
argsfile        /tmp/donot_delete_it_hui/build_openldap/tests/testrun/slapd.1.args

#######################################################################
# database definitions
#######################################################################                  
                                                                                         
database        bdb                                                                      
suffix          "dc=example,dc=com"                                                      
rootdn          "cn=Manager,dc=example,dc=com"                                           
rootpw          secret                                                                   
directory       /tmp/donot_delete_it_hui/build_openldap/tests/testrun/db.1.a             
index           objectClass     eq                                                       
index           cn,sn,uid       pres,eq,sub                                              
checkpoint              1024 5

-- start LDAP server

#:> /u/huishen/tmp/install/libexec/slapd /
-s0 /
-f /tmp/donot_delete_it_hui/build_openldap/tests/testrun/slapd.1.conf /
-h ldap://localhost:9011/ /
-d 261

# the LDAP will listen on port 9011


-- Check LDAP server is available
/u/huishen/tmp/install/bin/ldapsearch -x -b '' -s base -h localhost -p 9011 '(objectclass=*)' namingContexts
-- Add new item into LDAP server
#:> cat example.ldif
dn: dc=example,dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example
dn: cn=Manager,dc=example,dc=com
objectclass: organizationalRole
cn: Manager
#:>
/u/huishen/tmp/install/bin/ldapadd -x -D "cn=Manager,dc=example,dc=com" -h localhost -p 9011 -W -f example.ldif
-- Verify new item has saved into LDAP server
/u/huishen/tmp/install/bin/ldapsearch -x -b 'dc=example,dc=com' -h localhost -p 9011 '(objectclass=*)'

要在Ubuntu 22.04上安装Subversion (SVN) 并将其配置与OpenLDAP同步,你可以按照以下步骤操作: 1. **更新系统并安装必要的软件包**: ```bash sudo apt update sudo apt install subversion openssh-server ldap-utils ``` 2. **设置SSH公钥认证**: - 首先,生成SSH密钥对: ```bash ssh-keygen -t rsa -b 4096 ``` - 将公钥添加到`~/.ssh/id_rsa.pub`的内容,并复制到OpenLDAP服务器的对应用户账户的`authorized_keys`文件。 3. **配置Subversion服务器**: - 创建一个新的Subversion仓库目录(如果尚未创建): ```bash mkdir /var/svn/repos chown svn:svnx /var/svn/repos chmod 755 /var/svn/repos ``` - 使用`svnadmin create`初始化仓库: ```bash svnadmin create /var/svn/repos/myrepo ``` 4. **配置Apache作为Subversion访问中介**: - 如果还没有安装Apache,可以安装它: ```bash sudo apt install apache2 ``` - 启动Apache并打开配置文件编辑权限: ```bash sudo systemctl start apache2 sudo nano /etc/apache2/sites-available/default ``` - 添加指向Subversion仓库的URL映射。例如: ``` <Location /> DAV svn SVNPath /var/svn/repos </Location> ``` 5. **启用虚拟主机并重启服务**: ```bash a2ensite default sudo systemctl restart apache2 ``` 6. **配置OpenLDAP**: - 确保你的OpenLDAP服务器已经运行并且配置正确。你需要将Subversion用户的DN、密码等信息添加到合适的 LDAP 模块里。 - 参考OpenLDAP的官方文档(如《OpenLDAP Administrator's Guide》)了解如何配置bind DN和映射到Subversion用户的信息。 完成以上步骤后,你应该能够通过HTTP(S)访问Subversion仓库,并通过OpenLDAP管理用户和权限。具体的设置可能会因你的环境而异,所以记得检查文档并调整以适应你的需求。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值