centos6一键安装WordPress

#!/bin/bash
service iptables stop
setenforce 0
yum -y install httpd
service httpd restart

yum -y install mysql-server
service mysqld start
ss -ntl |awk -F" " '{print $4}'|grep ^:::3306$  &> /dev/null
[ $? -eq 0 ] && echo "MYSQL服务正常启动" || echo "MYSQL服务启动失败.."
echo "执行数据库安全策略.."
mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('123123') WHERE User='root';"
mysql -u root -e "DELETE FROM mysql.user WHERE User='';"
mysql -u root -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
mysql -u root -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';"
mysql -u root -e "FLUSH PRIVILEGES;"
echo "数据库安全策略执行完毕"
echo "创建wordpress数据库"
mysql -h127.0.0.1 -uroot -p123123 -e "CREATE DATABASE wpdb;"
mysql -h127.0.0.1 -uroot -p123123 -e "CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'centos';"
mysql -h127.0.0.1 -uroot -p123123 -e "GRANT ALL ON wpdb.* TO 'wpuser'@'localhost';"
echo "wordpress数据库创建完成"

yum -y install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php php-mysql

service iptables stop

echo "---------------"
echo "db is wpdb"
echo "user is wpuser"
echo "pass is centos"
echo "---------------"
curl -o wp.tar.gz https://wordpress.org/latest.tar.gz
tar -xf wp.tar.gz
rm -rf /var/www/html/*
mv wordpress/* /var/www/html

 

转载于:https://www.cnblogs.com/yuandaozhe/p/11251478.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值