博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
lamp script
阅读量:6244 次
发布时间:2019-06-22

本文共 22043 字,大约阅读时间需要 73 分钟。

centos6 ,不区分32位,64位, 要求机器可以上外网。 支持lamp 和 lnmp, mysql支持5.1和5.6两个版本,php支持5.3和5.6两个版本,apache2.2,nginx1.8. 

lamp script

#!

#!/bin/bashecho "It will install lamp or lnmp."sleep 1##check last command is OK or not.check_ok() {if [ $? != 0 ]then    echo "Error, Check the error log."    exit 1fi}##get the archive of the system,i686 or x86_64.ar=`arch`##close seliuxsed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/configselinux_s=`getenforce`if [ $selinux_s == "Enforcing"  -o $selinux_s == "enforcing" ]then    setenforce 0fi##close iptablesiptables-save > /etc/sysconfig/iptables_`date +%s`iptables -Fservice iptables save##if the packge installed ,then omit.myum() {if ! rpm -qa|grep -q "^$1"then    yum install -y $1    check_okelse    echo $1 already installed.fi}## install some packges.for p in gcc wget perl perl-devel libaio libaio-devel pcre-devel zlib-develdo    myum $pdone##install epel.if rpm -qa epel-release >/dev/nullthen    rpm -e epel-releasefiif ls /etc/yum.repos.d/epel-6.repo* >/dev/null 2>&1then    rm -f /etc/yum.repos.d/epel-6.repo*fiwget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo##function of installing mysqld.install_mysqld() {echo "Chose the version of mysql."select mysql_v in 5.1 5.6do    case $mysql_v in        5.1)            cd /usr/local/src            [ -f mysql-5.1.72-linux-$ar-glibc23.tar.gz ] || wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.72-linux-$ar-glibc23.tar.gz            tar zxf mysql-5.1.72-linux-$ar-glibc23.tar.gz            check_ok            [ -d /usr/local/mysql ] && /bin/mv /usr/local/mysql /usr/local/mysql_`date +%s`            mv mysql-5.1.72-linux-$ar-glibc23 /usr/local/mysql            check_ok            if ! grep '^mysql:' /etc/passwd            then                useradd -M mysql -s /sbin/nologin                check_ok            fi            myum compat-libstdc++-33            [ -d /data/mysql ] && /bin/mv /data/mysql /data/mysql_`date +%s`            mkdir -p /data/mysql            chown -R mysql:mysql /data/mysql            cd /usr/local/mysql            ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql            check_ok            /bin/cp support-files/my-huge.cnf /etc/my.cnf            check_ok            sed -i '/^\[mysqld\]$/a\datadir = /data/mysql' /etc/my.cnf            /bin/cp support-files/mysql.server /etc/init.d/mysqld            sed -i 's#^datadir=#datadir=/data/mysql#' /etc/init.d/mysqld            chmod 755 /etc/init.d/mysqld            chkconfig --add mysqld            chkconfig mysqld on            service mysqld start            check_ok            break            ;;        5.6)            cd /usr/local/src            [ -f mysql-5.6.26-linux-glibc2.5-$ar.tar.gz ] || wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.26-linux-glibc2.5-$ar.tar.gz            tar zxf mysql-5.6.26-linux-glibc2.5-$ar.tar.gz            check_ok            [ -d /usr/local/mysql ] && /bin/mv /usr/local/mysql /usr/local/mysql_bak            mv mysql-5.6.26-linux-glibc2.5-$ar /usr/local/mysql            if ! grep '^mysql:' /etc/passwd            then                useradd -M mysql -s /sbin/nologin            fi            myum compat-libstdc++-33            [ -d /data/mysql ] && /bin/mv /data/mysql /data/mysql_bak            mkdir -p /data/mysql            chown -R mysql:mysql /data/mysql            cd /usr/local/mysql            ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql            check_ok            /bin/cp support-files/my-default.cnf /etc/my.cnf            check_ok            sed -i '/^\[mysqld\]$/a\datadir = /data/mysql' /etc/my.cnf            /bin/cp support-files/mysql.server /etc/init.d/mysqld            sed -i 's#^datadir=#datadir=/data/mysql#' /etc/init.d/mysqld            chmod 755 /etc/init.d/mysqld            chkconfig --add mysqld            chkconfig mysqld on            service mysqld start            check_ok            break            ;;         *)            echo "only 1(5.1) or 2(5.6)"            exit 1            ;;    esacdone}##function of install httpd.install_httpd() {echo "Install apache version 2.2."cd /usr/local/src[ -f httpd-2.2.16.tar.gz ] || wget  http://syslab.comsenz.com/downloads/linux/httpd-2.2.16.tar.gztar zxf  httpd-2.2.16.tar.gz && cd httpd-2.2.16check_ok./configure \--prefix=/usr/local/apache2 \--with-included-apr \--enable-so \--enable-deflate=shared \--enable-expires=shared \--enable-rewrite=shared \--with-pcrecheck_okmake && make installcheck_ok}##function of install lamp's php.install_php() {echo -e "Install php.\nPlease chose the version of php."select php_v in 5.4 5.6do    case $php_v in        5.4)            cd /usr/local/src/            [ -f php-5.4.45.tar.bz2 ] || wget 'http://cn2.php.net/get/php-5.4.45.tar.bz2/from/this/mirror' -O php-5.4.45.tar.bz2            tar jxf php-5.4.45.tar.bz2 && cd php-5.4.45            for p in openssl-devel bzip2-devel \            libxml2-devel curl-devel libpng-devel \            libjpeg-devel freetype-devel libmcrypt-devel\            libtool-ltdl-devel perl-devel            do                myum $p            done            check_ok            ./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 \            --with-gd \            --with-jpeg-dir \            --with-png-dir \            --with-freetype-dir \            --with-iconv-dir \            --with-zlib-dir \            --with-bz2 \            --with-openssl \            --with-mcrypt \            --enable-soap \            --enable-gd-native-ttf \            --enable-mbstring \            --enable-sockets \            --enable-exif \            --disable-ipv6            check_ok            make && make install            check_ok            [ -f /usr/local/php/etc/php.ini ] || /bin/cp php.ini-production  /usr/local/php/etc/php.ini            break            ;;        5.6)            cd /usr/local/src/            [ -f php-5.6.6.tar.gz ] || wget http://mirrors.sohu.com/php/php-5.6.6.tar.gz            tar zxf php-5.6.6.tar.gz &&   cd php-5.6.6            for p in openssl-devel bzip2-devel \            libxml2-devel curl-devel libpng-devel \            libjpeg-devel freetype-devel libmcrypt-devel\            libtool-ltdl-devel perl-devel            do                myum $p            done            ./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 \            --with-gd \            --with-jpeg-dir \            --with-png-dir \            --with-freetype-dir \            --with-iconv-dir \            --with-zlib-dir \            --with-bz2 \            --with-openssl \            --with-mcrypt \            --enable-soap \            --enable-gd-native-ttf \            --enable-mbstring \            --enable-sockets \            --enable-exif \            --disable-ipv6            check_ok            make && make install            check_ok            [ -f /usr/local/php/etc/php.ini ] || /bin/cp php.ini-production  /usr/local/php/etc/php.ini            break            ;;        *)            echo "only 1(5.4) or 2(5.6)"            ;;    esacdone}##function of apache and php configue.join_apa_php() {sed -i '/AddType .*.gz .tgz$/a\AddType application\/x-httpd-php .php' /usr/local/apache2/conf/httpd.confcheck_oksed -i 's/DirectoryIndex index.html/DirectoryIndex index.php index.html index.htm/' /usr/local/apache2/conf/httpd.confcheck_okcat > /usr/local/apache2/htdocs/index.php <
EOFif /usr/local/php/bin/php -i |grep -iq 'date.timezone => no value'then sed -i '/;date.timezone =$/a\date.timezone = "Asia\/Chongqing"' /usr/local/php/etc/php.inifi/usr/local/apache2/bin/apachectl restartcheck_ok}##function of check service is running or not, example nginx, httpd, php-fpm.check_service() {if [ "$1" == "phpfpm" ]then s="php-fpm"else s=$1fin=`ps aux |grep "$s"|wc -l`if [ $n -gt 1 ]then echo "$1 service is already started."else if [ -f /etc/init.d/$1 ] then /etc/init.d/$1 start check_ok else install_$1 fifi}##function of install lamplamp() {check_service mysqldcheck_service httpdinstall_phpjoin_apa_phpecho "LAMP done,Please use 'http://your ip/index.php' to access."}##function of install nginxinstall_nginx() {cd /usr/local/src[ -f nginx-1.8.0.tar.gz ] || wget http://nginx.org/download/nginx-1.8.0.tar.gztar zxf nginx-1.8.0.tar.gzcd nginx-1.8.0myum pcre-devel./configure --prefix=/usr/local/nginxcheck_okmake && make installcheck_okif [ -f /etc/init.d/nginx ]then /bin/mv /etc/init.d/nginx /etc/init.d/nginx_`date +%s`ficurl http://www.apelearn.com/study_v2/.nginx_init -o /etc/init.d/nginxcheck_okchmod 755 /etc/init.d/nginxchkconfig --add nginxchkconfig nginx oncurl http://www.apelearn.com/study_v2/.nginx_conf -o /usr/local/nginx/conf/nginx.confcheck_okservice nginx startcheck_okecho -e "
" > /usr/local/nginx/html/index.phpcheck_ok}##function of install php-fpminstall_phpfpm() {echo -e "Install php.\nPlease chose the version of php."select php_v in 5.4 5.6do case $php_v in 5.4) cd /usr/local/src/ [ -f php-5.4.45.tar.bz2 ] || wget 'http://cn2.php.net/get/php-5.4.45.tar.bz2/from/this/mirror' -O php-5.4.45.tar.bz2 tar jxf php-5.4.45.tar.bz2 && cd php-5.4.45 for p in openssl-devel bzip2-devel \ libxml2-devel curl-devel libpng-devel \ libjpeg-devel freetype-devel libmcrypt-devel\ libtool-ltdl-devel perl-devel do myum $p done if ! grep -q '^php-fpm:' /etc/passwd then useradd -M -s /sbin/nologin php-fpm check_ok fi ./configure \ --prefix=/usr/local/php-fpm \ --with-config-file-path=/usr/local/php-fpm/etc \ --enable-fpm \ --with-fpm-user=php-fpm \ --with-fpm-group=php-fpm \ --with-mysql=/usr/local/mysql \ --with-mysql-sock=/tmp/mysql.sock \ --with-libxml-dir \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --with-iconv-dir \ --with-zlib-dir \ --with-mcrypt \ --enable-soap \ --enable-gd-native-ttf \ --enable-ftp \ --enable-mbstring \ --enable-exif \ --enable-zend-multibyte \ --disable-ipv6 \ --with-pear \ --with-curl \ --with-openssl check_ok make && make install check_ok [ -f /usr/local/php-fpm/etc/php.ini ] || /bin/cp php.ini-production /usr/local/php-fpm/etc/php.ini if /usr/local/php-fpm/bin/php -i |grep -iq 'date.timezone => no value' then sed -i '/;date.timezone =$/a\date.timezone = "Asia\/Chongqing"' /usr/local/php-fpm/etc/php.ini check_ok fi [ -f /usr/local/php-fpm/etc/php-fpm.conf ] || curl http://www.apelearn.com/study_v2/.phpfpm_conf -o /usr/local/php-fpm/etc/php-fpm.conf [ -f /etc/init.d/phpfpm ] || /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/phpfpm chmod 755 /etc/init.d/phpfpm chkconfig phpfpm on service phpfpm start check_ok break ;; 5.6) cd /usr/local/src/ [ -f php-5.6.6.tar.gz ] || wget http://mirrors.sohu.com/php/php-5.6.6.tar.gz tar zxf php-5.6.6.tar.gz && cd php-5.6.6 for p in openssl-devel bzip2-devel \ libxml2-devel curl-devel libpng-devel \ libjpeg-devel freetype-devel libmcrypt-devel\ libtool-ltdl-devel perl-devel do myum $p done if ! grep -q '^php-fpm:' /etc/passwd then useradd -M -s /sbin/nologin php-fpm fi check_ok ./configure \ --prefix=/usr/local/php-fpm \ --with-config-file-path=/usr/local/php-fpm/etc \ --enable-fpm \ --with-fpm-user=php-fpm \ --with-fpm-group=php-fpm \ --with-mysql=/usr/local/mysql \ --with-mysql-sock=/tmp/mysql.sock \ --with-libxml-dir \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --with-iconv-dir \ --with-zlib-dir \ --with-mcrypt \ --enable-soap \ --enable-gd-native-ttf \ --enable-ftp \ --enable-mbstring \ --enable-exif \ --disable-ipv6 \ --with-pear \ --with-curl \ --with-openssl check_ok make && make install check_ok [ -f /usr/local/php-fpm/etc/php.ini ] || /bin/cp php.ini-production /usr/local/php-fpm/etc/php.ini if /usr/local/php-fpm/bin/php -i |grep -iq 'date.timezone => no value' then sed -i '/;date.timezone =$/a\date.timezone = "Asia\/Chongqing"' /usr/local/php-fpm/etc/php.ini check_ok fi [ -f /usr/local/php-fpm/etc/php-fpm.conf ] || curl http://www.apelearn.com/study_v2/.phpfpm_conf -o /usr/local/php-fpm/etc/php-fpm.conf check_ok [ -f /etc/init.d/phpfpm ] || /bin/cp sapi/fpm/init.d.php-fpm /etc/init.d/phpfpm chmod 755 /etc/init.d/phpfpm chkconfig phpfpm on service phpfpm start check_ok break ;; *) echo 'only 1(5.4) or 2(5.6)' ;; esacdone}##function of install lnmplnmp() {check_service mysqldcheck_service nginxcheck_service phpfpmecho "The lnmp done, Please use 'http://your ip/index.php' to access."}read -p "Please chose which type env you install, (lamp|lnmp)? " tcase $t in lamp) lamp ;; lnmp) lnmp ;; *) echo "Only 'lamp' or 'lnmp' your can input." ;;esaclamp script

 

/bin/bash

echo "it will install lamp or lnmp"

sleep 1

#check last command is ok or not

check_ok(){

if [$? !=0]

then

  echo "Error ,check the error log"

  exit 1

fi

}

##get the archive of the system ,i886 or x86_64

arch=`uname -r |awk -F '.' '{print $NF}'`

arch可以换成:ar = `arch`因为arch是命令,所以变量名不能为arch会有冲突

##close selinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/seliunx ???路劲对么???

selinux_s=`getenforce`

if [$selinux_s -eq "enforcing"](变量和字符串不能用-eq,-eq是用于数字,改用==)

then 

  setenforce 0

fi

##close iptables

iptables-save > /etc/sysconfig/iptables_`date +%s`把iptables的规则保存一下,+%s是时间戳,防止脚本执行多次会残生覆盖,让他每次都不一样

iptables -F

 services iptables save

##if the package installed ,then omit.

myum() {

if !rpm -qa|grep -q "^(以什么开头)$1"($1是传递一个参数)

then 

  yum install -y $1

  dheck_ok

else

  echo $1 aready installed.

fi

}

##install some packages.

for p in gcc wget perl perl-devel libaio libaio-devel pare-devel zlib-devel

do

  myum $p

done

##install epel.

if rpm -qa epel-release > /dev/null

then

   rpm -e epel-release

fi

if ls /etc/yum/repos.d/epel-6.repo* > /dev/null 2>&1

then 

  rm -f /etc/yum.repos.d/epel-6.repo*

fi

wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo

 

 

##function of install mysql.

install_mysqld() {

echo "chose the version of mysql."

select mysql_v in 5.1 5.6

do

  case $mysql_v in 5.1)

    cd /usr/local/src

    [-f mysql-5.1.72-linux-$arch-glibc23.tar.gz] || wget http://mirrors.sohu.com/mysql/MYSQL-5.1/mysql-5.1.72.linux-$arch-glib23.tar.gz

    check_ok

    tar zxf mysql-5.1.71-linux-$arch-glibc23.tar.gz

    check_ok

    [ -d /usr/local/mysql] && /bin/mv /usr/local/mysql_`date +%s`

check_ok

if ! grep '^mysql:' /etc/passwd

then 

  useradd -M mysql -s /sbin/nologin

  check_ok

fi

myum compat-libstdc++-33

[ -d /data/mysql ] && /bin/mv /data/mysql /data/mysql_`data +%s`

mkdir -p /data/mysql

chown -R mysql:mysql /data/mysql

cd /usr/local/mysql

./script/mysql_install_db --user=mysql --datadir=/data/mysql

check_ok

sed -i '/^\[mysqld\]$/a\datadir=data/mysql' etc/my.cnf

/bin/cp support-files/my-huge.cnf /etc/my.cnf

check_ok

sed -i 's#^datadir=#datadir=/data/mysql#' /etc/init.d/mysqld

(##vim 1.txt

11111

33333

sed -i(直接把文件更改) /'^11111$/a\22222' 1.txt)

chmod 755 /etc/init.d/mysqld

chkconfig --add mysql 

chkconfig mysql on

service mysqld start

check_ok

break

;;

}

 

##function of install httpd

install_httpd() {

echo "install apache version 2.2"

cd /usr/local/src/

[ -f httpd-2.2.16.tar.gz ]  || wget http://syslab.comsenz.com/downloads/linux/httpd-2.2.216.tar.gz

check_ok

./configure \

--prefix=/usr/local/apache2 \

--with-included-apr \

--enabled-so \

--enabled-deflate=shared \

--enabled-expires=shared \

--enabled-rewrite=shared \

--with-pcre

check_ok

}

 

 

install_php() {

echo -e "install php .\nplease chose the vwersion of php."

select php_v in 5.3 5.6

do

  case $php_v in

    5.3)

cd /usr/local/src/

[ -f php-5.3.10.tar.bz2 ] || wget http://syslab.comsenz.com/downloads/linux/php-5.3.10.tar.bz2

check_ok

tar jxf php-5.3.10.tar.bz2 && cd php-5.3.10

for p in openssl-devel bzip2-devel \

libxm12-devel curl-devel libpng-devel \

libjpeg-devel freetype-devel libmcrypt-devel \

libtool-ltdl-devel perl-devel

do 

  myum $p

done

check_ok

./configure \

--prefix=/usr/local/php \

--with-apxs2=/usr/local/apache/bin/apxs \

--with-config-file-path=/usr/local/php/etc \

--with-mysql=/usr/local/mysql \

--with-libxml-dir \

--wirh-gd \

--with-png-dir \

--with-freetype-dir \

--with-iconv-dir \

--with-zlib-dir \

--with-bz2 \

--with-openssl \

--with-mcrypt \

--enabled-soap \

--enbale-gd-native-ttf \

--enable-mbstring \

--enabled-sockets \

--enabled-exif \

--disable-ipv6

check_ok

make && make install

check_ok

[ -f /usr/local/php/etc/php.ini ] || /bin/cp php.ini-production /usr/local/php/etc/php.ini

break

;;

*)

5.6)....

*)

echo "only 1(5.3) or 2(5.6)"

esac

done

}

join_apa_php() {

sed -i '/AddType .*.gz .tgz$/a\AddType application\/x-http-php .php' /usr/local/apache/conf/httpd.conf

check_ok

sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php index.html index.htm/' /usr/local/apache/httpd.conf

check_ok

cat > /usr/local/apache/htdocs/index.php <<EOF(EOF作用)

<?php

  phpinfo();

?>

EOF

 

if /usr/local/php/bin/php -i |grep -iq 'date.timezone => novalue'(如果没有定义timezone就会发出警告)

then 

  send -i '/;date.timezone = $/a\date.time.zone = "Asia\/Chongqing"' /usr/local/php/etc/php.ini

fi

/usr/local/apache/bin/apachect1 restart

check_ok

}

##防止我们执行多次脚本

check_service(){

if  [ "$1" == "phpfpm" ]

then   

  s="php=-fpm"

else

  s=$1

fi

n=`ps aux |grep "$s"|wc -l`

if [ $n -gt l]

then 

  echo "$1 service is already started."

else

   if [ -f /etc/init.d/$1 ]

  then

    /etc/init.d/$1 start

    check_ok

  else

  install_$1

  fi

fi

}

##function of install lamp

lamp() {

check_service mysqld

check_service httpd

install_php(不严谨,没有判断有没有安装)

join_apa_php

echo "LAMP done.Please use 'http://your ip/index.php' to access"

}

 

 

 install_nginx() {

cd /usr/local/src

[ -f nginx-1.8.0.tar.gz ] || wget http://nginx.org/download/nginx-1.8.0.tar.gz

check_ok

tar zxf nginx-1.8.0.tar.gz

cd nginx-1.8.0

myum pcre-devel

./configure  --prefix=/usr/local/nginx

check_ok

if [ -f /etc/init.d/nginx ] 

then 

  /bin/mv /etc/ini.d/nginx /etc/init.d/nginx_`date+ %s`

fi

curl http://www.apelearn.com/study_v2/.nginx_init -o /etc/init.d/nginx

check_ok

chmod 755 /etc/init.d/nginx

chkconfig --add nginx

chkconfig nginx on

curl http://www.apelearn.com/study-v2/.nginx.conf -o(把下载的内容重定向到某个文件) /usr/local/nginx/conf/nginx.conf

check_ok

service nginx start

check_ok

echo -e "<%php\n phpinfo(); \n?>" > /usr/local/nginx/html/index.php

check_ok

}

 

##function of install php-fpm

install_phpfpm() {

echo -e "install php.\nPlease chose the verson of php"

select php_v in 5.3 5.6

do

  case $php_v in

    5.3)

cd /usr/local/src/

[ -f php-5.3.10.tar.bz2 ] || wget http://syslab.comsenz.com/downloads/linux/php-5.3.10.tar.bz2

check_ok

tar jxf php-5.3.10.tar.bz2 && cd php-5.3.10

for p in openssl-devel bzip2-devel \

libxml2-devel curl-devel libpng-devel \

libjpeg-devel freetype-devel libmcrypt-devel \

libtool-ltd1-devel perl-devel

do

  myum $p

done

if ! grep -q '^php-fpm:' /etc/passwd

then 

  useradd -M -s /sbin/nologin php-fpm

fi

check_ok

./configure \

--prefix = /usr/local/php-fpm \

--with-config-file-path=/usr/local/php-fpm \

--enabled-fpm \

--with-fpm-user=php-fpm \

--with-fpm-group=/php-fpm \

--with-mysql=/usr/local/mysql \

--with-mysql-sock=/tmp/mysql.sock \

--with-libxml-dir \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-freetype-dir \

--with-iconv-dir \

--with-zlib-dir \

--with-mcrypt \

--enable-soap \

--enable-gd-native-ttf \

--enable-ftp \

--enable-mbstring \

--enable-exif \

--enable-zend-multibyte \

disabled-ipv6 \

--with-pear \

--with-curl \

--with-openssl 

check_ok

make && make install

check_ok

[ -f /usr/local/php-fpm/etc/pnp.ini || /bin/cp php.ini-production /usr/local/php-fpm/etc/php.ini

if /usr/local/php-fpm/bin/php -i |grep -iq 'date.timezone => no value'

then

  sed -i '/;date.timezone = $/a\date.timezone ="Asia\/Chongqing"' /usr/local/php-fpm/etc/php.ini

  check_ok

fi

[ -f /usr/local/php-fpm/etc/php-fpm.conf ] || curl http://www.apelearn.com/study_v2/.php-fpm.conf -o /usr//php-fpm/etc/php-fpm.conf

check_ok

[ -f /etc/init.d/phpfpm ] || /bin/cp sapi/fpm/init.d/php-fpm /etc/init.d/phpfpm

check_ok

chmod 755 /etc/init.d/phpfpm

chkconfig phpfpm on

service phpfpm start

check_ok

break

;;

5.6)

*)

echo 'only 1(5.3) 2(5.6)'

;;

esac

done

}

 

lnmp() {

check_service mysqld

check_service nginx

check_service phpfpm

echo "the lnmp done. Please use 'http://your ip/index.php ' to access"

}

 

read -p "Please chose which type env you install (lamp ,lnmp)" t

case $t in

  lamp)

    lamp

    ;;

  lnmp)    

    lnmp

    ;;

  *)

    echo "only 'lamp' or'lnmp' you can input"

    ;;

esac

done

转载于:https://www.cnblogs.com/Nyan-Workflow-FC/p/4984497.html

你可能感兴趣的文章
java web开发 高并发处理
查看>>
PHP 高级编程之多线程(二)
查看>>
ART世界探险(12) - OAT文件分析(2) - ELF文件头分析(中)
查看>>
AFNetworking 和 ASIHTTPRequest
查看>>
Qt之自定义界面(实现无边框、可移动)
查看>>
MS SQL修改数据库名称
查看>>
【RMAN】使用RMAN duplicate复制同机数据库
查看>>
概率论快速学习03:概率公理补充
查看>>
C++ 对象的内存布局(上)
查看>>
向Java开发者介绍Scala
查看>>
【软考点点】计算机基础知识
查看>>
hdu2066一个人的旅行(多源点多汇点的最短路径问题)
查看>>
老猪带你玩转android自定义控件一——打造最简单viewpagerindicator
查看>>
【hibernate框架】性能优化之list_iterate的不同之处
查看>>
block高级功能
查看>>
把钱投资自己的头脑上(一)
查看>>
iOS调试奇巧淫技(二)之LLDB
查看>>
[LeetCode]173.Binary Search Tree Iterator
查看>>
整合大量开源库项目(五)跳动的TextView JumpingBeans,良好体验的滚动栏ConvenientBanner...
查看>>
some utility discovered by Linux yum search all tcp, epel.repo
查看>>