- 1. 概要
- 2. インストール
- 3. apache 定義ファイルの編集
- 4. mysql の設定
1. 概要
まずは、インストールと設定の準備から・・・。
2. インストール
/usr/ports/japanese/wordpress
をインストールします。
オリジナルの「WordPress」は、「/usr/ports/www/wordpress」にあり、それをインストールして日本語化することもできるのですが、少々面倒な部分もありますので、ここでは、最初から日本語版をインストールすることとします。
cd /usr/ports/japanese/wordpress
make config
オプションは、デフォルトのままにしておきます。
cd /usr/ports/japanese/wordpress
make NO_DIALOG=yes
make install
依存するものが、インストールされていなければ、そこそこ時間がかかります。
1~2 時間覚悟しておいた方がいいかと思います。
インストール時のメッセージを掲載しておきます。
===> Installing for ja-wordpress-ja-6.7.2
===> Checking if ja-wordpress-ja is already installed
===> Registering installation for ja-wordpress-ja-6.7.2
Installing ja-wordpress-ja-6.7.2...
Before the first use of WordPress, copy wp-config-sample.php to wp-config.php
in /usr/local/www/wordpress and modify it to fit your MySQL.
Maybe you need 'mysqladmin create wordpress' first.
3. apache 定義ファイルの編集
正常にインストールできていれば、「FreeBSD」の場合。
/usr/local/www/wordpress
というディレクトリが作成されているはずです。
「apache」の定義ファイルを作成してアクセスできるようにします。
定義ファイルを仮に「/usr/local/etc/apache24/Includes/wordpress.conf」として以下のように編集します。
vi /usr/local/etc/apache24/Includes/wordpress.conf
Alias /wordpress "/usr/local/www/wordpress/"
<Directory "/usr/local/www/wordpress/">
Options +ExecCGI -Indexes
AllowOverride All
Require all granted
</Directory>
これで、「apache」を再起動すれば。
http://ドメイン名/wordpress/
でサイトにアクセスできるようになります。
4. mysql の設定
「WordPress」は、「MySQL」のデータベースを使用しますので、「MySQL」に「WordPress」用のデータベースを作成します。
ここでは、データベースの諸元を下記として進めていきます。
| 項 目 | 値 | 備考 |
| データベース名 | hogehoge | |
| データベースユーザ | hogehogeUser | |
| ユーザパスワード | hogehogePass | |
「root」ユーザ権限で。
$ mysql -u root -p
Enter password: ← パスワードを入力
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9914
Server version: 8.0.39 Source distribution
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database hogehoge;
Query OK, 1 row affected (0.03 sec)
mysql> CREATE USER 'hogehogeUser'@'localhost' IDENTIFIED BY 'hogehogePass';
Query OK, 0 rows affected (0.91 sec)
mysql> GRANT ALL PRIVILEGES ON hogehoge.* TO 'hogehogeUser'@'localhost';
Query OK, 0 rows affected (0.12 sec)
mysql> Bye ← [Ctrl-D] で抜けます
上記の形で、データベース、ユーザを作成します。
|