CentOS7 + php7.2 + nginx + MariaDB + wordpressインストール

OSはCentOS 7.5で、minimalインストールの状態からphp7.2 + nginx + php-fpm環境にwordpressをインストールした時の手順となります。

ちなみサーバやドメインは下記で用意しました。

リポジトリ追加

今回の手順では「php7.2」「nginx」などCentSO7の標準リポジトリに無いパッケージを使用するので、「epel」「remi」「nginx」の外部リポジトリを使用できるように設定する必要があります。

  • epelリポジトリ remiリポジトリインストールに必要
  • remiリポジトリ php7.2とphp-fpmのインストールに必要
  • nginxリポジトリ nginxのインストールに必要

epelリポジトリの追加

epelリポジトリのインストール

# yum -y install epel-release

インストールするアプリがCentOS標準のリポジトリのアプリと混合しないように、「--enablerepo」で指定しなければ「epel」リポジトリを使用出来ない設定にしておきます。

# vi /etc/yum.repos.d/epel.repo

設定内容

下記項目の「enabled=1」部分を「enabled=0」に変更します。

  • [epel]
  • [epel-debuginfo]
  • [epel-source]

remiリポジトリの追加

remiリポジトリを「rpm」コマンドを使用してインストールします。

# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

これで「php 7.2」をインストールするために必要なリポジトリの設定ファイル「remi-php72.repo」が「/etc/yum.repos.d」ディレクトリに作成されます。

「remi」リポジトリは、初期設定で「enable=0」に設定されていて「--enablerepo」で指定しなければ「remi」リポジトリ各種を使用出来ない設定になっているはずですが、念のために「remi-php72.repo」の内容を確認しておいてください。

リポジトリの追加方法については、こちらのページで詳しく説明しています。

nginxリポジトリ追加

「nginx」のリポジトリは、公式サイトのドキュメントを参考にして自分で新規にリポジトリファイル「/etc/yum.repos.d/nginx.repo」を作成する形になります。

http://nginx.org/en/linux_packages.html#mainline

# vi /etc/yum.repos.d/nginx.repo

設定内容

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=0

ポート開放 http(80) https(443)

初期状態では「firewalld」(ファイアウォール)では「http(80)」と「https(443)」のポートは開放されていませんので、「firewall-cmd」コマンドでポートの開放を行っていきます。

# firewall-cmd --permanent --add-service=http
# firewall-cmd --permanent --add-service=https
# firewall-cmd --reload

ポートが開放状況は「firewall-cmd --list-all」コマンドで確認できます。

「services:」の部分に「http」「https」が表示されていれば問題ありません。

# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  sources: 
  services: dhcpv6-client http https ssh
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

nginx

nginxインストール

「nginx」リポジトリを使用して、「nginx」をインストールしてます。

# yum --enablerepo=nginx install nginx

wordpressインストール用ディレクトリ作成

「nginx」のインストールが完了しましたら、次に「wordpress」をインストールするためのディレクトリを作成します。

今回は、「/usr/share/nginx/blog」というディレクトリを作成し、そこに「wordpress」をダウンロードしインストールしていきます。

# mkdir -p /usr/share/nginx/blog
# chown nginx:nginx /usr/share/nginx/blog/

wordpressダウンロード

「wordpress」のインストール用に作成したディレクトリに移動し、「curl」コマンドを使用して最新版の「wordpress」をダウンロードしてきます。

# cd /usr/share/nginx/blog
# curl -O https://ja.wordpress.org/latest-ja.tar.gz

ダウンロードしてきたファイルを解凍すると、「wordpress」というフォルダが出てくるので、所有者とグループを「nginx」に設定します。

# tar xzfv latest-ja.tar.gz
# chown -R nginx:nginx wordpress

フォルダ名変更

1つのサーバに複数の「wordpress」を設置する場合に備えて、解凍したフォルダがのサイトのデータなのか、あとで判別しやすいようにフォルダ名を変更しておきます。(複数設置しない場合はそのままでも構いません)

今回はフォルダの名前を「servermemo」としました。

# mv wordpress servermemo

nginx設定

「wordpress」を公開するための設定ファイルを、「/etc/nginx/conf.d」ディレクトリ内に作成していきます。

# cd /etc/nginx/conf.d
# vi servermemo.conf

※ファイル名は適宜分かりやすい名前(ドメイン名.conf)といった具合で作成してください。

ファイル内容

「server_name」部分はwebサーバのFQDNを設定し、「root」部分には先ほどダウンロードして解凍をした「wordpress」ディレクトリのフルパスをこのサイトのドキュメントルートとして設定してください。

server {
  listen 80;
  server_name www.server-memo.net;
  root /usr/share/nginx/blog/servermemo;
  index index.php;

  charset utf-8;

# wordpress パーマネントリンク設定
  try_files $uri $uri/ /index.php?q=$uri&$args;

# wp-config.phpへのアクセス拒否設定
  location ~* /wp-config.php {
    deny all;
  }

# php-fpm用設定
  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    include fastcgi_params;
  }
}

nginx起動

念のため、「nginx -t」コマンドで設定ファイルの文法をチェックしてから、nginxを起動させていきます。

設定確認

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

nginx起動

# systemctl start nginx

nginx自動起動設定

最後に「nginx」の自動起動設定を行います。

# systemctl enable nginx

SSL証明書取得(Let's Encrypt)

今どきはhttpsでサイトを作成するのが推奨されるので、今回は無料でSSL証明書を取得できる「Let's Encrypt」を使用して証明書を取得していきます。

詳しい証明書取得の手順はこちらのページにまとめてありますので確認おねがいします。

このページでは簡単に手順を記述しておきます。

certbotインストール

「Let's Encrypt」でSSL証明書を取得するために必要な「certbot」をインストールします。

# yum install --enablerepo=epel certbot

SSL証明書の取得

「certbot」を使用してSSL証明書を取得していきますが、その際に下記の情報が必要になります。

  • ドキュメントルート nginxに設定したroot
  • ホスト名 nginxに設定したserver_name
  • 連絡先メールアドレス SSL証明書に関する連絡先のメールアドレス
certbot certonly --webroot -w ドキュメントルート -d ホスト名 -m 連絡先メールアドレス --agree-tos

SSL証明書は下記ディレクトリに保存されます。

/etc/letsencrypt/live/ホスト名

実行例

下記の内容でSSL証明書を取得していきます。

  • ドキュメントルート /usr/share/nginx/blog/servermemo/
  • ホスト名 www.server-memo.net
  • 連絡先メールアドレス tamohiko@server-memo.net
# certbot certonly --webroot -w /usr/share/nginx/blog/servermemo/ -d www.server-memo.net -m tamohiko@server-memo.net --agree-tos

SSL証明書は下記ディレクトリに保存されます。

/etc/letsencrypt/live/www.server-memo.net

nginx(SSL設定追加)

http用の設定に「return 301 https://$host$request_uri;」を追加と、https用の設定を追加します。

# cd /etc/nginx/conf.d
# cp -p servermemo.conf servermemo.conf_yyyymmdd
# vi servermemo.conf
server {
  listen 80;
  server_name www.server-memo.net;
 return 301 https://$host$request_uri;
  root /usr/share/nginx/blog/servermemo;
  index index.php;

  charset utf-8;

# wordpress パーマネントリンク設定
  try_files $uri $uri/ /index.php?q=$uri&$args;

# wp-config.phpへのアクセス拒否設定
  location ~* /wp-config.php {
    deny all;
  }

# php-fpm用設定
  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    include fastcgi_params;
  }
}


server {
  listen 443 ssl;
  server_name www.server-memo.net;
  root /usr/share/nginx/blog/servermemo;
  index index.php;

  charset utf-8;

# SSL設定

  ssl_certificate /etc/letsencrypt/live/www.server-memo.net/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/www.server-memo.net/privkey.pem;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
  ssl_prefer_server_ciphers on;


# wordpress パーマネントリンク設定

  try_files $uri $uri/ /index.php?q=$uri&$args;

# wp-config.phpへのアクセス拒否設定

  location ~* /wp-config.php {
    deny all;
  }

# php-fpm用設定

  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    include fastcgi_params;
  }
}

nginx再起動

「nginx」を再起動して設定を反映させます。

# systemctl restart nginx

php7.2

php7.2はCentOS7のベースリポジトリには無いので、「remi-php72」リポジトリを使用してインストールしていきます。

php7.2インストール

「php7.2」の他にも必要な「php-fpm」も一緒にインストールしてしまいます。

# yum install --enablerepo=epel,remi-php72 php php-mbstring php-pear php-fpm php-mcrypt php-mysql

phpバージョン確認

インストールが完了しましたら、「php -v」でバージョンの確認を行ってください。

# php -v
PHP 7.2.11 (cli) (built: Oct 10 2018 10:00:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

php-fpm

「php-fpm」のインストールは「php7.2」のインストール時に一緒に行っています。

php-fpm設定

php-fpmの実行ユーザとグループは初期設定は「apache」となっているので、「nginx」と連携刺せるために「/etc/php-fpm.d/www.conf」を編集して、実行ユーザとグループを「nginx」に変更していきます。

www.conf設定

# cd /etc/php-fpm.d/
# cp -p www.conf www.conf_yyyymmdd
# vi www.conf
変更内容

実行ユーザ・グループをnginxに変更します。

変更前
user = apache
group = apache
変更後
user = nginx
group = nginx

php-fpm起動

実行ユーザとグループの変更が完了しましたら、「php-fpm」を起動します。

# systemctl start php-fpm

php-fpm自動起動設定

最後に自動起動の設定を行っておきます。

# systemctl enable php-fpm

MariaDB

CentOS7からはデータベースサーバが「MySQL」からMySQL互換の「MariaDB」に変更されていますので、こちらのインストールと設定を行っていきます。

MariaDBインストール

「yum」を使って「mariadb」と「mariadb-server」をインストールしていきます。

# yum install mariadb mariadb-server

MariaDB起動

MariaDBのインストールが完了しましたら、まずは起動させます。

# systemctl start mariadb

MariaDB自動設定

自動起動の設定も忘れずに行います。

# systemctl enable mariadb

MariaDB設定

「mysql_secure_installation」を実行し初期設定を行っていきます。

これを実行することで、「MariaDB」の「root」ユーザパスワード設定や、最初から設定されている「anonymous」ユーザや、「test」データベースなどを削除することが出来ます。

# mysql_secure_installation

設定項目

「mysql_secure_installation」で設定する項目です。

設定項目 設定内容
Enter current password for root (enter for none): MariaDBのrootユーザパスワード入力
インストール直後は何も設定されていないので「Enter」キーを押下する
Set root password? [Y/n] rootユーザのパスワードを設定するかどうかの確認
「y」を入力するかそのまま「Enter」キーを押下しパスワードを設定する
Remove anonymous users? [Y/n] 初期設定で作成されている「anonymous」ユーザを削除するかの確認
「y」を入力するかそのまま「Enter」キーを押下し削除する
Disallow root login remotely? [Y/n] MariaDBの「root」ユーザのリモートログインを禁止するかの確認
「y」を入力するかそのまま「Enter」キーを押下し禁止する
Remove test database and access to it? [Y/n] 初期設定で作成されている「test」データベースを削除するかの確認
「y」を入力するかそのまま「Enter」キーを押下し削除する
Reload privilege tables now? [Y/n] 今設定したユーザ設定をすぐに反映させるかの確認
「y」を入力するかそのまま「Enter」キーを押下し反映させる
「mysql_secure_installation」実行ログ
# mysql_secure_installation
/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): <-- 「Enter」キーを押下
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y <-- 「Enter」キーを押下
New password:           <---mariadbのrootユーザパスワード設定
Re-enter new password: <---mariadbのrootユーザパスワード設定
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y <-- 「y」または「Enter」キーを押下
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y <-- 「y」または「Enter」キーを押下

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y <-- 「y」または「Enter」キーを押下
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y  <-- 「y」または「Enter」キーを押下

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

文字コード設定

「/etc/my.cnf.d/server.cnf」で「wordpress」での文字化け対策に「MariaDB」で使用する文字コードを「utf-8」に設定します。

# cd /etc/my.cnf.d/
# cp -p server.cnf server.cnf_yyyymmdd
# vi server.cnf

設定内容

[mysqld]の部分に「character-set-server = utf8」を追加します。

[mysqld]
character-set-server = utf8  <--これを追加

MariaDB再起動

「MariaDB」を再起動し設定を反映させます。

# systemctl restart mariadb

wordpress用設定

「MariaDB」の初期設定が完了しましたら、今度は「wordpress」用のデータベースと、データベース管理ユーザを作成してきます。

今回は「phpMyAdmin」を使用しないで、SQLコマンドで作成していきます。

wordpress用データベース作成

「mysql_secure_installation」で設定したrootユーザで「MariaDB」に接続し、「CREATE DATABASE」コマンドで「wordpress」で使用するデータベースを作成します。

データベース作成書式
CREATE DATABASE データベース名;

下記は、「servermemo」というデータベースを作成した際のログとなります。

# mysql -u root -p
Enter password:

MariaDB [(none)]> CREATE DATABASE servermemo;
Query OK, 1 row affected (0.00 sec)

データベース管理ユーザ作成

次に「CREATE DATABASE」コマンドで作成したデータベースの、管理ユーザを作成します。

ユーザ作成コマンド書式
GRANT ALL PRIVILEGES ON DB名.* TO "管理ユーザ"@"localhost" IDENTIFIED BY "パスワード";

「FLUSH PRIVILEGES」コマンドで作成したユーザ情報を反映させます。

FLUSH PRIVILEGES;
作成ログ

作成した「servermemo」のデータベース管理ユーザとして、「blogadmin」というユーザ名と、パスワードを「dbpassword」として設定した際の作業ログです。(ユーザ名とパスワードはお好きなものを設定してください。)

管理ユーザの作成と設定反映が終わったら、「exit」と入力して作業を終わります。

MariaDB [(none)]> GRANT ALL PRIVILEGES ON servermemo.* TO "blogadmin"@"localhost" IDENTIFIED BY "dbpassword";
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

wordpress

最後に「wordperss」の設定を行います。

「wordpress」のデータは「nginx」の設定を行った際に、すでにダウンロードし解凍してあるので、そのフォルダに移動し作業を行います。

# cd /usr/share/nginx/blog/servermemo/

※移動するディレクトリは、適宜皆さんの環境に合わせて読み替えてください。

wp-config設定

フォルダの中に、「wordpress」の設定ファイルのサンプルである「wp-config-sample.php」があるので、これをコピーして「wp-config.php」を作成し、設定を行っていきます。

# cp -p wp-config-sample.php wp-config.php
# vi wp-config.php

設定内容

基本的に設定する項目は以下の通りとなります。

wordpress用データベース名
define('DB_NAME', 'database_name_here');
wordpress用に作成したデータベース名を入力する
データベースのユーザ名
define('DB_USER', 'username_here');
wordpress用に作成したデータベースの管理ユーザ名を入力する
データベース管理ユーザのパスワード
define('DB_PASSWORD', 'password_here');
wordpress用に作成したデータベース管理ユーザのパスワードを入力する
認証用のユニークキー
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
この値を変更することで、すべてのユーザを強制的に再ログインさせることができる
WordPress.orgの秘密鍵サービスで自動生成できるので、その結果を張り付けると良い
https://api.wordpress.org/secret-key/1.1/salt/
データベーステーブルの接頭辞
$table_prefix = 'wp_';
セキュリティ対策からデフォルトで設定されている「wp_」は変更したほうが良い
(本手順では変更しません)
wp-config.php設定例
<?php
/**
 * WordPress の基本設定
 *
 * このファイルは、インストール時に wp-config.php 作成ウィザードが利用します。
 * ウィザードを介さずにこのファイルを "wp-config.php" という名前でコピーして
 * 直接編集して値を入力してもかまいません。
 *
 * このファイルは、以下の設定を含みます。
 *
 * * MySQL 設定
 * * 秘密鍵
 * * データベーステーブル接頭辞
 * * ABSPATH
 *
 * @link http://wpdocs.sourceforge.jp/wp-config.php_%E3%81%AE%E7%B7%A8%E9%9B%86
 *
 * @package WordPress
 */

// 注意:
// Windows の "メモ帳" でこのファイルを編集しないでください !
// 問題なく使えるテキストエディタ
// (http://wpdocs.sourceforge.jp/Codex:%E8%AB%87%E8%A9%B1%E5%AE%A4 参照)
// を使用し、必ず UTF-8 の BOM なし (UTF-8N) で保存してください。

// ** MySQL 設定 - この情報はホスティング先から入手してください。 ** //
/** WordPress のためのデータベース名 */
define('DB_NAME', 'servermemo');

/** MySQL データベースのユーザー名 */
define('DB_USER', 'blogadmin');

/** MySQL データベースのパスワード */
define('DB_PASSWORD', 'dbpassword');

/** MySQL のホスト名 */
define('DB_HOST', 'localhost');

/** データベースのテーブルを作成する際のデータベースの文字セット */
define('DB_CHARSET', 'utf8');

/** データベースの照合順序 (ほとんどの場合変更する必要はありません) */
define('DB_COLLATE', '');

/**#@+
 * 認証用ユニークキー
 *
 * それぞれを異なるユニーク (一意) な文字列に変更してください。
 * {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org の秘密鍵サービス} で自動生成することもできます。
 * 後でいつでも変更して、既存のすべての cookie を無効にできます。これにより、すべてのユーザーを強制的に再ログインさせることになります。
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'L xv>t<S$6|a+OHwxq5`C8S.!2;z|P^T:&u^blaa|*uY5 a}x:Y>pWJVN!M$_wZ@');
define('SECURE_AUTH_KEY',  '4B!l[$Aiz zEGu(|=h6dYIDJR;eNeUgCaGoIy4i(.N@YO6A=P;^EIh|T!sCS9x1X');
define('LOGGED_IN_KEY',    ' z/1j8<l wE1eBZ(@+0`yr(BK0&&zPp8$3pyJn.-{W^qoj)Z+GG-0 r%^C65m8iY');
define('NONCE_KEY',        '*4-:5wjE9VL4JK=3GG/Dw:/VEl-vdnmHn[kJe{@X3AujV}rqXYjoIrVs-},|;_z|');
define('AUTH_SALT',        'Gh_YZrAIa<, +2P7jTVEisx4(@2#5pIw~X5+FiO^/q8=<4^%*wLkYBT#%l0b/y{g');
define('SECURE_AUTH_SALT', 'm$V1,lNWo<z] lAAm1mj6k*^P`;q^WVc76<I{E`WXlGgD8>Edo%d#qK9%8DxTzp[');
define('LOGGED_IN_SALT',   '-JS@,8_u0Qt}}+PZ1-v4]% [7(9|(2Mpw*{6)>BlQ+]|GOf8PwRxTJ)/P~R3u?Ve');
define('NONCE_SALT',       '+%*z+YyLHVQd!)Hg?^QL90|B?5c|Yx_dD~OwxZH!cg0OF[-NA4~rm) XPn+!{y^Y');
/**#@-*/

/**
 * WordPress データベーステーブルの接頭辞
 *
 * それぞれにユニーク (一意) な接頭辞を与えることで一つのデータベースに複数の WordPress を
 * インストールすることができます。半角英数字と下線のみを使用してください。
 */
$table_prefix  = 'wp_';

/**
 * 開発者へ: WordPress デバッグモード
 *
 * この値を true にすると、開発中に注意 (notice) を表示します。
 * テーマおよびプラグインの開発者には、その開発環境においてこの WP_DEBUG を使用することを強く推奨します。
 *
 * その他のデバッグに利用できる定数については Codex をご覧ください。
 *
 * @link http://wpdocs.osdn.jp/WordPress%E3%81%A7%E3%81%AE%E3%83%87%E3%83%90%E3%83%83%E3%82%B0
 */
define('WP_DEBUG', false);

/* 編集が必要なのはここまでです ! WordPress でブログをお楽しみください。 */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

blog初期設定

最後にインストールした「wordpress」にwebブラウザからアクセスして、blogのタイトルやユーザの作成など初期設定を行ってインストール作業は終了となります。

初期設定を行うためのURLは下記になります。

https://ホスト名/wp-admin/install.php

以上で、作業完了です。
お疲れ様でした!!

コメント

  1. exp より:

    大変参考になりました。ありがとうございました。

    気になったことですが私の環境(GCE)では、
    wordpressのインストール時に解凍したディレクトリを
    /usr/share/nginx/blog/ 以下に置くとプラグインを追加した際に
    「ファイルを移動できない」といった内容のエラーが表示されました
    /var/www/blog/ 以下に置いたところ解決しました。

    • tamohiko より:

      expさん
      コメントありがとうございます。

      GCE環境でインストール時についての情報ありがとうございました。
      パーミッションとかの関係なんでしょうかね?

      GCE環境にwordpressをインストールする際には参考にさせていただきますね。

タイトルとURLをコピーしました