红联Linux门户
Linux帮助

RedHat linux AS 4+Apache2.2+MYSQL5.0.17+PHP5.1.1

发布时间:2006-08-09 16:18:14来源:红联作者:coolentboy
                                     作者:LEO
原创,实践出来的。希望加精!!!

安装MYSQL

引用:
# groupadd mysql
# useradd -g mysql -d /usr/local/mysql/data -M mysql
# tar -zxvf mysql-5.0.17.tar.gz
# cd mysql-5.0.17
./configure --prefix=/usr/local/mysql \ 指定安装目录
> --sysconfdir=/etc \ 配置文件的路径
> --localstatedir=/usr/local/mysql/data \ 数据库存放的路径
> --enable-assembler \ 使用一些字符函数的汇编版本
> --with-mysqld-ldflags=-all-static \ 以纯静态方式编译服务端
> --with-charset=utf8 \ 添加utf8字符支持
> --with-extra-charsets=all 添加所有字符支持

# make
# make install
# /usr/local/mysql/bin/mysql_install_db
# chown -R mysql:mysql /usr/local/mysql/data
# cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf


安装Apache

tar -zvxf httpd-2.2.tar.gz
cd httpd-2.2
./configure --prefix=/usr/local/apache --enable-so
make
make install

先安装支持包(注意安装顺序)
先列出配置gd2需要的网址

gd-2.0.33.tar.gz
www.boutell.com/gd

jpegsrc.v6b.tar.gz
ftp.uu.net/graphics/jpeg
www.ijg.org

libpng-1.2.7.tar.tar
www.libpng.org/pub/png/libpng.html
libpng.sourceforge.net
sourceforge.net/projects/libpng

zlib-1.2.2.tar.gz
www.zlib.net
sourceforge.net/projects/zlib

freetype-2.1.9.tar.gz
www.freetype.org
freetype.sourceforge.net/index2.html
sourceforge.net/projects/freetype

建立初始目录:

mkdir /usr/local/modules

jpeg目录

mkdir /usr/local/modules/jpeg6
mkdir /usr/local/modules/jpeg6/bin
mkdir /usr/local/modules/jpeg6/lib
mkdir /usr/local/modules/jpeg6/include
mkdir /usr/local/modules/jpeg6/man
mkdir /usr/local/modules/jpeg6/man/man1


安装libxml

# tar -zxf libxml2-2.6.16.tar.gz
# cd libxml2-2.6.16
# ./configure (xml默认安装就可以,不要指定路径了,因为安装时php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)
# make
# make install

安装zlib

tar xzvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
#不要用--prefix自定义安装目录,影响gd的安装
./configure
make
make install

安装freetype

tar xzvf freetype-2.1.5.tar.gz
cd freetype-2.1.5
./configure --prefix=/usr/local/modules/freetype
make
make install

安装libpng

tar xzvf libpng-1.2.5.tar.gz
#不要用--prefix自定义安装目录,影响gd的安装
cd libpng-1.2.5
cp scripts/makefile.std makefile
make
make install


安装jpeg

tar xzvf jpegsrc.v6b.tar.gz
./configure --prefix=/usr/local/modules/jpeg6 --enable-shared --enable-static
make
make install

安装GD

tar xzvf gd-2.0.33.tar.gz
./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/modules/freetype
make
make install

安装imap:

tar zxvf imap-2001a.tar.Z
cd imap-2001a
make slx
cp ipopd/ipop*.* /usr/sbin
cp imapd/imapd /usr/sbin
cp c-client/c-client.a /usr/local/lib
请确定你有 /usr/local/include 这个目录
cp c-client/rfc822.h /usr/local/include
cp c-client/mail.h /usr/local/include
cp c-client/linkage.h /usr/local/include


mkdir /usr/local/php5
tar -zxvf php-5.1.1.tar.gz
cd php-5.1.1
./configure --prefix=/usr/local/php5 \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-libxml-dir=/usr/local/lib \
--with-gd=/usr/local/modules/gd \
--with-jpeg-dir=/usr/local/modules/jpeg6 \
--with-zlib \
--with-png \
--with-freetype-dir=/usr/local/modules/freetype \
--with-imap=/usr/local/lib \
--with-xmlrpc \
--with-config-file-path=/usr/local/php5/etc
make
make install

cp ./php.ini-dist /usr/local/php5/etc/php.ini

修改httpd.conf
#vi /usr/local/apache/conf/httpd.conf
加载php模块,去掉注释“#”,如没有此行,请加上。
LoadModule php5_module modules/libphp5.so
加上此两行
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

到这里全部的安装过程已完成。
文章评论

共有 1384 条评论