LNMP一键安装脚本

#!/bin/bash

# INSTALL Nginx+PHP5

yum -y install libxml2* libtool* pcre* gettext*

DIR=`pwd`

mkdir ${DIR}/Tmp

#VERSION=`cat /etc/redhat-release | awk ‘{print $7}‘ | cut -c1`

VERSION=`lsb_release -r |awk ‘{print $2}‘ |cut -c1`

cp -r /usr/local/src/install_nginx/mysql_x86_64 /usr/local/mysql

Jpegsrc_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^Jpegsrc*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/jpeg-6b

if [ $VERSION -eq 6 ];then

\cp /usr/share/libtool/config/config.* .

else

\cp /usr/share/libtool/config.* .

fi

mkdir -p /usr/local/man/man1

./configure --prefix=/usr/local --enable-static --enable-shared

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Libpng_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^libpng*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

cp scripts/makefile.linux Makefile

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Freetype_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^freetype*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Libxml_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^libxml*`

tar jxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Libiconv_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^libiconv*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Libmcrypt_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^libmcrypt*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

if [ $VERSION != 6 ];then

rm -rf /usr/lib/libmcrypt.so.4

fi

ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4

/sbin/ldconfig

cd libltdl/

./configure --enable-ltdl-install

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Mhash_Function(){

cd ${DIR}

File=`ls -1 |grep -i ^mhash*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

if [$VERSION != 6 ];then

rm -rf /usr/lib/libmhash.so.2

fi

ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2

}

Mcrypt_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^mcrypt*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

/sbin/ldconfig

./configure

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

GD_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^gd*`

tar jxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure --prefix=/usr/local --with-jpeg=/usr/local --with-png=/usr/local

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Php_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^php.*tar.gz`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

gzip -cd ${DIR}/php-5.2.17-fpm-0.5.14.diff.gz | patch -d ${DIR}/Tmp/${File%.tar.*} -p1

‘./configure‘  ‘--with-config-file-path=/usr/local/webserver/php/etc‘ ‘--prefix=/usr/local/webserver/php‘ ‘--with-freetype-dir=/usr/local‘ ‘--with-mysql=/usr/local/mysql‘ ‘--with-zlib‘ ‘--enable-shared‘ ‘--with-curl‘ ‘--with-gd‘ ‘--with-jpeg-dir=/usr/local‘ ‘--with-png-dir=/usr/local‘ ‘--enable-mbstring=all‘ ‘--enable-mbregex‘ ‘--enable-gd-native-ttf‘ ‘--enable-fastcgi‘ ‘--enable-fpm‘ ‘--with-libxml-dir=/usr --enable-xml‘ ‘--enable-force-cgi-redirect‘ ‘--with-openssl‘ ‘--enable-sockets‘ ‘--disable-rpath‘ ‘--enable-discard-path‘ ‘--enable-safe-mode‘ ‘--enable-bcmath‘ ‘--enable-shmop‘ ‘--enable-sysvsem‘ ‘--enable-inline-optimization‘ ‘--enable-pcntl‘ ‘--with-iconv‘ ‘--with-mcrypt‘ ‘--with-mhash‘

make ZEND_EXTRA_LIBS=‘-liconv‘

make install

cp php.ini-dist /usr/local/webserver/php/etc/php.ini

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Memcache_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^memcache*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tgz*}

/usr/local/webserver/php/bin/phpize

./configure --with-php-config=/usr/local/webserver/php/bin/php-config

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

EAccelerator_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^eaccelerator*`

tar jxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

/usr/local/webserver/php/bin/phpize

./configure --enable-eaccelerator=shared --with-php-config=/usr/local/webserver/php/bin/php-config

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Pcre_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^pcre*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Nginx_Function(){

cd ${DIR}

File=`ls -1 | grep -i ^nginx*`

tar zxf ${File} -C ${DIR}/Tmp/

cd Tmp/${File%.tar*}

./configure  --user=nobody --group=nobody --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module

make && make install

if [ $? != 0 ];then

echo "${File}  ERROR !!!!!!!!!!!"

exit 10

fi

}

Jpegsrc_Function

Libpng_Function

Freetype_Function

#Libxml_Function

Libiconv_Function

Libmcrypt_Function

GD_Function

Mhash_Function

Mcrypt_Function

Php_Function

Memcache_Function

EAccelerator_Function

Pcre_Function

#Nginx_Function

cd /usr/local/src/install_nginx

#yes | cp conf/fcgi.conf /usr/local/webserver/nginx/conf/

#yes | cp conf/nginx.conf /usr/local/webserver/nginx/conf/

yes | cp conf/php-fpm.conf /usr/local/webserver/php/etc/

yes | cp conf/php.ini /usr/local/webserver/php/etc/

时间: 11-03

LNMP一键安装脚本的相关文章

lnmp一键安装脚本(含有np与mysql分离)

基于lanny一键安装包:(含lnmp所需软件及配置文件) 安装nginx: wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo yum clean all yum makecache yum install pcre p

centos6—lnmp一键安装脚本

把需要的脚本下载放到/root 目录下,然后运行本脚本即可自动化安装lnmp环境: #!/bin/bash #lnmp环境搭建自动化脚本  #date 2017/8/22 #author vaedit yum install epel-release -y yum -y install pcre pcre-devel openssl openssl-devel gcc gcc-c++ cmake ncurses-devel libtool zlib-devel libxml2-devel lib

LAMP or LNMP 一键安装脚本

#!/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,i686 or x86_64. ar=`arc

Lnmp一键部署脚本(包含模块安装,php7,openresty+缓存等)

Lnmp一键部署脚本 个人gitpage:https://owelinux.github.io/ #!/bin/bash ##DATE:2016-7-25 ##USER:owelinux ###install wallet #######install mysql################################################## yum -y install cmake ncurses-devel bison libaio make gcc gcc-c++ mk

shell-网上lnmp一键安装讲解

shell-网上lnmp一键安装讲解 #!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin       #设置系统环境变量本文出处:www.ksharpdabu.info export PATH     # # Check if user is root if [ $(id -u) != "0" ]; then                           #通过判断

ss-panel(ss-R)前后端一键安装脚本(转)

ss-panel(ss-R)前后端一键安装脚本 前几天分享了ss-panel前后端的搭建教程,现在为了练习自己的技术,写了个一键安装脚本! 请注意,本脚本仅仅适用于centos7.* 最新更新:2016/11/5 本脚本包括以下功能: 使用rpm方式搭建LNMP,比市场上的LNMP一键安装包更高效,同时减轻了CPU负担,安装的时间段而且不会安装太多依赖 安装是依赖最新的SS-panel的源码,以及最新ss-rm的代码 本脚本集成了对LNMP以及ss的前端和后端,但是部分依然需要手动操作,请看详细

CentOS 6、7下IPSEC/L2TP VPN一键安装脚本(openswan+xl2tpd)

CentOS 6.7下IPSEC/L2TP VPN一键安装脚本(openswan+xl2tpd) 概念性的东西这里不再赘述,网上有太多,一键安装脚本也有很多,但是很多不能用,能用的也仅仅只是在CentOS6下使用,CentOS7基本没看到这些安装脚本.于是花了一些时间来折腾测试,写这个脚本方便以后VPN的一键安装搭建.其中用的开源软件包是openswan和xl2tpd,,中间碰到过很多很多问题,如openswan和xl2tpd之间的兼容性问题. 请容许我这样做,脚本依赖<OneinStack>

CentOS 6、7下pptp vpn一键安装脚本

之前有折腾过<CentOS 6.7下IPSEC/L2TP VPN一键安装脚本>,不稳定.不支持IOS,因此换成pptp,并已经添加到<lnmp一键安装包>.这个脚本可以单独使用,直接复制或下载执行即可,不用依赖安装包的其它脚本. CentOS 6.7下pptp vpn一键安装脚本,安装如下: wget http://mirrors.linuxeye.com/scripts/vpn_centos.sh chmod +x ./vpn_centos.sh ./vpn_centos.sh

Ubuntu Or Debian L2TP VPN 一键安装脚本

#!/bin/bash if [ $(id -u) != "0" ]; then printf "Error: You must be root to run this tool!\n" exit 1 fi clear printf " #################################################### # # # This is a Shell-Based tool of l2tp installation # #