centos7 템플릿으로 on-premise에 WP 서버를 하나 만들고 이 WP 서버를 방금 생성한 RDS와 연동해 Wordpress를 구성하라.

  1. [root@rds ~]# yum -y install epel-release yum-utils

  2. [root@rds ~]# yum repolist

  3. [root@rds ~]# yum -y install <https://rpms.remirepo.net/enterprise/remi-release-7.rpm>

  4. [root@rds ~]# yum-config-manager --enable remi-php73

  5. [root@rds ~]# yum -y install httpd php php-mysql

  6. [root@rds ~]# yum -y install wget unzip

  7. [root@rds ~]# cd /var/www/html [root@rds html]# wget <https://wordpress.org/latest.zip>

  8. [root@rds html]# unzip latest.zip

  9. [root@rds html]# cd wordpress

  10. [root@rds wordpress]# mv * ./ [root@rds wordpress]# cd ..

  11. [root@rds html]# mv wp-config-sample.php wp-config.php [root@rds html]# vi wp-config.php

    ...
    // ** Database settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'wpDB' );
    
    /** Database username */
    define( 'DB_USER', 'root' );
    
    /** Database password */
    define( 'DB_PASSWORD', 'test1234' );
    
    /** Database hostname */
    define( 'DB_HOST', 'database-1.cb7gp3ktrwhs.ap-northeast-2.rds.amazonaws.com' );
    
    /** Database charset to use in creating database tables. */
    define( 'DB_CHARSET', 'utf8' );
    
    /** The database collate type. Don't change this if in doubt. */
    define( 'DB_COLLATE', '' );
    ...
    
  12. 인바운드 규칙 편집

    Untitled

    Untitled

  13. [root@rds html]# mysql -u root -ptest1234 -h database-1.cb7gp3ktrwhs.ap-northeast-2.rds.amazonaws.com

    [root@rds html]# mysql -u root -ptest1234 -h database-1.cb7gp3ktrwhs.ap-northeast-2.rds.amazonaws.com
    Welcome to the MariaDB monitor.  Commands end with ; or \\g.
    Your MariaDB connection id is 211
    Server version: 10.6.10-MariaDB managed by <https://aws.amazon.com/rds/>
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
    
    MariaDB [(none)]>
    
  14. 브라우저) 211.183.3.100

    Untitled

    캬~오졋따