Automatically install MYSQL + APACHE + PHP + ZEND + GD under CentOS5.0

Source: Internet
Author: User
Tags install openssl automake
Automatically install MYSQL + APACHE + PHP + ZEND + GD under CentOS5.0-Linux Enterprise Application-Linux server application information. For more information, see the following. Suitable for LINUX with centos yum Function

The experimental system is: Minimize installation of CENTOS5, that is, the first CD installation does not require 2nd

You must use the ROOT user for installation.

I hope to help you. I am a beginner in LINUX. Welcome to release the document twice.

Run the yum program to install the required software package (the following is the standard RPM package name)

# Yum install ntp vim-enhanced gcc-c ++ flex bison autoconf automake bzip2-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel kernel netconfig

Script
# Wget http://www.zzlan.cn/httpd/lmapz.sh

Change yourpassword in the script to your MYSQL_ROOT User Password
# Chmod 700 lmapz. sh
#./Lmapz. sh

The script is as follows:
CODE :#! /Bin/bash
# BY ESUN
# QQ: 667302
# MAIL: esunnet@qq.com
# BLOG: http://hi.baidu.com/667302/
# Please manual operation yum of before Operation .....

# Yum install ntp vim-enhanced gcc-c ++ flex bison autoconf \
# Automake bzip2-devel ncurses-devel libjpeg-devel libpng-devel \
# Libtiff-devel freetype-devel pam-devel kernel netconfig

######################################## #
Ntpdate 210.72.145.44
Mkdir/home/temp/
Cd/home/temp/

Wget http://www.openssl.org/source/openssl-0.9.8g.tar.gz
Wget http://mirror.mcs.anl.gov/openssh/portable/openssh-4.7p1.tar.gz

Wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz
Wget http://cn2.php.net/distributions/php-5.2.4.tar.gz
Wget http://download.discuz.net/env/mysql-5.0.27.tar.gz
Wget http://downloads.phpchina.com/zend/optimizer/3.3.0/ZendOptimizer-3.3.0-linux-glibc21-i386.tar.gz

Wget http://www.libgd.org/releases/oldreleases/gd-2.0.34.tar.gz
Wget ftp://xmlsoft.org/libxml2/libxml2-2.6.29.tar.gz
Wget http://jaist.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.bz2
Wget http://cronolog.org/download/cronolog-1.6.2.tar.gz

######################################## #
# TAR
Tar-xzvf httpd-2.2.6.tar.gz
Tar-xzvf mysql-5.0.27.tar.gz
Tar-xzvf php-5.2.4.tar.gz
Tar-xzvf ZendOptimizer-3.3.0-linux-glibc21-i386.tar.gz

Tar-xzvf gd-2.0.34.tar.gz
Tar-xzvf libxml2-2.6.29.tar.gz
Tar-xjvf libmcrypt-2.5.8.tar.bz2
Tar-xzvf cronolog-1.6.2.tar.gz

Tar-xzvf openssl-0.9.8g.tar.gz
Tar-xzvf openssh-4.7p1.tar.gz


######################################## #
# INSTALL GD
Cd gd-2.0.34
./Configure \
"-- Prefix =/usr/local/gd2"
Make
Make install

######################################## #
# INSTALL LibXML2
Cd./libxml2-2.6.29
./Configure \
"-- Prefix =/usr/local/libxml2"
Make
Make install
######################################## #
# INSTALL LibMcrypt
Cd./libmcrypt-2.5.8
./Configure \
"-- Prefix =/usr/local/libmcrypt"
Make
Make install

######################################## #
# INSTALL cronolog
Cd./cronolog-1.6.2
./Configure \
"-- Prefix =/usr/local/cronolog"
Make
Make install

######################################## #
# INSTALL OpenSSL
Cd./openssl-0.9.8g
./Configure \
"-- Prefix =/usr/local/openssl"
Make
Make test
Make install

######################################## #
# INSTALL OpenSSH
Cd./openssh-4.7p1
./Configure \
"-- Prefix =/usr "\
"-- With-pam "\
"-- With-zlib "\
"-- Sysconfdir =/etc/ssh "\
"-- With-ssl-dir =/usr/local/openssl "\
-- With-md5-passwords"
Make
Make install

######################################## #
# INSTALL MYSQL
Cd./mysql-5.0.27

./Configure \
"-- Prefix =/usr/local/mysql "\
"-- Localstatedir =/var/lib/mysql "\
"-- With-comment = Source "\
"-- With-server-suffix =-ESUN_SERVER "\
"-- With-mysqld-user = mysql "\
"-- Without-debug "\
"-- With-big-tables "\
"-- With-charset = gbk "\
"-- With-collation = gbk_chinese_ci "\
"-- With-extra-charsets = all "\
"-- With-pthread "\
"-- Enable-static "\
"-- Enable-thread-safe-client "\
"-- With-client-ldflags =-all-static "\
"-- With-mysqld-ldflags =-all-static "\
"-- Enable-Cycler "\
"-- Without-isam "\
"-- Without-innodb "\
"-- Without-ndb-debug"
Make
Make install

# MYSQL ZERO
/Usr/local/mysql/bin/mysql_install_db

# ADD MYSQL URL
Useradd-M-o-r-d/var/lib/mysql-s/bin/bash-c "MySQL Server"-u 27 mysql

# Copy mysql cnf
Cp/usr/local/mysql/share/mysql/my-large.cnf/etc/my. cnf

# CHOWN MYSQL
Chown-R mysql: mysql/var/lib/mysql

# Add mysql init. d service
Cp/usr/local/mysql/share/mysql. server/etc/rc. d/init. d/mysqld
Chkconfig -- add mysqld
Chkconfig -- level 3 mysqld on
Service mysqld start

# Change mysql root password
/Usr/local/mysql/bin/mysqladmin-uroot password 'yourpassword'

######################################## #
# INSTALL apache
Cd./httpd-2.2.6

./Configure \
"-- Prefix =/usr/local/apache2 "\
"-- With-defined ded-apr "\
"-- Enable-so "\
"-- Enable-deflate = shared "\
"-- Enable-expires = shared "\
"-- Enable-rewrite = shared "\
"-- Enable-static-support "\
"-- Disable-userdir"

Make
Make install

# Jianli ruanliejie
Ln-s/usr/local/apache2/bin/apachectl/usr/sbin/apachectl
Ln-s/usr/local/apache2/bin/httpd/usr/sbin/httpd
Ln-s/usr/local/apache2/conf/httpd. conf/etc/httpd. conf

Cp/home/temp/httpd-2.2.6/build/rpm/httpd. init/etc/init. d/httpd
Chkconfig -- add httpd
Chkconfig -- level 3 httpd on
Service httpd start

# Edit httpd. conf
Sed-I's/# ServerName www.example.com: 80/ServerName 127.0.0.1/G'/etc/httpd. conf

# Add index. php to default.
Sed-I's/DirectoryIndex index.html/DirectoryIndex. php index.html index.htm/G'/etc/httpd. conf
Echo "AddType application/x-httpd-php. php">/etc/httpd. conf

######################################## #
# INSTALL PHP
Cd./php-5.2.4

./Configure \
"-- Prefix =/usr/local/php "\
"-- With-apxs2 =/usr/local/apache2/bin/apxs "\
"-- With-config-file-path =/usr/local/php/etc "\
"-- With-mysql =/usr/local/mysql "\
"-- With-libxml-dir =/usr/local/libxml2 "\
"-- With-gd =/usr/local/gd2 "\
"-- With-jpeg-dir "\
"-- With-png-dir "\
-- With-bz2 "\
"-- With-freetype-dir "\
"-- With-iconv-dir "\
"-- With-zlib-dir "\
"-- With-openssl =/usr/local/openssl "\
"-- With-mcrypt =/usr/local/libmcrypt "\
"-- Enable-soap "\
"-- Enable-gd-native-ttf "\
"-- Enable-memory-limit "\
"-- Enable-ftp "\
"-- Enable-mbstring "\
"-- Enable-exif "\
-- Disable-ipv6 "\
"-- Disable-cgi "\
"-- Disable-cli"

Make
Make install
Cp php. ini-dist/usr/local/php/etc/php. ini
Ln-s/usr/local/php/etc/php. ini/etc/php. ini

######################################## #
# INSTALL ZendOptimizer
Cd./ZendOptimizer-3.3.0-linux-glibc21-i386
./Install

Echo "LINUX + MYSQL + APACHE2 + PHP5 + zend install OK"

# Rm-rf/home/temp/
Related Article

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.