三、编译安装A.M.P环境
1.下载软件编译安装
1)下载软件
# cd /usr/local/src
httpd-2.2.8.tar.gz
mysql-5.0.51b.tar.gz
php-5.2.6.tar.bz2
ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
2) 安装MySQL
查看分析你的CPU型号:
http://gentoo-wiki.com/Safe_Cflags 查找您的GCC编译参数.
确定系统CPU类型:
# cat /proc/cpuinfo | grep "model name"
执行后会看到系统中CPU的具体型号,记下CPU型号。
# tar zxvf mysql-5.0.51b.tar.gz
# cd mysql-5.0.51b
# vi mysql.sh
复制内容到剪贴板
代码:
-------------------cut begin-------------------------------------------
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
./configure \
"--prefix=/usr/local/mysql" \
"--localstatedir=/data/mysql/data" \
"--with-comment=Source" \
"--with-server-suffix=-LinuxTone" \
"--with-mysqld-user=mysql" \
"--without-debug" \
"--with-big-tables" \
"--with-charset=gbk" \
"--with-collation=gbk_chinese_ci" \
"--with-extra-charsets=all" \
"--with-pthread" \
"--enable-static" \
"--enable-thread-safe-client" \
"--with-client-ldflags=-all-static" \
"--with-mysqld-ldflags=-all-static" \
"--enable-assembler" \
"--without-isam" \
"--without-innodb" \
"--without-ndb-debug"
make && make install
mkdir -p /data/mysql/data
useradd mysql -d /data/mysql -s /sbin/nologin
/usr/local/mysql/bin/mysql_install_db --user=mysql
cd /usr/local/mysql
chown -R root:mysql .
chown -R mysql /data/mysql/data
cp share/mysql/my-huge.cnf /etc/my.cnf
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
/etc/rc.d/init.d/mysqld start
cd /usr/local/mysql/bin
for i in *; do ln -s /usr/local/mysql/bin/$i /usr/bin/$i; done
-------------------cut end---------------------------------------------