CentOS 6.5 Lnmp

Source: Internet
Author: User


#!/bin/bash

echo "Install Nginx Waiting"

Useradd-m-s/sbin/nologin Nginx

Yum-y Install gcc-c++ zlib-devel pcre-devel ncurses-devel libxml2-devel openssl-devel bzip2-devel

Cd/tmp &&tar XF nginx-1.9.3.tar.gz &&cd nginx-1.9.3/&&./configure--prefix=/usr/local/nginx- -user=nginx--group=nginx--with-http_stub_status_module

Make && make install

If [$?-eq 0];then

echo "/usr/local/nginx/sbin/nginx" >>/etc/rc.d/rc.local &&/usr/local/nginx/sbin/nginx

Else

echo "Install Nginx Shibai"

Exit

Fi

echo "Install MySQL please waiting"

Useradd-m-s/sbin/nologin MySQL

cd/tmp/&&tar XF mysql-5.1.55.tar.gz &&cd mysql-5.1.55 &&./configure--prefix=/usr/local/ MySQL--with-charset=utf8--with-collation=utf8_general_ci--with-extra-charsets=gbk,gb2312

If [$?-eq 0];then

Make &&make Install

echo "OK"

Else

echo "Install MySQL Shibai"

Exit

Fi

Yes|cp-f support-files/my-medium.cnf/etc/my.cnf

Yes|cp-f Support-files/mysql.server/etc/init.d/mysqld

If [$?-eq 0];then

Chkconfig--add mysqld

chmod 755/etc/init.d/mysqld

Ln-s/usr/local/mysql/bin/*/bin

Else

echo "Tianjia--add Shibai"

Exit

Fi

if [-e/usr/local/mysql/bin/mysql_install_db];then

/usr/local/mysql/bin/mysql_install_db--user=mysql

Else

echo "Chushihua Shibai"

Exit

Fi

Chown-r root:mysql/usr/local/mysql/

Chown-r mysql/usr/local/mysql/var/

/etc/init.d/mysqld start

echo "/etc/init.d/mysqld restart" >>/etc/rc.d/rc.local

echo "Install PHP please waiting"

Cd/tmp &&tar XF php-5.3.6.tar.gz &&cd php-5.3.6/&&./configure--prefix=/usr/local/php-- With-mysql=/usr/local/mysql--with-libxml-dir--with-freetype-dir--with-iconv-dir--with-zlib-dir--with-bz2-- With-openssl--with-config-file-path=/usr/local/php--enable-soap--enable-mbstring--enable-sockets--enable-exif- -disable-ipv6--ENABLE-FPM

If [$?-eq 0];then

Make &&make Install

Else

echo "Install PHP Shibai"

Exit

Fi

if [-e/usr/local/php/php.ini];then

echo "File Cunzai OK"

Else

Yes|cp/tmp/php-5.3.6/php.ini-development/usr/local/php/php.ini

Fi

Yes|cp-f/tmp/php-fpm.conf/usr/local/php/etc/php-fpm.conf

echo "/USR/LOCAL/PHP/SBIN/PHP-FPM" >>/etc/rc.d/rc.local

/usr/local/php/sbin/php-fpm


CentOS 6.5 Lnmp

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.