* 1 install apache2 (httpd-2.2.4 )*******
: Http://www.apache.org/dist/httpd/httpd-2.2.4.tar.gz
# Tar zxvf httpd-2.2.4.tar.gz
# Cd httpd-2.2.4
#./Configure -- prefix =/usr/local/apache2 -- enable-so -- enable-Rewrite
# Make
# Make install
# Vi/usr/local/apache2/CONF/httpd. conf
Modify
User nobody
Group nobody
Find the line # addtype application/X-tar. tgz and add two lines below.
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP-source. PHPs
Find the following line and add index. php. This indicates that the website's homepage can also be index. php.
Directoryindex index.html index. php
# Vi/etc/profile
Path = "$ path":/usr/local/apache2/bin
* 2 install PhP5 (php-5.2.3) **********************
: Http://cn2.php.net/get/php-5.2.3.tar.gz/from/this/mirror
# Tar zxvf php-5.2.3.tar.gz
# Cd php-5.2.3
#. /Configure -- prefix =/usr/local/PhP5 -- with-apxs2 =/usr/local/apache2/bin/apxs -- With-config-file-Path =/usr/local/PhP5 -- with-LDAP -- With-gettext
# Make
# Make install
# Cp PHP. ini-Dist/usr/local/PhP5/PHP. ini
* **************** 3 install Berkeley dB (4.5.20) ************************
Because OpenLDAP requires the use of Berkeley dB to store data, you must first install Berkeley.
Database.
: Http://www.oracle.com/technology/software/products/berkeley-db/htdocs/popup/db/4.5.20/db-targz.html
# Tar zxvf db-4.5.20.tar.tar
# Cd db-4.5.20/build_unix/
# ../Dist/configure
# Make
# Make install
# Vi/etc/lD. So. conf
Join
/Usr/local/berkeleydb.4.5/lib
#/Sbin/ldconfig
* ****************** 4 install OpenLDAP (2.3.32) ********************************
: Ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable/openldap-stable-20070110.tgz
# Tar zxvf openldap-stable-20070110.tgz
# Cd openldap-2.3.32/
# Env cppflags = "-I/usr/local/berkeleydb.4.5/include" ldflags = "-l/usr/local/berkeleydb.4.5/lib ". /configure -- prefix =/usr/local/OpenLDAP -- enable-bdb
# Make depend
# Make
# Make Test
# Make install
# Vi/usr/local/OpenLDAP/etc/OpenLDAP/slapd. conf
Add the following content to 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
Modify
Suffix "DC = Donnie, Dc = com"
Rootdn "cn = root, Dc = Donnie, Dc = com" # LDAP administrator username and password
Rootpw {ssha} ybw53fu7sd3wshdphowoa7x0enjrfury
{Ssha} ybw53fu7sd3wshdphowoa7x0enjrfury
#/Usr/local/OpenLDAP/sbin/slappasswd press enter and enter your password
Start OpenLDAP
#/Usr/local/OpenLDAP/libexec/slapd
Disable OpenLDAP
Run the following command:
PS-Ef | grep slapd
Root 5780 1 0? 00:00:00/usr/local/libexec/slapd
Root 5783 10179 0 00:00:00 pts/1 grep slapd
Then execute:
Killall slapd
Create DN
# Ldapadd-X-D 'cn = root, Dc = Donnie, Dc = com'-W
DN: DC = Donnie, Dc = com
Objectclass: dcobject
Objectclass: Organization
DC: Donnie
O: Corporation
Description: D Corporation
Note: there must be a space after the colon and no space at the end
Press Ctrl + D.
* ******************************** 5 install phpldapadmin (1.0.1) it indicates that an error is reported after beta 1.1.0-alpha3 is installed, therefore, use the earlier version ********************************* ********
: Http://prdownloads.sourceforge.net/phpldapadmin/phpldapadmin-1.0.1.tar.gz? Download
# Tar zxvf phpldapadmin-1.0.1.tar.gz
# Cp-A phpldapadmin-1.0.1/usr/local/phpldapadmin
# CD ../phpldapadmin/config
# Cp config. php. Example config. php
# Vi config. php
Put the comments/* of the second line after the second line, equivalent to making the code below take effect
$ I ++;
$ Ldapservers-> setvalue ($ I, 'server', 'name', 'ldap Server ');
$ Ldapservers-> setvalue ($ I, 'server', 'host', '2017. 0.0.1 ');
$ Ldapservers-> setvalue ($ I, 'server', 'Port', '123 ');
$ Ldapservers-> setvalue ($ I, 'server', 'base', array (''));
$ Ldapservers-> setvalue ($ I, 'server', 'auth _ type', 'cooker ');
$ Ldapservers-> setvalue ($ I, 'login', 'dn ','');
$ Ldapservers-> setvalue ($ I, 'login', 'pass ','');
Change phpldapadmin to Chinese
# Cd/usr/local/phpldapadmin/locale/zh_cn/lc_messages
# Iconv-f gbk-T utf8 messages. Po> messages. New. Po
# Msgfmt-O messages.mo messages. New. Po
# Vi/usr/local/phpldapadmin/htdocs/header. php
$ Language = isset ($ config )? $ Language = $ config-> getvalue ('appearance ', 'language'): 'zh _ cn'; original auto
Restart Apache
#/Usr/local/apache2/bin/apachectl stop
#/Usr/local/apache2/bin/apachectl start