Chinaunix首页 | 论坛 | 博客
  • 博客访问: 246531
  • 博文数量: 79
  • 博客积分: 1942
  • 博客等级: 上尉
  • 技术积分: 910
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-19 16:17
文章分类

全部博文(79)

文章存档

2011年(1)

2010年(50)

2009年(28)

分类:

2009-07-21 18:06:14

#!/bin/bash
_APACHEPATH=/usr/local/apache
_MYSQLPATH=/usr/local
_PHPPATH=/usr/local/php
path=`pwd`
cd $path
sleep 3
echo "##########---------- Mysql install-----------#############"
        echo "Installing Mysql,Please waiting..."
        cp my.cnf /etc/
        tar zxvf mysql-5.1.32-linux-i686-icc-glibc23.tar.gz -C $_MYSQLPATH
        cd $_MYSQLPATH
        mv mysql-5.1.32-linux-i686-icc-glibc23 mysql
        cd mysql
        groupadd mysql
        useradd -g mysql mysql
        chown -R mysql .
        chgrp -R mysql .
        scripts/mysql_install_db --user=mysql
        chown -R root .
        chown -R mysql:mysql data
        #$_MYSQLPATH/mysql/bin/mysqld_safe --user=mysql &
        echo "$_MYSQLPATH/bin/mysqld_safe --user=mysql &" >> /etc/rc.d/rc.local
        echo "Mysql Install Done."
        cd $path
sleep 3
echo "##########---------- Apache install-----------#############"
        echo "Installing Apache,Please waiting..."
        tar jxvf httpd-2.2.9.tar.bz2
        cd httpd-2.2.9
        ./configure --prefix=$_APACHEPATH --enable-so
        make
        make install
        echo "$_APACHEPATH/bin/apachectl start" >> /etc/rc.d/rc.local
        echo "Apache Install Done."
        cd $path
        if [ -d /usr/local/apache/ ]
        then
        $_APACHEPATH/bin/apxs -c -i -a $path/httpd-2.2.9/modules/mappers/mod_rewrite.c
        echo "###----Rewrite.so Install Done.----###"
        else
        exit
        fi
sleep 3
echo "##########---------- PHP_extension install-----------#############"
        echo "Installing libxml,Please waiting..."
        tar zxvf libxml2-2.6.30.tar.gz
        cd libxml2-2.6.30
        ./configure --prefix=/usr/local/libxml
        make
        make install
        echo "libxml Install Done."
        cd $path
        echo "Installing libiconv,Please waiting..."
        tar zxvf libiconv-1.12.tar.gz
        cd libiconv-1.12
        ./configure --prefix=/usr/local/libiconv
        make
        make install
        echo "libiconv Install Done."
        cd $path
        echo "Installing zlib,Please waiting..."
        tar zxvf zlib-1.2.3.tar.gz
        cd zlib-1.2.3
        ./configure --prefix=/usr/local/zlib
        make
        make install
        echo "zlib Install Done."
        cd $path
        echo "Installing Freetype,Please waiting..."
        tar zxvf freetype-2.2.1.tar.gz
        cd freetype-2.2.1
        ./configure --disable-shared
        make
        make install
        echo "Freetype Install Done."
        cd $path
        echo "Install Jpeg,Please waiting..."
        tar zxvf jpegsrc.v6b.tar.gz
        cd jpeg-6b
        ./configure --enable-shared --enable-static
        make
        mkdir -p /usr/local/man/man1
        make install
        make install-lib
        echo "Jpeg Install Done."
        cd $path
        echo "Install libpng,Please waiting..."
        tar zxvf libpng-1.2.10.tar.gz
        cd libpng-1.2.10
        ./configure --disable-shared
        make
        make install
        echo "libpng Install Done."
        cd $path
        echo "Install Gd,Please waiting..."
        tar zxvf gd-2.0.35.tar.gz
        cd gd-2.0.35
        ./configure --with-freetype --with-jpeg --with-png
        make
        make install
        echo "Gd Install Done."
        echo "PHP_extension Install Done."
        cd $path
sleep 3
echo "##########---------- PHP_extension install-----------#############"
        echo "Installing PHP,Please waiting..."
        tar jxvf php-5.2.6.tar.bz2
        cd php-5.2.6
        \cp $_APACHEPATH/build/libtool .
        ./configure --prefix=$_PHPPATH --with-apxs2=/usr/local/apache/bin/apxs \
                    --with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/libxml \
                    --with-iconv=/usr/local/libiconv --with-config-file-path=/usr/local/php/etc \
                    --with-gd --with-freetype-dir --with-jpeg-dir --with-png-dir \
                    --with-zlib=/usr/local/zlib --enable-mbstring  --enable-sockets
        make
        make install
        cd ../
        cp php.ini $_PHPPATH/etc/
        \cp httpd.conf $_APACHEPATH/conf/
        $_APACHEPATH/bin/apachectl start
        echo "PHP Install Done."
        $_MYSQLPATH/mysql/bin/mysqld_safe --user=mysql &
echo "###########----------------Finish-----------------############"
阅读(986) | 评论(0) | 转发(0) |
0

上一篇:Mysql5主从同步配置

下一篇:SVN安装和配置

给主人留下些什么吧!~~