不要直接执行,先看一下,改下环境变量!
#!/bin/sh
echo "go... "
INST_PATH=`pwd`
HOSTNAME=`hostname`
installPath_Mysql="/data/mysql"
installPath_Apache="/data/apache"
installPath_Resin="/data/resin"
echo "instpath="$INST_PATH
echo "hostname="$HOSTNAME
echo "Starting ... ... "
echo -e "/033[40;33m"
echo "==============================================="
echo "= Mysql will be installed at "$installPath_Mysql
echo "==============================================="
echo -e "/033[40;37m"
tar -vzxf mysql-4.0.20.tar.gz
cd mysql-4.0.20
useradd mysql
./configure --prefix=$installPath_Mysql --with-charset=gb2312
make ; make install
$installPath_Mysql/bin/mysql_install_db
chown mysql:mysql $installPath_Mysql/var -R
echo "Start Mysql Deamon ... ... "
$installPath_Mysql/bin/mysqld_safe --user=mysql &
cd $INST_PATH
echo -e "/033[40;33m"
echo "==============================================="
echo "= Install OpenSSL 0.9.7d ="
echo "==============================================="
echo -e "/033[40;37m"
tar -vzxf openssl-0.9.7d.tar.gz
cd openssl-0.9.7d
./config --prefix=/usr/local/ --openssldir=/usr/local/openssl
make;make install
cd $INST_PATH
echo -e "/033[40;33m"
echo "==============================================="
echo "= Install Apache 2.2.4 ="
echo "==============================================="
echo -e "/033[40;37m"
tar -vzxf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=$installPath_Apache --enable-so --enable-dav --enable-ssl --enable-maintainer-mode
make; make install
cd $INST_PATH
echo -e "/033[40;33m"
echo "==============================================="
echo "= Install PHP 4.3.7 ="
echo "==============================================="
echo -e "/033[40;37m"
tar -vzxf php-4.3.7.tar.gz
cd php-4.3.7
./configure --with-mysql=$installPath_Mysql --with-apxs2=$installPath_Apache/bin/apxs --with-openssl
make ; make install
cp php.ini-dist /usr/local/lib/php.ini
cd $INST_PATH
echo -e "/033[40;33m"
echo "[]===================LAMP is Ready Now!===========================[]"
echo "[ ]"
echo "[ Now, LAMP is ready , but before you enjoy this , you must do ]"
echo "[ something as list as follow : ]"
echo "[ ]"
echo "[ 1. Change Mysql root password ]"
echo "[ ]"
echo "[ 2. Config Apache config file :" $installPath_Apache/conf/httpd.conf " ]"
echo "[ Apache:ServerName , PHP support , index file ... ... ]"
echo "[ Virtual Server support , SSL support ... ... ]"
echo "[ ]"
echo "[ Remember add this line in httpd.conf: ]"
echo "[ AddType application/x-httpd-php .php .phtml ]"
echo "[ ]"
echo "[ For Chinese charset shown is correct , edit as this: ]" ]"
echo "[ AddDefaultCharset off ]"
echo "[ ]"
echo "[ You will edit /etc/rc.d/rc.local , add these line: ]"
echo "[ "$installPath_Apache"/bin/apachectl start ]"
echo "[ "$installPath_Mysql"/bin/mysqld_safe --user=mysql & ]"
echo "[ ]"
echo "[ ]"
echo "[ ]"
echo "[]================================================================[]"
cd $INST_PATH