快速安装lamp脚本lamp.sh

不要直接执行,先看一下,改下环境变量!

#!/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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值