LoginSignup
9
8

More than 5 years have passed since last update.

AWS Amazon linuxにwordpressをインストール

Last updated at Posted at 2016-08-19

wordpressをインストールしたので記録

使用したバージョン

パッケージ バージョン
httpd Apache/2.4.23 (Amazon)
php 5.6.24
mysql 5.6.32
wordpress 4.6

wordpress install

wordpressユーザーを作成してホームディレクトリにwordpressを置きます。

必要なパッケージ

yum install -y httpd24 php56 mysql56-server
yum install -y php56-mcrypt php56-intl php56-mbstring php56-mysqlnd php56-opcache php56-devel

ユーザー作成

rootユーザーで作成します。

sudo su
useradd wordpress

wordpress インストール

wordpressユーザーでインストールします。

su wordpress
cd ~
wget https://ja.wordpress.org/wordpress-4.6-ja.zip
unzip wordpress-4.6-ja.zip

権限設定

rootユーザーで権限を変えます。(apacheが読み込めるように設定しています。)

exit
chmod 770 /home/wordpress
chgrp apache -R /home/wordpress
find /home/wordpress -type d -exec chmod 0770 {} \;
find /home/wordpress -type f -exec chmod 0660 {} \;

httpdの設定

root ユーザーで設定をします。

vi /etc/httpd/conf.d/wordpress.conf
wordpress.conf
ServerName [ドメインかIPを入力]
<VirtualHost *:80>
        Servername [ドメインかIPを入力]
     DocumentRoot /home/wordpress/wordpress

         <Directory "/home/wordpress/wordpress">
                Options FollowSymlinks
                AllowOverride All
                Require all granted
         </Directory>

        ErrorLog /var/log/httpd/wordpress-error_log
        CustomLog /var/log/httpd/wordpress-access_log common

</VirtualHost>

httpdの起動
/etc/init.d/httpd start

mysqlの設定

root ユーザーで設定をします。

例として
データベース:wordpress
ユーザー:wordpress
パスワード:wordpress
を作成します。

/etc/init.d/mysql start
mysql
create database wordpress CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON wordpress.* TO wordpress@localhost IDENTIFIED BY 'wordpress';
quit

webで表示する

URLにhttp://[ドメインかIP]/wp-admin/setup-config.phpと入れる
以下の画面が表示されるので、[さぁ始めましょう!]を選択
キャャ.PNG
データベース名やユーザー、パスワードが求められます
今回の例に合わせるとデータベース名、ユーザー名、パスワードすべてwordpressです。
(RDSを使用している場合はlocalhostのところにRDSのエンドポイントを入力。)

次に進むと以下の画像のように必要な情報が求められます。
キャプ.PNG
適当に入力しインストールして終了です。

もう使用しないwp-admin/setup-config.phpの権限をアパッチがアクセスできないように変えたほうがいいかも。
chmod 600 /home/wordpress/wordpress/wp-admin/setup-config.php

9
8
1

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
9
8