分类: LINUX
2009-04-20 14:00:07
一、首先apache安装
安装apache-
#Cd /backup/soft
#tar –zvxf httpd-
#cd httpd-
#./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --disable-userdir
# make
# make install
设置开机启动
# echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local
二、安装GD库(让php支持GIF,PNG,JPEG)
a、安装jpeg6
#mkdir –p /usr/local/jpeg6
# mkdir –p /usr/local/jpeg6/bin
# mkdir –p /usr/local/jpeg6/lib
# mkdir –p /usr/local/jpeg6/include
# mkdir –p /usr/local/jpeg6/man
# mkdir –p /usr/local/jpeg6/man1
# mkdir –p /usr/local/jpeg6/man/man1
#cd /backup/soft
#tar –zvxf jpegsrc.v6b.tar.gz
#cd jpeg-6b
#./configure –prefix=/usr/local/jpeg6 –enable-shared –enable-static
如果是centOS5版本,需要copy两个安装文件
Cp /usr/share/libtool/config.guess .
Cp /usr/share/libool/config.sub .
然后如下操作
#vi Makefile
找到CFLAGS= -g –O2 后面加上 –fPIC 然后安装
#make && make install
注意:如果是centos5(64位)会出现如下问题:checking host system type… Invalid configuration `x86_64-unknown-linux-gnu ‘: machine `x86_64-unknown ‘ not recognized
checking build system type… Invalid configuration `x86_64-unknown-linux-gnu ‘: machine `x86_64-unknown ‘ not recognized
configure: error: libtool configure failed
解决方法如下:上面的错误是说libtool的版本太低或者没有安装上
可以先检查一下rpm –qa | grep libtool 如果没有就直接yum安装。
b、安装zlib
#cd /backup/soft
#tar –zvxf zlib-
#cd zlib-
#./configure
#vi Makefile
找到CFLAGS=-03 –DUSE_MMAP 在后面加上 –fPIC
#make && make install
c、安装libpng
#cd /backup/soft
#tar –zvxf libpng-
#cd libpng-
#cp scripts/makefile.gcmmx makefile
#./configure –prefix=/usr/local/libpng2
#vi Makefile
找到CFLAGS= -g –O2后面加上 –fPIC
#make && make install
d、安装freetype
#cd /backup/soft
#tar –zvxf freetype-
#cd freetype-
#./configure –prefix=/usr/local/freetype
#make && make install
e、安装gd
#cd /backup/soft
#tar –zvxf gd-
#cd gd-
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6 --with-p
ng=/usr/local/libpng2 --with-zlib-dir --with-freetype=/usr/local/freetype
#vi Makefile
找到CFLAGS= -O2 –l$(srcdir) 后面加上 –fPIC
注意:这里要注意的是,在gd-
f、安装curl库
#cd /backup/soft
#tar –zvxf curl-
#./configure –prefix=/usr/local/curl
#make && make install
三、安装 mysql
注:如果服务端是32位的,客户端是64位的,这样如果都是二进制版本的是可以连通的。
#cd /backup/soft
#tar –zvxf mysql-5.0.77-linux-x86_64-glibc23.tar.gz
#mv mysql-5.0.77-linux-x86_64-glibc23.tar.gz /usr/local/mysql
#cd /usr/local/mysql
#chown –R root /usr/local/mysql
#chgrp –R mysql /usr/local/mysql
#chown –R mysql /usr/local/mysql/data
# cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
# /usr/local/mysql/scripts/mysql_install_db –user=mysql
# /usr/local/mysql/bin/mysqld_safe –user=mysql &
#ps –ef |grep mysql 看看mysql是否启动
四、安装php
a、安装libxml2
#cd /backup/soft
#tar –zvxf libxml2-
#cd libxml2-
#./configure –prefix=/usr/local/libxml2
#make && make install
#echo ‘/usr/local/libml2/lib’ >>/etc/ld.so.conf
#ldconfig –v 至此安装正常
b、安装libxslt
#cd /backup/soft
#tar –zvxf libxslt-
#cd libxslt-
#mkdir /usr/local/libxslt 这里一定要创建,不然不能自动安装这个路径
#./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
#make && make install
c、安装php
#cd /backup/soft
#tar –zvxf php-
#cd php-
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/libxml2 --with-gd=/usr/local/gd2 --with-xsl=/usr/local/libxslt --with-jpeg-dir=/usr/local/jpeg6 --with-zlib-dir=/usr/local/lib --with-png-dir --with-freetype-dir=/usr/local/freetype --with-curl=/usr/local/curl --enable-soap --enable-gd-native-ttf --enable-ftp #make && make install
#cp php.ini-dist /usr/local/php/etc/php.ini
五、配置apache2让他支持php。
配置 httpd.conf 让apache支持PHP
# vi /export1/server/apache/conf/httpd.conf
找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
重启apache
# /export1/server/apache/bin/apachectl restart