1.准备环境:CentOS5(或Rhel5亦可,试验过),以及相应的软件包:
我已经预先安装好这些软件包,否则编译或者配置的过程中会报错
1.gcc gcc-c++
2.libtool
3.ncurses
必须下载的好的软件包(我用的是tar.gz):
1.libxml
2.libmcrypt
3.zlib
4.libpng
5.jpegsrc
6.freetype
7.autoconf
8.gd2
9.apache2
10.mysql5
11.php5
12.ZendOptimizer
13.phpAdmin
2.开始安装软件包
1.安装libxml2
libxml2/configure --prefix=/usr/local/libxml2
libxml2/make
libxml2/make install
2.安装libmcrypy-2.5.8
libmcrypt/configure --prefix=/usr/local/libmcrypt
libmcrypt/make
libmcrypt/make install
3.安装libltdl
libmcrypt/libltdl/configure --enable-ltdl-install
libmcrypt/libltdl/make
libmcrypt/libltdl/make install
4.安装zlib
zlib/configure
zlib/make
zlib/make install
5.安装libpng
libpng/configure --prefix=/usr/local/libpng
libpng/make
libpng/make install
6.安装jpeg
mkdir -p /usr/local/jpeg6/bin
mkdir -p /usr/local/jpeg6/man/man1
mkdir -p /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/lib
jpeg/configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
jpeg/make
jpeg/make install
7.安装freetype
freetype2/configure --prefix=/usr/local/freetype
freetype2/make
freetype2/make install
8.安装autoconf
autoconf/configure
autoconf/make
autoconf/make install
9.安装gd2
gd2/configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6 --with-freetype=/usr/local/freetype
gd2/make
gd2/make install
10.安装apache
httpd229/configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support
httpd229/make
httpd229/make install
11.安装mysql
groupadd mysql
useradd mysql -g mysql -s nologin -M
mysql5/configure --prefix=/usr/local/mysql --with-extra-charsets=all
make
make install
配置MySQL
cp support-files/my-medium.cnf /etc/my.cnf
bin/mysql_install_db --user=mysql //运行过后多了个var目录
chown -R root . //将文件的所有属性改为root用户
chown -R mysql var //将数组目录的所有属性改为mysql用户
chgrp -R mysql . //将组属改为mysql组
bin/mysqld_safe --user=mysql &
netstat -tnl|grep 3306 //查看3306端口是否开启
bin/mysqladmin version //查看mysql版本
bin/mysqladmin variables //查看所有mysql参数
bin/mysql -u root
mysql>DELETE FROM mysql.user WHERE host<>'localhost';
mysql>FLUSH PRIVILEGES;
mysql>SET PASSWORD FOR 'root'@'localhost'=password('wudi32');
bin/mysql -u root -h localhost -p //回车进入MySQL客户端
bin/mysqladmin -u root -p shutdown /关闭MySQL数据库
配置自动启动脚本:
cp support-files/mysql.server /etc/rc.d/init.d/mysqld //拷贝启动脚本
chmod 755 /etc/rc.d/init.d/mysqld //修改mysqld文件的权限
chkconfig --add mysqld //添加mysql服务
chkconfig --level 345 mysqld //设置mysql启动级别
service mysqld start //启动mysql进程
12.安装php5
php5/configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-libxml-dir=/usr/local/libxml2 \
--with-png-dir=/usr/local/libpng \
--with-jepg-dir=/usr/local/jpeg6 \
--with-freetype-dir=/usr/local/freetype \
--with-gd=/usr/local/gd2 \
--with-zlib-dir=/usr/local/zlib \
--with-mcrypt=/usr/local/libmcrypt \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--enable-soap \
--enable-mbstring=all \
--enable-sockets
cp php.ini-dist /usr/local/php/etc/php.ini //创建配置文件
vi /etc/httpd/httpd.conf //编辑配置文件
Addtype application/x-httpd-php .php
13.安装zendOptimizer
./install.sh
14.安装phpAdmin
cp phpAdmin /usr/local/apache2/htdocs/phpAdmin
cd /usr/local/apache2/htdocs/phpAdmin
cp config.sample.inc.php config.inc.php
vim config.inc.php
修改 auth_type=http
15.这时可以打开浏览器http://200.168.1.2/phpAdmin/index.php