zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    快排原理讲解
    Kafka原理详解
    java中的基本数据类型转换
    centos7关闭防火墙
    安装Linux基本工具
    Kibana笔记
    虚拟机配置net模式
    2019-10-12,html+php+mysql简单留言板,作业
    2019-10-11:渗透测试,基础学习,php+mysql连接,笔记
    2019-10-10:渗透测试,基础学习,mysql语法基础,笔记
  • 原文地址:https://www.cnblogs.com/yuandaozhe/p/11251478.html
Copyright © 2011-2022 走看看