安装apache

wget  http://archive.apache.org/dist/httpd/httpd-2.2.27.tar.bz2

cd httpd-2.2.27

编译参数:

./configure \
--prefix=/usr/local/apache2 \
--with-included-apr \
--enable-so \
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--with-pcre

/usr/local/apache2/bin/apachectl -M -l -t graceful


configure 错误提示:

  checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

  zlib-devel 没装的原因

  yum install gcc zlib-devel openssl-devel(装这个package会有一堆关联包装上)

  mysql需要安装

  gcc-c++

  libstdc++-devel

  ncurses-devel

  php

  需要如下安装包

  libxml2-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel mhash-devel

  configure with-imap如果出现如下错误:

  rfc822.h not found .需要 libc-client-devel

  make

  出现错误 : /usr/bin/ld: cannot find -lltdl

  安装了libtool-ltdl

  需要做个软链接ln -s /usr/lib/libltdl.so.3 /usr/lib/libltdl.so

安装php

wget http://cn2.php.net/distributions/php-5.3.28.tar.gz

cd php-5.3.28 

./configure   --prefix=/usr/local/php   --with-apxs2=/usr/local/apache2/bin/apxs   --with-config-file-path=/usr/local/php/etc   --with-mysql=/usr/local/mysql   --with-libxml-dir   --with-gd   --with-jpeg-dir   --with-png-dir   --with-freetype-dir   --with-iconv-dir   --with-zlib-dir   --with-bz2   --with-openssl   --with-mcrypt   --enable-soap   --enable-gd-native-ttf   --enable-mbstring   --enable-sockets   --enable-exif   --disable-ipv6 


wget  http://cn2.php.net/distributions/php-5.4.37.tar.bz2

useradd -s /sbin/nologin php-fpm 
cd php-5.4.37
./configure --prefix=/usr/local/php   --with-config-file-path=/usr/local/php/etc  --enable-fpm   --with-fpm-user=php-fpm  --with-fpm-group=php-fpm   --with-mysql=/usr/local/mysql  --with-mysql-sock=/tmp/mysql.sock  --with-libxml-dir  --with-gd   --with-jpeg-dir   --with-png-dir   --with-freetype-dir  --with-iconv-dir   --with-zlib-dir   --with-mcrypt   --enable-soap   --enable-gd-native-ttf   --enable-ftp  --enable-mbstring  --enable-exif    --disable-ipv6     --with-curl