- 1. 概要
- 2. データベース作成
- 3. サイト作成
1. 概要
下記の環境にインストールするものとします。
項目 | 内容 | 備考 |
プラットフォーム | 「VirtualBox 6.0.16」上の「FreeBSD 12.1 RELEASE」 | |
ウェブサーバ | apache24-2.4.41 | |
データベース | mysql57-server-5.7.29 | |
PHP | php72-7.2.26 | ※ |
※ 「PHP」に関しては、以下のモジュールが必要です
「php-extensions」で「CURL」のチェックは必須
「/usr/ports/databases/php72-pdo_mysql」のインストール必須
2. データベース作成
あらかじめ、「XOOPS」のデータベース・ユーザを作成しておきます。
まず、「MySQL」の文字コードを確認します。
「mysql」を実行して 「show variables like "chara%";」の結果、文字コードが下記のように表示されることを確認しておきましょう。
mysql> show variables like "chara%";
+--------------------------+----------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/share/mysql/charsets/ |
+--------------------------+----------------------------------+
8 rows in set (0.00 sec)
上記のように表示されない場合は、日本語メニューが文字化けしてしまいますので、「MySQL」の設定を変更します。
仮に以下のように作成するものとして
データベース名 | 「xoopsbase」 |
データベースユーザ | 「xoopsuser」 |
$ mysql -u root -p
Enter password: ← root パスワードを入力
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.22-log Source distribution
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
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 xoopsbase;
Query OK, 1 row affected (0.01 sec)
mysql> GRANT ALL PRIVILEGES ON xoopsbase.* to xoopsuser@localhost IDENTIFIED BY 'パスワード';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> quit
Bye
3. サイト作成
サイトのドキュメントルートを
/usr/local/www/xoops
として
https://ドメイン名/xoops/
でアクセスするものとします。
「root」ユーザで
mkdir -pv /usr/local/www/xoops
cat - << EOF >> /usr/local/etc/apache24/Includes/xoops.conf
Alias /xoops "/usr/local/www/xoops/"
<Directory "/usr/local/www/xoops/">
Options Indexes FollowSymlinks MultiViews ExecCGI
AllowOverride All
Require all granted
</Directory>
EOF
う~ん。「ExecCGI」は不要かなぁ・・・。
ウェブサーバを再起動しておきます。
service apache24 configtest
service apache24 restart
|