This commit is contained in:
岳松
2016-08-15 19:25:01 +08:00
parent 3ac858aef8
commit 5425be46d7

16
lemp.sh
View File

@@ -10,14 +10,16 @@ if [ -n "`grep 'Aliyun Linux release' /etc/issue`" -o -e /etc/redhat-release ];t
[ -n "`grep ' 6\.' /etc/redhat-release`" -o -n "`grep 'Aliyun Linux release6 15' /etc/issue`" ] && CentOS_RHEL_version=6
fi
if ["$OS" == 'CentOS'] || ["$CentOS_RHEL_version" != 6] || ["$CentOS_RHEL_version" != 7];then
if [ "$OS" != 'CentOS' ] || [ "$CentOS_RHEL_version" != '6' -a "$CentOS_RHEL_version" != '7' ];then
echo "${CFAILURE}Error: This script only support CentOS 6 & CentOS 7${CEND}";
exit 1;
kill -9 $$
fi
if [ `getconf WORD_BIT` == 32 ] && [ `getconf LONG_BIT` == 64 ];then
BIT=64
else
echo "${CFAILURE}Error: This script only support 64 bit CentOS${CEND}";
exit 1;
kill -9 $$
fi
# Init
@@ -27,19 +29,19 @@ sudo yum -y install vim wget epel-release unzip
# Install the Required Repositories
echo "Installing the Required Repositories..."
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-${CentOS_RHEL_version}.rpm
echo "[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
gpgcheck=0
enabled=1" >> /etc/yum.repos.d/nginx.repo
enabled=1" > /etc/yum.repos.d/nginx.repo
echo "[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos\$releasever-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1" >> /etc/yum.repos.d/mariadb.repo
gpgcheck=1" > /etc/yum.repos.d/mariadb.repo
# Install MariaDB
echo "Installing MariaDB..."
@@ -86,7 +88,7 @@ sudo service nginx restart
# Set Up Autostart
echo "Setting Autostart..."
if ["$CentOS_RHEL_version" == 6];then
if [ "$CentOS_RHEL_version" == 6 ];then
sudo chkconfig --levels 235 mysql on
sudo chkconfig --levels 235 nginx on
sudo chkconfig --levels 235 php-fpm on