• 数据迁移



    useradd www
    echo "123456" | passwd --stdin www
    useradd mysql
    echo “123456” |passwd --stdin mysql

    yum install -y vsftpd httpd php php-mysql mariadb-server


    vim /etc/httpd/conf/httpd.conf

    ServerName 172.16.19.220:80 (这里需要需要修改ip)
    #DocumentRoot "/var/www/html" (这里需注释)


    vim /etc/httpd/conf.d/virtual_host.conf

    <VirtualHost *:80>
    ServerName www.uplooking.com
    DocumentRoot "/app/www"
    <Directory "/app/www">
    Options FollowSymLinks
    AllowOverride NOne
    Require all granted
    </Directory>
    ErrorLog "/logs/httpd/error.log"
    CustomLog "/logs/httpd/access.log" combined
    </VirtualHost>

    用 httpd -t 检测一下


    创建两个文件,这两个文件是检测httpd和php是否能正常运行
    vim /app/www/idenx.html (静态文件)
    vim /app/www/idenx.php (动态文件)



    vim /etc/my.cnf (此处编辑mysql的珠配置文件)

    datadir=/var/lib/mysql(默认地址)==> datadir=/app/data (改为 )
    skip_name_resolve=on
    innodb_file_per_table=on


    chown -R mysql.mysql /app/data (修改/app/data文件的属组属主)


    systemctl restart mariadb (重启mariadb,若是出现错误,可能是配置文件中的一些文件没有创建)


    mysql_secure_installation (mysql的基本配置)
    mysql -p123456 (登录mysql)
    show databases; (查看库)
    create database www; (创建库)
    grant all on www.* to wp@'172.16.19.%' identified by '123456';
    flush privileges;
    select user,host from mysql.user;

    备份mysql数据  mysqldump  -uroot  -h172.16.19.220  -p123456 -B  www  --lock-tables  --flush-logs  >  www.sql

    把www.sql文件导出来放到桌面    ,(下载xftp  (自己研究))

    • 检查PHP和MySQL是否安装成功检查代码 (详细介绍看LAMP架构集群进阶

    vim /app/www/html/php


    <?php
    $link=mysql_connect("172.16.19.220","wp","123456");
    if(!$link)
    echo "FAILD!";
    else
    echo "0k!可以连接 ";


    ?>


    systemctl restart vsftpd

    yum install -y lftp

    • WordPress应用源码上线
    1)解压后,将目录放在web站点目录下,并且改名wp-config-sample.php为wp-config.php
    把一些不用的文件删除

    2)在mysql数据库中先创建wp数据库,并且给yhy用户授权 这是WordPress特殊的地方,其他的程序不需要
    create database wpdb;
    grant all on wp.* to yhy@'192.168.%.%' identified by '123456';
    flush privileges;
    systemctl restart mariadb.service

    3)编辑wp-config.php,修改如下配置
    define('DB_NAME', 'wp');
    /** MySQL数据库用户名 */
    define('DB_USER', 'yhy');
    /** MySQL数据库密码 */
    define('DB_PASSWORD', '123456');
    /** MySQL主机 */
    define('DB_HOST', '192.168.10.3');
  • 相关阅读:
    Medication Reconciliation Overview
    The Info-Button Standard: Bring Meaningful Use To the Patient
    Configuring Time in Windows 7 and Win 200
    oracle补齐日期
    mysql-proxy
    Oracle:Authid Current_User的使用
    oracle的sqlldr常见问题
    hive的select重命名字段显示成中文
    python访问hive
    禁用SSL v2.0、SSL v3.0协议
  • 原文地址:https://www.cnblogs.com/liu1026/p/7588012.html
Copyright © 2020-2023  润新知