lamp之自动化编译安装

author author     2022-09-22     372

关键词:

1 概述

LAMP 目前在CentOS6不支持php-fpm的安装,安装高版本的数据库在centos6上也需要通过编译安装完成,本文介绍了Modules模式和FastCGI模式快速部署LAMP的包和相关操作,同时附上了一键安装的编译脚本。

2  快速部署LAMP

在CentOS6和7中,在Modules模式和FastCGI模式安装服务包如下

.CentOS 7:

.Modules模式:httpd, php,php-mysql, mariadb-server
.FastCGI模式:httpd, php-fpm,php-mysql, mariadb-server

.CentOS 6:

.Modules模式:httpd, php, php-mysql,mysql-server
.FastCGI:默认不支持

.安装LAMP

.CentOS 6:

yum install httpd, php, mysql-server,php-mysql
service httpdstart
service mysqld start

.CentOS 7:

yum install httpd, php, php-mysql,mariadb-server
systemctl  start httpd.service
systemctl  start mariadb.service

.注意:要使用prefork模型

3 一键编译安装

脚本前提:

1.本次下载的服务包都放在了自制的http服务器172.18.50.75这台服务器上,通过wget工具进行下载。

2.保证yum源可用,yum源既要有本地的光盘yum源,同时也要保证epel源可用,因为软件包安装需要用到这两个源安装一些开发包组,建议用yum repolist 查看

#!/bin/bash
#
#******************************************************************************
#Author:               Sunny
#Date:                 2017-10-07
#FileName:             auto_install_LAMP.sh
#version:              1.0
#Your change info:      
#Description:          For auto install LAMP with xcache,wordpress,phymysqladmin
#DOC URL:               
#Copyright(C):         2017  All rihts reserved
#*****************************************************************************
echo "Now install wget..."
rpm -q wget &>/dev/null || yum -y install wget &>/dev/null;
echo "install development tools,please wait..."
yum -y groupinstall "development tools" &>/dev/null || { echo "something wrong when install development tools,Please check local yum resource,script exist now";exit; }
serverip=$(ifconfig  | awk ‘/inet /{print $2}‘| awk -F : ‘{print $NF}‘| head -1)

[ -e /app ] || mkdir /app

get_version() {
 os_version=`cat /etc/system-release | grep -o " [0-9]"| cut -d " " -f2`
}

get_version;
min_time () {
    time=`date +%Y%m%d%H%M`
}
min_time;

last_restart_ser(){

/app/httpd24/bin/apachectl restart &>/dev/null && echo "Httpd24 has been restart OK,you can test now..." || echo "Something wrong when start httpd24,please check"
service mysqld restart &>/dev/null  && echo "Mysqld has been restart OK,you can test now..." || echo "Something wrong when start httpd24,please check"
service php-fpm restart &>/dev/null && echo "php-fpm has been restart OK,you can test now..." || echo "Restart php-fpm wrong,if you install php-fpm,please check,else ignore it."
echo "PATH=/app/php/bin:/app/httpd24/bin/:/usr/local/mysql/bin/:$PATH" >> /etc/profile.d/lamp.sh
echo "please run . /etc/profile.d/lamp.sh in order to export PATH"
echo "run   mysql_secure_installation  to init mysql"
echo "all is done,now exist"

}


httpd24_service(){
cat >/etc/init.d/httpd24<<eof
#!/bin/bash
#
# httpd        Startup script for the Apache HTTP Server
#
# chkconfig: - 85 15
# description: The Apache HTTP Server is an efficient and extensible  #	       server implementing the current HTTP standards.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd/httpd.pid
#
### BEGIN INIT INFO
# Provides: httpd
# Required-Start: $local_fs $remote_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: distcache
# Short-Description: start and stop Apache HTTP Server
# Description: The Apache HTTP Server is an extensible server 
#  implementing the current HTTP standards.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

if [ -f /etc/sysconfig/httpd ]; then
        . /etc/sysconfig/httpd
fi

# Start httpd in the C locale by default.
HTTPD_LANG=${HTTPD_LANG-"C"}

# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""

# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.

# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/app/httpd24/bin/apachectl
httpd=${HTTPD-/app/httpd24/bin/httpd}
prog=httpd
pidfile=${PIDFILE-/app/httpd24/logs/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd24}
RETVAL=0
STOP_TIMEOUT=${STOP_TIMEOUT-10}

# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure.  So we just do it the way init scripts
# are expected to behave here.
start() {
        echo -n $"Starting $prog: "
        LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        return $RETVAL
}

# When stopping httpd, a delay (of default 10 second) is required
# before SIGKILLing the httpd parent; this gives enough time for the
# httpd parent to SIGKILL any errant children.
stop() {
	echo -n $"Stopping $prog: "
	killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
}
reload() {
    echo -n $"Reloading $prog: "
    if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
        RETVAL=6
        echo $"not reloading due to configuration syntax error"
        failure $"not reloading $httpd due to configuration syntax error"
    else
        # Force LSB behaviour from killproc
        LSB=1 killproc -p ${pidfile} $httpd -HUP
        RETVAL=$?
        if [ $RETVAL -eq 7 ]; then
            failure $"httpd shutdown"
        fi
    fi
    echo
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status -p ${pidfile} $httpd
	RETVAL=$?
	;;
  restart)
	stop
	start
	;;
  condrestart|try-restart)
	if status -p ${pidfile} $httpd >&/dev/null; then
		stop
		start
	fi
	;;
  force-reload|reload)
        reload
	;;
  graceful|help|configtest|fullstatus)
	$apachectl [email protected]
	RETVAL=$?
	;;
  *)
	echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}"
	RETVAL=2
esac

exit $RETVAL
eof
chmod 755 /etc/init.d/httpd24
}


get_pack_file (){
  echo "Now You will ask to input to package name,if you do not know the complete package name,please check under  $url $localdir" 
  echo "for example,version httpd 2.4 ,its complete package name is httpd-2.4.27.tar.bz2,if you have many packages to download,you should use space to distinguish between different packages"
  read -p "now please input the packages names you want to download in $url,(eg:apr-1.6.2.tar.gz  httpd-2.4.27.tar.bz2  php-7.1.10.tar.xz): " package
  [ -e /root/package/package."$time" ] || mkdir -p /root/package/package."$time";
  echo "$package" | tr -s " " "
" &>/root/package/package.file
  echo
}

get_package (){

echo "You have two ways to get packages you want:"
echo "remote: You will download from remote server,default url is  http://192.168.32.75/source"
echo "local:  You have already prepare package in the local host"
echo
[ -e /root/package ] || mkdir -p /root/package;
read -p  "Your package in l(local) or r(remote)( r or l ): " choice
case $choice in
r)
  read -p "Please input the url where you want to download package(default:http://172.18.50.75/source): " url
  url=${url:-http://172.18.50.75/source}
  wget -nv --spider $url 2>&1 | grep -o "200 OK" &>/dev/null || { echo "The url is wrong or could not be connect,the scirpt will exit,please check";exit; }


  get_pack_file;

  echo "Now start to download pack,please wait a minute"
  cd  /root/package/package."$time"
  while read pack;
  do
  [ -e /root/package/package."$time"/$pack ] || wget -q "$url/$pack"
  [ -e /root/package/package."$time"/$pack ] && echo  "$pack had been success download !" || { echo "$pack did not been downloaded,it will exist,please check...";exit; }
  done</root/package/package.file;
 # rm -f /root/package/package.file;
;;
l)
   read -p "Please input the package directory(eg: /root/mariadb ): " localdir

  get_pack_file;

  echo "Now start to copy pack to /root/package/package."$time",please wait a minute"
  cd  /root/package/package."$time"
  while read pack
  do
  [ -e /root/package/package."$time"/$pack ] || cp $localdir/$pack /root/package/package."$time" &>/dev/null;
  [ -e /root/package/package."$time"/$pack ] && echo  "$pack had been  success copy to /root/package/package.$time " || { echo "$pack did not copy to /root/package/package.$time,it will exist,please check...";exit; }
  done</root/package/package.file
 # rm -f /root/package/package.file;
;;
*)
  echo "Your input is not r or l ,and it is wrong input,the script will exit,please check"
  exit
;;
esac
}

remove_package(){
read -p "Would U want to remove the package you have prepared this time( y  or  n ): " removeable
if [ "$removeable" = "y" ];then
  echo "now delete  /root/package/package."$time""
  rm -rf /root/package/package."$time";
  else
  echo "Since you answer is not y,$package will be save in  /root/package/package."$time" "
fi
}

install_httpd24(){
echo "now install httpd-2.4.27.tar.bz2 include apr-1.6.2.tar.gz  and apr-util-1.6.0.tar.gz"
get_package;
echo "Httpd2.4 will be install in /app/httpd24,it is website home is /app/httpd24/htdocs/"
echo install openssl-devel pcre-devel expat-devel ,please wait...
yum -y  install openssl-devel pcre-devel expat-devel &>/dev/null || { echo "something wrong when install openssl-devel pcre-devel expat-devel ,Please check local yum resource,script exist now";exit; }
cd /usr/local
tar xf /root/package/package."$time"/apr-1.6.2.tar.gz -C /usr/local
tar xf /root/package/package."$time"/apr-util-1.6.0.tar.gz -C /usr/local
tar xf /root/package/package."$time"/httpd-2.4.27.tar.bz2 -C /usr/local
cp -r /usr/local/apr-1.6.2  /usr/local/httpd-2.4.27/srclib/apr
cp -r /usr/local/apr-util-1.6.0  /usr/local/httpd-2.4.27/srclib/apr-util
cd /usr/local/httpd-2.4.27/
echo "now configure and make install httpd24"
./configure --prefix=/app/httpd24 --enable-so --enable-ssl --enable-rewrite --with-zlib --with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork &>/dev/null;
make &>/dev/null || ehco "something wrong when make httpd.please check"
make install &>/dev/null  || ehco "something wrong when make install httpd.please check"
echo  "PATH=/app/httpd24/bin/:$PATH" >> /etc/profile.d/lamp.sh
id apache &>/dev/null && userdel  apache &>/dev/null;
useradd -r -d /app/httpd24/htdoc  -s /sbin/nologin apache;
sed -i ‘s/User daemon/User apache/g‘  /app/httpd24/conf/httpd.conf 
sed -i ‘s/Group daemon/Group apache/g‘  /app/httpd24/conf/httpd.conf 
echo  "PATH=/app/httpd24/bin/:$PATH" >> /etc/profile.d/lamp.sh
sed -i "s/#ServerName www.example.com:80/ServerName www.$(hostname).com:80/g" /app/httpd24/conf/httpd.conf
if [ "$os_version" -eq 6 ];then
httpd24_service
chkconfig --add httpd24
chkconfig  httpd24 on
else 
echo "/app/httpd24/bin/apachectl start" >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
fi
/app/httpd24/bin/apachectl restart &>/dev/null;
ss -nultp | grep :80 &>/dev/null && echo "Httpd24 now is running..." || echo "Httpd24 could not be start,please check"
}

install_mariadb(){
echo "now install mariadb-5.5.57-linux-x86_64.tar.gz"
get_package;
echo "now unzip mariadb,wait a minute"
tar xf /root/package/package."$time"/mariadb-5.5.57-linux-x86_64.tar.gz  -C /usr/local/
cd /usr/local/
ln -s mariadb-5.5.57-linux-x86_64/ mysql
id mysql &>/dev/null && userdel  mysql &>/dev/null;
useradd -r -m -d /app/mysqldb -s /sbin/nologin mysql;
cd /usr/local/mysql
scripts/mysql_install_db --datadir=/app/mysqldb --user=mysql &>/dev/null;
mkdir /etc/mysql
cp support-files/my-large.cnf   /etc/mysql/my.cnf
sed -i ‘/[mysqld]/ a skip_name_resolve = ON‘ /etc/mysql/my.cnf
sed -i ‘/[mysqld]/ a innodb_file_per_table = ON‘ /etc/mysql/my.cnf
sed -i ‘/[mysqld]/ a datadir = /app/mysqldb‘ /etc/mysql/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig  mysqld on
if [ $os_version -eq 6 ];then
touch /var/log/mysqld.log;
chown mysql /var/log/mysqld.log;
else
mkdir /var/log/mariadb;
chown mysql /var/log/mariadb/;
fi;
service mysqld restart &>/dev/null;
ps -ef | grep ^mysql &>/dev/null && echo "Mysql is running now..." || echo "Mysql is not running,please check"
echo "PATH=/usr/local/mysql/bin/:$PATH" >/etc/profile.d/lamp.sh 
echo "Now create database wpdb and create user wpadmin"
/usr/local/mysql/bin/mysql <<EOF
create database wpdb;
grant all on wpdb.* to [email protected]‘%‘ identified by ‘Pass123456‘;
EOF
echo "After mariadb is complete install,for safe ,run mysql_secure_installation"
}

install_php(){
echo "now install php-5.6.31.tar.bz2"
get_package;
echo "install libxml2-devel bzip2-devel libmcrypt-devel,please wait..."
echo "You should check basic and epel source"
yum -y install libxml2-devel bzip2-devel libmcrypt-devel &>/dev/null || { echo "something wrong when install libxml2-devel bzip2-devel libmcrypt-devel,Please check local and epel yum resource,script exist now";exit; }
echo "now unzip  php-5.6.31.tar.bz2,wait a minite"
tar xf /root/package/package."$time"/php-5.6.31.tar.bz2 -C /usr/local
echo "now configure php"
cd /usr/local/php-5.6.31
./configure --prefix=/app/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-png-dir --with-jpeg-dir --with-freetype-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 &>/dev/null || { echo "something wrong when configure php,script will exist,please check";exit; }
make &>/dev/null || { echo "something wrong when make php,script will exist,please check";exit; }
make install &>/dev/null || { echo "something wrong when make install php,script will exist,please check";exit; }
cp /usr/local/php-5.6.31/php.ini-production  /etc/php.ini
echo "AddType application/x-httpd-php .php" >> /app/httpd24/conf/httpd.conf
echo "AddType application/x-httpd-php-source .phps" >> /app/httpd24/conf/httpd.conf
sed -i.bak ‘s/DirectoryIndex index.html/DirectoryIndex index.php index.html/g‘ /app/httpd24/conf/httpd.conf
cat >/app/httpd24/htdocs/index.php <<EOF
<h1>
<?php
$mysqli=new mysqli("$serverip","root","Pass123456");
if(mysqli_connect_errno()){
echo "it is falilure!";
$mysqli=null;
exit;
}
echo "nice job,it is connected...";
$mysqli->close();
phpinfo();
?>
</h1>
EOF
echo "php has been complete configure,now resatart httpd24"
/app/httpd24/bin/apachectl restart  &>/dev/null && echo "Httpd24 has been restart OK,you can test now..." || echo "Something wrong when start httpd24,please check"
}

install_php_fpm(){
echo "now install php-5.6.31.tar.bz2"
echo "install libxml2-devel bzip2-devel libmcrypt-devel,please wait..."
yum -y install openssl-devel libxml2-devel bzip2-devel &>/dev/null || { echo "something wrong when install  openssl-devel libxml2-devel bzip2-devel,Please check local  yum resource,script exist now";exit; }
yum -y install libmcrypt-devel &>/dev/null || { echo "something wrong when install libmcrypt-devel,Please check epel yum resource,script exist now";exit; }
get_package;
echo "now unzip  php-5.6.31.tar.bz2,wait a minite"
tar xf /root/package/package."$time"/php-5.6.31.tar.bz2 -C /usr/local
echo "now configure php"
cd /usr/local/php-5.6.31
./configure --prefix=/app/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir  --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc/php --with-config-file-scan-dir=/etc/php.d --with-bz2 &>/dev/null || { echo "something wrong when configure php,script will exist,please check";exit; }
make &>/dev/null || { echo "something wrong when make php,script will exist,please check";exit; }
make install &>/dev/null || { echo "something wrong when make install php,script will exist,please check";exit; }
[ -e /etc/php ] || mkdir /etc/php/
cp /usr/local/php-5.6.31/php.ini-production  /etc/php/php.ini
cp   /usr/local/php-5.6.31/sapi/fpm/init.d.php-fpm  /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
cp /app/php/etc/php-fpm.conf.default  /app/php/etc/php-fpm.conf
sed -i.bak ‘s/#LoadModule proxy_module modules/mod_proxy.so/LoadModule proxy_module modules/mod_proxy.so/g‘  /app/httpd24/conf/httpd.conf
sed -i ‘s/#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so/LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so/g‘  /app/httpd24/conf/httpd.conf
#config httpd
sed -i.bak ‘s/DirectoryIndex index.html/DirectoryIndex index.php index.html/g‘ /app/httpd24/conf/httpd.conf
echo "AddType application/x-httpd-php .php" >> /app/httpd24/conf/httpd.conf
echo "AddType application/x-httpd-php-source .phps" >> /app/httpd24/conf/httpd.conf
echo "ProxyRequests Off" >>/app/httpd24/conf/httpd.conf
#If your php_fpm is not install in the local host,you should replace 127.0.0.1 with php_fpm host ip.
echo "ProxyPassMatch  ^/(.*.php)$ fcgi://127.0.0.1:9000/app/httpd24/htdocs/$1" >>/app/httpd24/conf/httpd.conf
cat >/app/httpd24/htdocs/index.php <<EOF
<h1>
<?php
$mysqli=new mysqli("$serverip","wpadmin","Pass123456");
if(mysqli_connect_errno()){
echo "it is falilure!";
$mysqli=null;
exit;
}
echo "nice job,it is connected...";
$mysqli->close();
phpinfo();
?>
</h1>
EOF
echo "PATH=/app/php/bin:/app/httpd24/bin/:/usr/local/mysql/bin/:$PATH" >>/etc/profile.d/lamp.sh 
echo "php_fpm has been complete configure,now resatart php_fpm and httpd24"
service php-fpm restart &>/dev/null && echo "php-fpm has been restart OK,you can test now..." || { echo "Something wrong when startphp-fpm,it will exit,please check";exit; }
/app/httpd24/bin/apachectl restart  &>/dev/null && echo "Httpd24 has been restart OK,you can test now..." || { echo "Something wrong when start httpd24,it will exit;please check";exit; }
}


install_xcache(){
echo "now install xcache-3.2.0.tar.gz to speed up php"
get_package;
echo "install php-devel ,please wait..."
yum -y  install  php-devel &>/dev/null || { echo "something wrong when install  php-devel ,Please check local yum resource,script exist now";exit; }
tar xf /root/package/package."$time"/xcache-3.2.0.tar.gz -C /usr/local
cd /usr/local/xcache-3.2.0/
phpize 
./configure  --enable-xcache --with-php-config=/app/php/bin/php-config &>/dev/null || { echo "something wrong when configure xcache,script will exist,please check";exit; }
make  &>/dev/null || { echo "something wrong when make xcache,script will exist,please check";exit; }
make install  &>/dev/null || { echo "something wrong when make install xcache,script will exist,please check";exit; }
[ -e /etc/php.d/ ] || mkdir /etc/php.d/
cp /usr/local/xcache-3.2.0/xcache.ini  /etc/php.d/
sed -i.bak ‘s/extension = xcache.so/extension = /app/php/lib/php/extensions/no-debug-non-zts-20131226/xcache.so/g‘ /etc/php.d/xcache.ini 
echo "xcache has been complete configure,now resatart httpd24"
/app/httpd24/bin/apachectl restart  &>/dev/null && echo "Httpd24 has been restart OK,you can test now..." || echo "Something wrong when start httpd24,please check"

}

install_pma(){
echo "now install phpMyAdmin-4.0.10.20-all-languages.zip"
get_package;
echo "now install php-mysql and php-mbstring "
yum -y install  php-mysql php-mbstring &>/dev/null || { echo "something wrong when install php-mysql and php-mbstring,it will exist;please check";exit; }
unzip /root/package/package."$time"/phpMyAdmin-4.0.10.20-all-languages.zip -d /app/httpd24/htdocs/ &>/dev/null
ln -s /app/httpd24/htdocs/phpMyAdmin-4.0.10.20-all-languages/ /app/httpd24/htdocs/pma
cp /app/httpd24/htdocs/pma/config.sample.inc.php  /app/httpd24/htdocs/pma/config.inc.php
sed -i "s/$cfg[‘blowfish_secret‘].*/$cfg[‘blowfish_secret‘] = ‘afddadfsdfsfsdfdfsdfsadfsdfsdfsdfsdfffsfdsf‘;/g" /app/httpd24/htdocs/pma/config.inc.php
echo " phpMyAdmin has been complete configure now restart httpd24 and mysqld"
/app/httpd24/bin/apachectl restart  &>/dev/null && echo "httpd24 has been restart OK" || { echo "something wrong when restart httpd24,it will exit,please check";exit; }
service mysqld restart &>/dev/null && echo "mysqld has been restart ok,you can test  phpMyAdmin now" || { echo "something wrong when restart mysqld,it will exit,please check";exit; }
}

install_wordpress (){
echo "Now install wordpress-4.8-zh_CN.tar.gz,default database is wpdb,and teh user is wpadmin"
get_package;
tar xf /root/package/package."$time"/wordpress-4.8-zh_CN.tar.gz  -C /app/httpd24/htdocs
cd /app/httpd24/htdocs
ln -s /app/httpd24/htdocs/wordpress  /app/httpd24/htdocs/blog
cd /app/httpd24/htdocs/blog/
cp /app/httpd24/htdocs/blog/wp-config-sample.php  /app/httpd24/htdocs/blog/wp-config.php
sed -i.bak ‘s/database_name_here/wpdb/g‘ /app/httpd24/htdocs/blog/wp-config.php
sed -i ‘s/username_here/root/g‘ /app/httpd24/htdocs/blog/wp-config.php
sed -i ‘s/password_here/Pass1234/g‘ /app/httpd24/htdocs/blog/wp-config.php
echo "Now wordpress is config OK,you should open browser http://websrv/blog  to register "
}
echo "The script will install LAMP with phpmysqladmin,xcache and wordpress"
echo "You have two choice to install LAMP,the different is that you could install with php_fpm mode or php in httpd24"
read -p "Please input your choice ,1 means php_mode,2 means php in httpd24 mode( 1 or 2 ): " choice
case $choice in
1)
install_httpd24
install_mariadb
install_php_fpm
install_xcache
install_pma
install_wordpress

;;
2)

install_httpd24
install_mariadb
install_php
install_xcache
install_pma
install_wordpress
;;
*)
echo "Your input is wrong , now exit , please check..."
exit
;;
esac

last_restart_ser


本文出自 “阳光运维” 博客,请务必保留此出处http://ghbsunny.blog.51cto.com/7759574/1972203

编译安装lamp之httpd

编译安装httpd(httpd2.4.4,相关软件包可到apache官网上下载)#hwclock-s 将软件时间同步为硬件时间,防止安装软件时出错1、解决依赖关系httpd-2.4.4需要较新版本的apr和apr-util,因此需要事先对其进行升级。这里使用源码包进行升... 查看详情

编译部署lamp之httpd

1.编译安装httpd LAMP环境一般是根据自己的需求使用源码包进行编译安装,本次使用的是httpd-2.4.25.先对包进行解压缩,使用命令:650)this.width=650;"src="https://s4.51cto.com/wyfs02/M00/8F/71/wKioL1jefXujRPesAAAGRZTQ2iw605.png"title="image.png"alt="wK 查看详情

实践作业之编译安装lamp

题目1:httpd所支持的处理模型有哪些,他们的分别使用于哪些环境。(1)prefork模型:功能:多进程模型,每个进程响应一个请求工作方式:①一个主进程:负责生成子进程及回收子进程(工作进程),负责创建套接字,负责接收... 查看详情

编译安装lamp架构之discuz论坛(代码片段)

...、MySQL、PHP/Perl/PythonLAMP的优势成本低廉可定制、易于开发编译安装实验步骤第一步:通过Windows下载并共享LAMP软件包第二步:在Linux虚拟机上远程获取共享[root@lamp~]#smbclient-L//192.168.10.37/SharenameTypeComment--------------------LAMP-C7Disk[root@lamp~... 查看详情

lamp编译安装系列

主要还是centos6.9和centos7上相应软件包的安装及编译安装。所用版本均为当前最新版。生产环境中不建议这么干,毕竟生成以稳定为主。LAMP里php是最后安装,php依赖于服务器和数据库,所以这里单独编译系列就只有httpd和mariadb了... 查看详情

saltstack实战之配置管理-lamp自动化部署

SaltStack实战之配置管理-LAMP自动化部署学习 SaltStackSaltStack实战之配置管理-LAMP自动化部署1.部署思路2.编写lamp.sls1.部署思路650)this.width=650;"src="https://s2.51cto.com/wyfs02/M00/98/E8/wKiom1lB7T2QE2CZAABOVbwTRK8932.png"title="部署 查看详情

lamp编译安装

lamp编译安装================================================================================编译安装amp 1.编译前环境准备及相关介绍★系统环境:CentOS6,7CentOS6:apr,apr-util的版本为1.3.9,不适用于httpd-2.4的编译安装;CentOS7:apr,apr-util的 查看详情

lamp原理架构解析:lamp编译安装

Centos7.3编译安装LAMP目录:编译环境LAMP编译安装一.环境准备     征信数据库数据事件不一致导致数据(RAC集群)混乱,PLSQL查询时间和数据库时间不一致,严重影响业务本文出自“每天进步一点点,自律”博客... 查看详情

lamp源码编译安装

查看详情

编译安装lamp环境

LAMP环境配置:httpd-2.4.23+mysql-5.5.51+php-5.5.38编译安装过程编译前先准备系统的开发环境:# yum groupinstall "Development tools" "Server Platform Development"一、编译安装apache1、解决依赖关系httpd-2.4.23 查看详情

源码编译安装lamp

一、概述1、源码编译安装LAMP为什么要源码编译      一般来说,我们软件的安装方式有yum(rpm),和源码编译两种方式,那么为什么我们需要源码编译安装一部分软件?选择源码编译安装软件有以下几个原... 查看详情

编译安装lamp

题目:在LAMP架构中,请分别以php编译成httpd模块形式和php以fpm工作为独立守护进程的方式来支持httpd,列出详细的过程。本次实验以CentOS7为搭建环境,并且已经使用源码编译安装了httpd-2.4(默认使用prefork模块)和使用通用二进... 查看详情

lamp编译安装(代码片段)

lamp编译安装CentOS6:PHP-5.3.2之前:默认不支持fpm机制;需要自行打补丁并编译安装httpd-2.2:默认不支持fcgi协议,需要自行编译此模块解决方案:编译安装httpd-2.4,php-5.3.3+CentOS7:httpd-2.4:rpm包默认编译支持fcgi模块php-fpm包:专用于... 查看详情

蝼蚁的觅食之路之lamp快速安装教程

ps:度娘上的LAMP安装更全,解释更加清楚,以下纯属个人思路,仅供参考lamp快速安装步骤1、允许远程登录1.1开放22端口firewall-cmd--zone=public--add-port=22/tcp--permanent1.2重启防火墙sudosystemctlrestartfirewalld.service(提示success表示成功) 2... 查看详情

lamp编译安装1

650)this.width=650;"src="https://s4.51cto.com/wyfs02/M00/8C/CC/wKioL1h4o0aQgM_GAAP_QuXLPWc712.jpg"title="LAMP编译安装1.jpg"alt="wKiom1h4oGbwtqpHAAQHoqOfbzE513.jpg"/> 查看详情

lamp安装脚本(编译方式)

#!/bin/bash##**********************************************************#*filename:   lamp_install.sh  *#*discription:  lampinstall  *#*version:   centos6.7a 查看详情

lamp环境编译安装

MySQL编译安装#安装编译代码需要的包yum-yinstallmakegcc-c++cmakebison-devel  ncurses-devel#mysql安装wgethttp://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.32.tar.gztar-zxvfmysql-5.6.32.tar.gzcdmysql-5.6.3 查看详情

linux软件管理之------编译安装nginx服务器并手动编写自动化运行脚本

  红帽系列的 linux软件管理分为三类:1.rpm安装软件。2.yum安装软件。3.源码包编译安装。前面两种会在相关专题给出详细讲解。源码包的编译安装是非常关键的,我们知道linux的相关版本非常多,相关的编译器,解释器也... 查看详情