php编译安装ldap,源码编译安装ldap+apache+php+phpldapadmin

For reprint content of this site,Declined reprint

为保障原作者权利,谢绝转载

源码包:

db-4.7.25.tar.gz

openldap-stable-20090411.tar.gz

phpldapadmin-1.2.1.1.tar.gz

Apache2.4.2.tar.gz

Php.5.4.5.tar.gz

apr-1.4.6.tar.gz

apr-util-1.4.1.tar.gz

gettext-0.17.tar.gz

libmcrypt-2.5.7.tar.gz

libpng-1.5.12.tar.gz

libxml2-2.7.7.tar.gz

安装BerkeleyDB

#tar -zxf

db-4.7.25.tar.gz

# cd  db-4.7.25/build_unix

#

../dist/configure

# make

# make  install

# vi  /etc/ld.so.conf(加入:/usr/local/BerkeleyDB.4.7/lib)

#/sbin/ldconfig

安装openldap

#

tar  zxvf

openldap-stable-20090411.tgz

# cd  openldap-2.4.16

# env

CPPFLAGS=”-I/usr/local/BerkeleyDB.4.7/include”

LDFLAGS=”-L/usr/local/BerkeleyDB.4.7/lib”  ./configure

--prefix=/usr/local/openldap

--enable-ldbm

# make

depend

# make

# make

install

(配置文件目录为:/usr/local/openldap/etc/openldap/)

配置openldap

复制配置文件

# cp /usr/locla/openldap/etc/openldap/DB_CONFIG.example

/usr/local/openldap/var/openldap-data/DB_CONFIG

修改slapd.conf配置文件,

Vim /usr/local/openldap/etc/openldap/slapd.conf

内容如下

#

#

See slapd.conf(5) for details on configuration options.

#

This file should NOT be world readable.

#

include

/usr/local/openldap/etc/openldap/schema/core.schema

include

/usr/local/openldap/etc/openldap/schema/corba.schema

include

/usr/local/openldap/etc/openldap/schema/cosine.schema

include

/usr/local/openldap/etc/openldap/schema/dyngroup.schema

include

/usr/local/openldap/etc/openldap/schema/inetorgperson.schema

include

/usr/local/openldap/etc/openldap/schema/java.schema

include

/usr/local/openldap/etc/openldap/schema/misc.schema

include

/usr/local/openldap/etc/openldap/schema/nis.schema

include

/usr/local/openldap/etc/openldap/schema/openldap.schema

include

/usr/local/openldap/etc/openldap/schema/ppolicy.schema

#

Define global ACLs to disable default read access.

#

Do not enable referrals until AFTER you have a working directory

#

service AND an understanding of referrals.

#referral       ldap://root.openldap.org

pidfile         /usr/local/openldap/var/run/slapd.pid

argsfile        /usr/local/openldap/var/run/slapd.args

#

Load dynamic backend modules:

#

modulepath

/usr/local/openldap/libexec/openldap

#

moduleload    back_bdb.la

#

moduleload    back_hdb.la

#

moduleload    back_ldap.la

#

Sample security restrictions

#       Require integrity protection (prevent

hijacking)

#       Require 112-bit (3DES or better)

encryption for updates

#       Require 63-bit encryption for simple

bind

#

security ssf=1 update_ssf=112 simple_bind=64

#

Sample access control policy:

#       Root DSE: allow anyone to read it

#       Subschema (sub)entry DSE: allow anyone

to read it

#       Other DSEs:

#               Allow self write access

#               Allow authenticated users read

access

#               Allow anonymous users to

authenticate

#       Directives needed to implement policy:

#

access to dn.base="" by * read

#

access to dn.base="cn=Subschema" by * read

#

access to *

#       by self write

#       by users read

#       by anonymous auth

#

#

if no access controls are present, the default policy

#

allows anyone and everyone to read anything but restricts

#

updates to rootdn.  (e.g., "access

to * by * read")

#

#

rootdn can always read and write EVERYTHING!

#######################################################################

#

BDB database definitions

#######################################################################

database        bdb

suffix

"dc=abc,dc=com"

rootdn

"cn=manager,dc=abc,dc=com"

#

Cleartext passwords, especially for the rootdn, should

#

be avoid.  See slappasswd(8) and

slapd.conf(5) for details.

#

Use of strong authentication encouraged.

rootpw          password

#

The database directory MUST exist prior to running slapd AND

#

should only be accessible by the slapd and slap tools.

#

Mode 700 recommended.

directory       /usr/local/openldap/var/openldap-data

#

Indices to maintain

index   objectClass     eq

修改ldap.conf配置文件

Vim /usr/local/openldap/etc/openldap/ldap.conf

内容如下

#

#

LDAP Defaults

#

#

See ldap.conf(5) for details

#

This file should be world readable but not world writable.

BASabcc,dc=com

#URI    ldap://ldap.example.com

ldap://ldap-master.example.com:666

#SIZELIMIT      12

#TIMELIMIT      15

#DEREF          never

测试启动

#/usr/local/openldap/libexec/slapd -d 256

编译安装apache2.4

前提:

1

#yuminstall libtoollibtool-ltdl-y

[root@localhost

apr-1.4.6]# ./configure

[root@localhost

apr-1.4.6]#make

[root@localhost

apr-1.4.6]#make install

2

[root@localhost

apr-util-1.4.1]# ./configure --with-apr=/usr/local/apr

[root@localhost

apr-util-1.4.1]#make

[root@localhost

apr-util-1.4.1]#make install

3

[root@www pcre-8.30]#./configure

[root@www

pcre-8.30]#make

[root@www

pcre-8.30]#make install

4

[root@www httpd-2.4.2]#./configure--enable-mods-shared=all --enable-so

[root@www

httpd-2.4.2]#make

[root@www

httpd-2.4.2]#make install

安装php

1

[root@www

gettext-0.17]#./configure --prefix=/usr/local/gettex

[root@www

gettext-0.17]#make

[root@www

gettext-0.17]#make install

2配置库文件搜索路径

[root@www

gettext-0.17]# echo "/usr/local/gettex/lib" >> /etc/ld.so.conf

[root@www

gettext-0.17]# ldconfig -v

3

[root@www libxml2-2.7.7]#./configure

[root@www

libxml2-2.7.7]#make

[root@www

libxml2-2.7.7]#make install

4

[root@www libpng-1.5.12]#./configure

[root@www

libpng-1.5.12]#make

[root@www

libpng-1.5.12]#make install

5

[root@www libmcrypt-2.5.7]#./configure

[root@www

libmcrypt-2.5.7]#make

[root@www

libmcrypt-2.5.7]#make install

6

#yum install zlib-devel

7

[root@www

php-5.4.5]# ./configure --prefix=/data/php5 --with-config-file-path=/etc

--with-apxs2=/usr/local/apache2/bin/apxs --with-zlib --enable-xml

--enable-mbstring --enable-sockets --with-ldap=/usr/local/openldap

--with-gettext=/usr/local/gettex--with-zlib-dir

[root@www

php-5.4.5]#make

[root@www

php-5.4.5]#make install

[root@www

php-5.4.5]# cp php.ini-dist /etc/php.ini

# vi

/data/apache/conf/httpd.conf

#查找AddType

application/x-compress .Z

AddType

application/x-gzip .gz .tgz

在其下加入

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

AddType

application/x-tar .tgz

AddType

application/x-httpd-php .php

AddType

application/x-httpd-php-source .phps

AddType p_w_picpath/x-icon

.ico

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

改DirectoryIndex

行,添加index.php

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值