LoginSignup
2
10

More than 5 years have passed since last update.

AWS(EC2+RDS)でWordpressサイトを構築する際にやることリスト

Last updated at Posted at 2017-08-30

以下の構成でWordpress環境を構築する際にやることを箇条書きでまとめました。(元ブログはこちら

<構成>
Webサーバ:EC2(nginx+php7)
DBサーバ:RDS(MySQL)

各作業の細かい手順は以下を参考にしてください。

1.EC2インスタンス作成・設定

  • インスタンス作成
  • セキュリティグループ設定(インバウンド)
    • HTTP(0.0.0.0/0)
    • HTTPS(0.0.0.0/0)
    • SSH(特定のIPのみ)
  • Elastic IP設定
  • SSHログイン確認(KEY作成&ローカル配置)

2.各種ソフトウェアインストール・設定

インストール

  • sudo yum update
  • sudo yum install -y nginx
  • sudo yum install -y mysql
  • sudo yum install -y php70
  • sudo yum install -y php70-mysqlnd php70-mbstring php70-mcrypt php70-pdo php70-xml php70-fpm

自動起動設定

  • sudo chkconfig nginx on
  • sudo chkconfig php-fpm on

設定変更&再起動

php-fpm
 user = nginx
 group = nginx
 listen.owner = nginx
 listen.group = nginx
 listen.mode = 0660
 listen = /var/run/php-fpm.sock
  • sudo /etc/init.d/php-fpm restart
nginx
  • sudo vim /etc/nginx/conf.d/default.conf(新規作成)
server {
  listen 80;
  server_name hostname;
  root /var/www/html;
  index index.php index.html index.htm;

  location / {
    try_files $uri $uri/ /index.php?$query_string;
  }

  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    include fastcgi_params;
  }
}
  • sudo /etc/init.d/nginx restart

3.RDSインスタンス作成・設定

  • DBのパラメータグループの作成(日本語対応)
    • character_set_client → utf8
    • character_set_connection → utf8
    • character_set_database → utf8
    • character_set_server → utf8
    • character_set_system → utf8
  • インスタンス作成
    • MySQL
    • パラメータグループ指定
  • セキュリティグループ設定(インバウンド)
    • MySQL/Aurora(EC2のセキュリティグループを指定)

4.Wordpressインストール・設定

2
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
10