LAMP----linux+apache+mysql+php One of the detailed installation steps Apache (OPENLDAP, etc.)

Source: Internet
Author: User
Tags bz2 gmp ldap svn openldap

LAMP----linux+apache+mysql+php One of the detailed installation steps APACHE article (OpenLDAP , etc. )

Linux verbose version is RHEL5.3

[Email protected] mail]# uname-a

Linux localhost.localdomain 2.6.18-128.el5 #1 SMP Wed Dec 11:42:39 EST. i686 i686 i386 Gnu/linux

1. Upload Apache source code files


Actually installing an Apache purely is simple

[Email protected] apache]# tar xvf httpd-2.2.13

[Email protected] apache]# CD httpd-2.2.13

[Email protected] httpd-2.2.13]#/configure--prefix=/usr/local/apache

[[email protected] httpd-2.2.13]# make

[[email protected] httpd-2.2.13]# make install

With the above command, you can install the directory as/usr/local/apache

Generally also add some commonly used modules, such as APR,APR-UTIL,OPEN-LDAP, etc.

Apache usually comes with Apr and Apr-util, in the Srclib directory

Enter the/ROOT/APACHE/HTTPD-2.2.13/SRCLIB/APR directory

[Email protected] apr]#/configure--prefix=/usr/local/apr--enable-threads--enable-other-child

[[email protected] apr]# make

[[email protected] apr]# make install

And then into/root/apache/httpd-2.2.13/srclib/apr-util.

[Email protected] apr-util]#/configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr--with-mysql=/usr/ Local/mysql \

>--with-ldap-lib=/usr/openldap/lib--with-ldap-include=/usr/openldap/include \


Do the above operation will definitely error, because LDAP is not installed, berkeleydb.4.4 also not installed, so you must first install the two software

Upload openldap-stable-20100219.tgz and db-4.4.20.tar.gz, the latter being the legendary berkeleydb, or download his source package from Oracle's website

[Email protected] apache]# tar zxvf db-4.4.20.tar.gz

[Email protected] apache]# CD db-4.4.20/build_unix/

[Email protected] build_unix]#. /dist/configure--prefix=/usr/local/berkeleydb.4.4

It's a little bit important to note that BerkeleyDB cannot be configure in the root directory and is usually configured in the way above

[[email protected] build_unix]# make

[[email protected] build_unix]# make install

You need to configure something after the installation is complete.

[Email protected] build_unix]# vim/etc/

Add/usr/local/berkeleydb.4.4/lib to this file

[Email protected] build_unix]#/sbin/ldconfig

[Email protected] build_unix]# Vi/etc/profile

At the end, add



Export Ld_run_path Ld_library_path

[Email protected] build_unix]# Source/etc/profile

Start installing OPENLDAP below

[Email protected] apache]# tar zxvf openldap-stable-20100219.tgz

[Email protected] apache]# CD openldap-2.4.21/

[Email protected] openldap-2.4.21]# env cppflags= "-i/usr/local/berkeleydb.4.4/include" ldflags= "-l/usr/local/ Berkeleydb.4.4/lib "./configure--prefix=/usr/local/openldap--enable-bdb

Error Configure:error:BerkeleyDB version incompatible with BDB/HDB backends

Version error

[Email protected] openldap-2.4.21]# cp/usr/local/berkeleydb.4.4/include/*/usr/include/

[Email protected] openldap-2.4.21]# cp/usr/local/berkeleydb.4.4/lib/*/usr/lib/

Overwrite all and then execute

[Email protected] openldap-2.4.21]# env cppflags= "-i/usr/local/berkeleydb.4.4/include" ldflags= "-l/usr/local/ Berkeleydb.4.4/lib "./configure--prefix=/usr/local/openldap--enable-bdb

OK, then follow the instructions.

[email protected] openldap-2.4.21]# make depend

[[email protected] openldap-2.4.21]# make

[[email protected] openldap-2.4.21]# make install

Go to the Apr-util directory just under Apache.

[Email protected] apr-util]#/configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr--with-mysql=/usr/ Local/mysql \

>--with-ldap-lib=/usr/openldap/lib--with-ldap-include=/usr/openldap/include \


You can then make the install

At this point APR,APR-UTIL,BERKELEYDB,OPENLDAP installation is complete, the following formally into Apache installation

[Email protected] httpd-2.2.13]#/configure--prefix=/usr/local/apache--with-apr=/usr/local/apr--with-apr-util=/ Usr/local/apr-util--enable-mods-shared= ' LDAP authnz-ldap actions alias Asis auth-basic Auth-digest Authn-anon AUTHN-DBD authn-dbm authn-default authn-file authz-dbm authz-default authz-groupfile authz-host authz-owner authz-svn Authz-user autoindex cern-meta CGI dav-fs dav-lock DAV dav-svn dbd deflate dir dumpio env expires ext-filter Filter Header S ident imagemap include info log-config log-forensic Logio mime-magic MIME negotiation proxy-ajp proxy-balancer Proxy-con Nect proxy-ftp proxy-http proxy-scgi proxy reqtimeout rewrite setenvif speling SSL status substitute Unique-id Userdir use Rtrack version Vhost-alias '

I have used the dynamic module of the way to compile, each module can be httpd.conf configuration to choose whether to load the module, such as the LDAP module

Load this module in httpd.conf by LoadModule Ldap_module modules/

As soon as this line is commented out, Apache will no longer load the LDAP module

--enable-mods-shared= ' is compiled for dynamic compilation, see

Install Apache on/usr/local/apache after configuration is done.

Installation Complete

LAMP----linux+apache+mysql+php Detailed installation Step II MySQL Chapter

[Email protected] mysql-5.1.36]#/configure--prefix=/usr/local/mysql--localstatedir=/usr/local/mysql/data/-- Without-innodb--without-debug--without-isam--with-charset=utf8--with-collation=utf8_general_ci-- With-extra-charsets=all--enable-assembler--with-pthread--enable-thread-safe-client--with-client-ldflags=- All-static-with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock

[[email protected] mysql-5.1.36]# make

[[email protected] mysql-5.1.36]# make install

MySQL installation is relatively simple, from the Internet to find some documents, and then summed up a few of the Linux help parameters, configuration installation can be

Mysql Configuration

[email protected] mysql-5.1.36]# CP./support-files/mysql.server/etc/init.d/mysql

[[email protected] mysql-5.1.36]# Groupadd MySQL

[[email protected] mysql-5.1.36]# useradd–g MySQL MySQL

[Email protected] mysql-5.1.36]# chmod 777/etc/init.d/mysql

[Email protected] mysql-5.1.36]#/usr/local/mysql/bin/mysql_install_db

[Email protected] mysql-5.1.36]# chown-r mysql:mysql/usr/local/mysql/data/

Start Mysql

[[Email protected] mysql-5.1.36]# service MySQL start

[[email protected] mysql-5.1.36]#/usr/local/mysql/bin/mysqladmin–u root–p password ' ROOTPW '//Set password for ROOTPW

[[email protected] mysql-5.1.36] Enter Password://The default password is empty, so enter directly

[Email protected] mysql-5.1.36]#/usr/local/mysql/bin/mysql–u root–p

Enter password://After entering the new password, login is successful

MySQL installation configuration is complete.

LAMP----linux+apache+mysql+php Detailed installation steps of the third PHP chapter

zlib-1.2.3.tar.bz2 libmcrypt-2.5.7.tar.gz mhash- libiconv-1.13.1.tar.gz gd-2.0.33.tar.gz jpegsrc.v7.tar.gz libpng-1.2.10.tar.bz2 libxpm-3.5.5.tar.bz2 libxml2-2.7.4.tar.gz

The above is my individual installed package, you can also use Redhat, if it comes with, generally in the configuration of PHP with the/usr/include/directory can be found

While the packages are individually packed, you can use the./configure--prefix=/dir to customize the path, which is used when you configure PHP

[Email protected] php-5.2.13]#/configure--cache-file=./config.cache--prefix=/usr/local/php--sysconfdir=/usr/ LOCAL/PHP/ETC \

>--infodir=/usr/local/php/info--mandir=/usr/local/php/man--with-apxs2=/usr/local/apache/bin/apxs \

>--disable-debug--with-config-file-path=/usr/local/php/lib--with-config-file-scan-dir=/usr/local/php/etc \

>--enable-libxml--with-libxml-dir=/usr/local/libxml--with-zlib=/usr/local/zlib--enable-bcmath \

>--with-bz2=/usr/bin/bzip2--enable-calendar--enable-ctype--with-curl=/usr/include/curl--with-curlwrappers \

>--enable-zip--enable-ftp--with-gettext--enable-mbstring--with-mcrypt=/usr/local/libmcrypt--with-mhash=/usr /local/mhash \

>--with-iconv=/usr/local/libiconv--with-xmlrpc--with-xsl=/usr/include/libxslt--with-gd=/usr/local/gd2 \

>--with-jpeg-dir=/usr/local/jpeg7--with-png-dir=/usr/local/libpng--with-xpm-dir=/usr/local/libxpm--with-ttf \

>--with-freetype-dir=/usr/include/freetype2/freetype--without-t1lib--enable-gd-native-ttf-- Enable-gd-jis-conv \

>--with-mysqli=/usr/local/mysql/bin/mysql_config--with-mysql=/usr/local/mysql--with-mysql-sock=/tmp/ Mysql.sock \

>--with-ldap=/usr/local/openldap--with-gmp=/usr/local/gmp--enable-sigchild--enable-pdo--with-pdo-mysql=/usr /local/mysql

Make makes Isntall ready to install and do test to do

Find out if PHP is loaded in/usr/local/apache/conf/httpd.conf.

LoadModule Php5_module modules/

AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source. Phps

If it is not possible to manually add, test PHP installation can be completed in/usr/local/apache/htdocs a new index.php, the content is as follows


Phpinfo ()


Save after running/usr/local/apache/bin/apachectl-k start Apache, access the Address page in the browser to see the local installation of PHP information

If it does not appear, it proves that PHP is not installed successfully.

LAMP----linux+apache+mysql+php One of the detailed installation steps Apache (OPENLDAP, etc.)

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.