lnmp一键部署安装脚本

lnmp一键部署安装脚本,脚本里面更改了数据的登录密码,可以根据自己情况适当调整改脚本

#!/bin/bash

#build  lnmp
[ -d /root/old ] && rm -rf /root/old;mkdir /root/old || mkdir /root/old
mv /etc/yum.repos.d/* /root/old
cp -r /root/old/* /etc/yum.repos.d/
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
sleep 10
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum clean all
yum repolist
sleep 10
#start
yum -y install openssl-devel gcc-c++ gcc make
echo "waiting install php..........................................................."
yum install -y php56w-fpm php56w-common php56w-mbstring php56w-mcrypt php56w-pdo php56w-pgsql php56w-mysqlnd php56w-gd php56w-bcmath php56w-xml php56w-ldap
sed -i 's/post_max_size = 8M/post_max_size = 16M/g' /etc/php.ini
sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php.ini
sed -i 's/max_input_time = 60/max_input_time = 300/g' /etc/php.ini
sed -i 's/listen.allowed_clients = 127.0.0.1/#listen.allowed_clients = 127.0.0.1/g' /etc/php-fpm.d/www.conf
systemctl enable php-fpm
systemctl start php-fpm
sleep 10
echo "waiting for nginx......................................................."
yum install -y nginx
nginx -t
nginx
sleep 10
echo "waiting for mysql5.6................................"
[ -d "/root/ruanjian" ]&& echo "cunzai" || mkdir /root/ruanjian
cd /root/ruanjian
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum repolist all | grep "mysql.*-community.*"
yum -y install mysql-community-server
systemctl enable mysqld
/bin/systemctl start mysqld.service
#mysql -uroot -p"" -e "set password=password('123456');"
mysqladmin -uroot -p password '123456'
sleep 10
echo "lnmp is success"

你可能感兴趣的:(脚本)