pengjunling 发表于 2018-11-25 14:59:36

源码编译安装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 -zxfdb-4.7.25.tar.gz
  # cddb-4.7.25/build_unix
  #../dist/configure
  # make
  # makeinstall
  # vi/etc/ld.so.conf(加入:/usr/local/BerkeleyDB.4.7/lib)
  #/sbin/ldconfig
  安装openldap
  #tarzxvf openldap-stable-20090411.tgz
  # cdopenldap-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
  # makedepend
  # make
  # makeinstall
  (配置文件目录为:/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 (preventhijacking)
  #       Require 112-bit (3DES or better)encryption for updates
  #       Require 63-bit encryption for simplebind
  #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 anyoneto read it
  #       Other DSEs:
  #               Allow self write access
  #               Allow authenticated users readaccess
  #               Allow anonymous users toauthenticate
  #       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., "accessto * 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) andslapd.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.comldap://ldap-master.example.com:666
  #SIZELIMIT      12
  #TIMELIMIT      15
  #DEREF          never
  测试启动
  #/usr/local/openldap/libexec/slapd -d 256
  编译安装apache2.4
  前提:
  1
  #yum install libtool libtool-ltdl -y
  # ./configure
  #make
  #make install
  2
  # ./configure --with-apr=/usr/local/apr
  #make
  #make install
  3
  # ./configure
  # make
  # make install
  4
  #./configure --enable-mods-shared=all --enable-so
  #make
  #make install
  安装php
  1
  #./configure --prefix=/usr/local/gettex
  #make
  #make install
  2   配置库文件搜索路径
  # echo "/usr/local/gettex/lib" >> /etc/ld.so.conf
  # ldconfig -v
  3
  #./configure
  #make
  #make install
  4
  ]#./configure
  #make
  #make install
  5
  ]#./configure
  #make
  #make install
  6
  #yum install zlib-devel
  7
  # ./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
  #make
  #make install
  # cp php.ini-dist /etc/php.ini
  # vi/data/apache/conf/httpd.conf
  #查找AddTypeapplication/x-compress .Z
  AddTypeapplication/x-gzip .gz .tgz
  在其下加入
  ---------------------------------------------------
  AddTypeapplication/x-tar .tgz
  AddTypeapplication/x-httpd-php .php
  AddTypeapplication/x-httpd-php-source .phps
  AddType image/x-icon.ico
  ---------------------------------------------------
  改DirectoryIndex行,添加index.php
  

  

  




页: [1]
查看完整版本: 源码编译安装ldap+apache+php+phpldapadmin