Install the LAMP environment using shell script auto

Source: Internet
Author: User
#! Compile 'pwd' cd $ pathsleep3echo "############---- Mysqlinstall ---- #############" & nbsp; echo "#! /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
Music mysql-5.1.32-linux-i686-icc-glibc23 mysql
Cd mysql
Groupadd mysql
Useradd-g 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 restart src.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 ------############"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.