安装MySQL
groupadd mysql
useradd -g mysql mysql
tar -zxvf mysql-5.0.45.tar.gz
cd mysql-5.0.45
./configure --prefix=/server/mysql
make
make install
/server/mysql/bin/mysql_install_db --user=mysql --force
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 700 /etc/rc.d/init.d/m
chkconfig --add mysqld
cd /server/mysql
chown -R mysql var
chgrp -R mysql .
/server/mysql/bin/mysqld_safe --user=mysql &
/server/mysql/bin/mysqladmin -u root password '7766506'
/server/mysql/bin/mysql -u root -p
安装Apache
tar -zvxf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/server/httpd\
--enable-rewrite=shared\
--enable-speling=shared\
--enable-module=shared\
--enable-track-vars\
--with-config-file-path=/server/httpd/conf\
--enable-so\
--enable-mods-shared=most
make
make install
/server/httpd/bin/apachectl start
安装GD库(GIF,PNG,JPEG)
a.安装jpeg
tar -zvxf jpegsrc.v6b.tar.gz
cd jpeg-6b
mkdir /usr/local/lib/bin
mkdir /usr/local/lib/lib
mkdir /usr/local/lib/include
mkdir /usr/local/lib/man
mkdir /usr/local/lib/man/man1
./configure --prefix=/usr/local/lib/ --enable-shared --enable-static
make
make install
b.安装libpng
tar -zvxf libpng-1.2.20.tar.gz
cd libpng-1.2.20
cp scripts/makefile.linux makefile
make test
make install
c.安装freetype
tar -zvxf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure --prefix=/usr/local/lib/
make
make install
d.安装zlib
tar -zxvf zlib-1.2.3.tar.gz
cd zlib.1.2.3
./configure --prefix=/usr/local/lib/
make
make install
e.安装GD库
tar -zvxf gd-2.0.34.tar.gz
mkdir -p /usr/local/lib/gd
cd gd-2.0.34
./configure --prefix=/usr/local/lib/
--with-jpeg=/usr/local/lib/
--with-png=/usr/local/lib/
--with-zlib=/usr/local/lib/
--with-freetype=/usr/local/lib/
make
make install
安装php5
a.安装libxml
tar -zxf libxml2-2.6.11.tar.gz
cd libxml2-2.6.11
./configure --prefix=/usr/local/lib/
make
make install
c.安装php5
tar -zvxf php-5.2.4.tar.gz
cd php-5.2.4
./configure
--prefix=/server/php
--with-apxs2=/server/httpd/bin/apxs
--with-mysql=/server/mysql/
--with-config-file-path=/server/php/lib/php.ini(此格式可省略)
--with-libxml-dir=/usr/local/lib/
--with-gd=/usr/local/lib/
--with-jpeg-dir=/usr/local/lib/
--with-zlib-dir=/usr/local/lib/
--with-png=/usr/local/lib/
--with-freetype-dir=/usr/local/lib/
--enable-mbstring --enable-sockets
make
make install
cp php.ini-dist /usr/local/php/lib/php.ini
vi /server/php/lib/php.ini
vi /server/httpd/conf/httpd.conf