lamp_ldap本本虚拟机环境部署20110613

#----------------------------------------------------------#
#create by xk
#CentOS release 5.4 x86_64(Final)+apache2.2.13+mysql5.0.56+php-5.3.6
#--------apache---start------------------------------------#
tar zxvf httpd-2.2.13.tar.gz
cd httpd-2.2.13
./configure --prefix=/application/apache2.2.13 \
--enable-deflate \
--enable-headers \
--enable-modules=so \
--enable-so \
--with-mpm=worker \
--enable-rewrite \
--enable-cgi \
--enable-file-cache \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache
make
make install
cd ../
ln -s /application/apache2.2.13 /application/apache
useradd apache -M -s /sbin/nologin

sed -i 's#\#ServerName www.example.com:80#ServerName 127.0.0.1:80#'   /application/apache/conf/httpd.conf      #s后面的#代表搜索串和替换串之间的分界符
sed -i 's#DirectoryIndex index.html#DirectoryIndex index.php index.html #' /application/apache/conf/httpd.conf
sed -i 's#User daemon#User apache #' /application/apache/conf/httpd.conf
sed -i 's#Group daemon#Group apache #' /application/apache/conf/httpd.conf
sed -i '310 a\    AddType application/x-httpd-php .php .php3\n    AddType application/x-httpd-php-source .phps' /application/apache/conf/httpd.conf
#说明:a\和\n后面各四个空格

#apache 配置文件的语法:
/application/apache/bin/apachectl -t

echo -e "<?php \nphpinfo(); \n?>" >/application/apache/htdocs/index.php
echo '/application/apache/bin/apachectl start ' >> /etc/rc.local
/application/apache/bin/apachectl -t
/application/apache/bin/apachectl graceful
#-------------------------apache-end------------------------------------------------#
#-------------------------mysql-5.0.56----------------------------------------------#
groupadd mysql
useradd -s /sbin/nologin -g mysql -M mysql           
tar zxvf mysql-5.0.56.tar.gz 
cd mysql-5.0.56
./configure \
--prefix=/usr/local/mysql \
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \
--localstatedir=/usr/local/mysql/data \
--enable-assembler \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pthread \
--enable-assembler \
--with-extra-charsets=complex \
--with-readline \
--with-ssl \
--with-embedded-server \
--enable-local-infile \
--with-plugins=partition,innobase \
--with-plugin-PLUGIN \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static

make
make install

/bin/cp support-files/my-small.cnf /etc/my.cnf
mkdir -p /usr/local/mysql/data  
/usr/local/mysql/bin/mysql_install_db --user=mysql  
chgrp -R mysql /usr/local/mysql  
cp support-files/mysql.server /usr/local/mysql/bin/
chmod 700 /usr/local/mysql/bin/mysql.server
/usr/local/mysql/bin/mysql.server start  
echo "export PATH=$PATH:/usr/local/mysql/bin/" >>/etc/profile
source /etc/profile  
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld 
chkconfig --add mysqld
service mysqld restart
mysql -uroot -p

#----------------------------------------------------------------------------------#
#------------------------php5.3.6--------------------------------------------------#
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
#----------------------------------------------------------------------------------#
tar -zxvf php-5.3.6.tar.gz
cd php-5.3.6
#----------------------------------------------------#
 ./configure --prefix=/usr/local/php5 --with-apxs2=/application/apache/bin/apxs --with-config-file-path=/usr/bin --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --without-pear --with-imap=/usr/lib64 --with-kerberos --with-imap-ssl
make
make install
#-------------------------------------------------#
cp php.ini-development /usr/local/php/lib/php.ini
/application/apache/bin/apachectl restart
cd ../

#------------------------------------------#
--with-apxs2=/usr/sbin/apxs
路径如果不是默认,需要做更改。
#------------------FAQ:-------------------#
提示 configure: warning: lemon versions supported for regeneration of libsqlite parsers: 1.0 (found: none)   
解决方法  wget http://www.sqlite.org/cvstrac/getfile/sqlite/tool/lemon.c 
gcc -o lemon lemon.c 
mv lemon /usr/local/bin
#-------------------------------------------#
错误:configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is m
解决:
[root@centos64 tools]# rpm -ivh libc-client-2004g-2.2.1.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:libc-client            ########################################### [100%]

[root@centos64 tools]# 
[root@centos64 tools]# rpm -ivh libc-client-devel-2004g-2.2.1.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:libc-client-devel      ########################################### [100%]

#---------------------------------------------#
错误:Cannot find imap library (libc-client.a). Please check your c-client installation.
解决办法:
#安装imap
tar zxf imap.tar.Z
cd imap-2007b
make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4                   
make slx
echo "set disable-plaintext nil" > /etc/c-client.cf
mkdir /usr/local/imap-2007b
mkdir /usr/local/imap-2007b/include/
mkdir /usr/local/imap-2007b/lib/
chmod -R 077 /usr/local/imap-2007b
rm -rf /usr/local/imap-2007b/include/*
rm -rf /usr/local/imap-2007b/lib/*
rm -rf /usr/sbin/imapd
cp imapd/imapd /usr/sbin/
cp c-client/*.h /usr/local/imap-2007b/include/
cp c-client/*.c /usr/local/imap-2007b/lib/
cp c-client/c-client.a /usr/local/imap-2007b/lib/libc-client.a

#------------------------------------------------------------------#
错误:
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value

一般是64 位 电脑才会出现。

解决方法如下:
#如果还是不行 请用如下
yum install libc-client-devel.x86_64
ln -s /usr/lib64/libc-client.a /usr/lib/libc-client.a

你可能感兴趣的:(apache,PHP,mysql,linux,lamp)