#!/bin/sh
#Install LAMP in RHEL4
#Install LAMP in RHEL4
INSTALL_DIR=`pwd`
tar -zxf httpd-2.2.13.tar.gz;
cd httpd-2.2.13;
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite;
make;
make install;
cd $INSTALL_DIR
cd httpd-2.2.13;
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite;
make;
make install;
cd $INSTALL_DIR
tar -zxf mysql-5.1.37-linux-i686-glibc23.tar.gz -C /usr/local
rm -rf /etc/my.cnf
cd /usr/local
ln -s mysql-5.1.37-linux-i686-glibc23 mysql
adduser mysql
cd /usr/local/mysql
./scripts/mysql_install_db
chown -R mysql.mysql /usr/local/mysql-5.1.37-linux-i686-glibc23
./bin/mysqld_safe --user=mysql & > /dev/null
cd $INSTALL_DIR
rm -rf /etc/my.cnf
cd /usr/local
ln -s mysql-5.1.37-linux-i686-glibc23 mysql
adduser mysql
cd /usr/local/mysql
./scripts/mysql_install_db
chown -R mysql.mysql /usr/local/mysql-5.1.37-linux-i686-glibc23
./bin/mysqld_safe --user=mysql & > /dev/null
cd $INSTALL_DIR
tar -zxf php-5.3.0.tar.gz
cd php-5.3.0
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php;make;make install;
cp php.ini-production /usr/local/php/php.ini
cd $INSTALL_DIR
echo "AddType application/x-httpd-php .php" >> /usr/local/apache2/conf/httpd.conf
echo "DirectoryIndex index.php" >> /usr/local/apache2/conf/httpd.conf
killall -9 httpd
/usr/local/apache2/bin/apachectl start
cd php-5.3.0
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php;make;make install;
cp php.ini-production /usr/local/php/php.ini
cd $INSTALL_DIR
echo "AddType application/x-httpd-php .php" >> /usr/local/apache2/conf/httpd.conf
echo "DirectoryIndex index.php" >> /usr/local/apache2/conf/httpd.conf
killall -9 httpd
/usr/local/apache2/bin/apachectl start
首先将LNS-C5-LAMP.zip文件放入你想用的linux系统中
然后执行下列步骤:
1. unzip LNS-C5-LAMP.zip
2. cd LNS-C5-LAMP
3. sh install.sh
等待结束。Apache+Mysql+PHP环境就装好了
要想看如何安装的。vi install里面写的很清楚
然后执行下列步骤:
1. unzip LNS-C5-LAMP.zip
2. cd LNS-C5-LAMP
3. sh install.sh
等待结束。Apache+Mysql+PHP环境就装好了
要想看如何安装的。vi install里面写的很清楚
本文转自 makewong 51CTO博客,原文链接:http://blog.51cto.com/makewong/195695,如需转载请自行联系原作者