CentOS 6.7 Lamp

Source: Internet
Author: User

#!/bin/bash
Yum-y Install gcc-c++ library ncurses-devel libxml2-devel libtomcrypt-devel libtool libtool-ltdl-devel bzip2-devel
CD/TMP&&TAR-ZXF HTTPD-2.2.11.TAR.GZ&&CD httpd-2.2.11&&./configure--prefix=/usr/local/ APACHE-WITH-INCLUDED-APR--with-pcre--enable-mods-shared=moost
Make &&make Install
If [$?-eq 0];then
echo "/usr/local/apache/bin/apachectl restart" >>/etc/rc.d/rc.local
/usr/local/apache/bin/apachectl restart
Else
echo "Apache compile instal error"
Exit 1
Fi
Useradd-m-s/sbin/nologin MySQL
CD/TMP/&&TAR-ZXF mysql-5.1.55.tar.gz&&cd mysql-5.1.55&&./configure--prefix=/usr/local/ MySQL--with-charset-utf8--with-extra-charsets=gbk,gb2312
Make &&make Install
If [$?-eq 0];then
Yes|cp-r support-files/my-medium.cnf/etc/my.cnf
Yes|cp-f Support-files/mysql.server/etc/init.d/mysqld
Chkconfig--add mysqld
chmod 755/etc/init.d/mysqld
Ln-s/usr/local/mysql/bin/*/bin
Else
echo "MySQL Compile install error"
Exit 1
Fi
if [-e/usr/local/mysql/bin/mysql_install_db];then
/usr/local/mysql/bin/mysql_install_db--user=mysql
Else
echo "Chu Shi Hua shi bai"
Exit
Fi
Chown-r root:mysql/usr/local/mysql/
Chown-r mysql/usr/local/mysql/var/
echo "/etc/init.d/mysqld restart" >>/etc/rc.d/rc.local
/etc/init.d/mysqld restart
echo "Install PHP please waiting"
CD/TMP/&&TAR-ZXF PHP-5.3.6.TAR.GZ&&CD php-5.3.6&&./configure--prefix=/usr/local/php-- With-apxs2=/usr/local/apache/bin/apxs--with-mysql=/usr/local/mysql/--with-libxml-dir--with-png-dir-- With-freetype-dir--with-iconv-dir--with-zlib-dir--with-bz2--enable-soap--enable-mbstring--enable-sockets-- Enable-exif--disable-ipv6
Make&&make Install
If [$?-eq 0];then
echo "PHP compile OK"
Yes|cp-f/tmp/httpd.conf/usr/local/apache/conf/
/usr/local/apache/bin/apachectl restart
Else
echo "PHP compile Error"
Exit 1
Fi
#yes |cp-f/tmp/httpd.conf/usr/local/apache/conf/
#/usr/local/apache/bin/apachectl restart
# #AddType application/x-httpd-php. php. phtml add support for ". PHP" type Web page
# #DirectoryIndex index.php index.html identify common PHP home files
#<?php
#phpinfo ();
#?>
#curl 192.168.9.122/index.php
#iptables-X-F

CentOS 6.7 Lamp

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.