Wikiシステム MediaWiki をインストールします。
CentOS 7 標準の PHP 5.4 系は最新版の MediaWiki ではサポートされません。 よって、こちらを参考に PHP 7.3をインストールして、httpd で利用できるよう設定しておきます。
こちらを参考に MariaDB サーバーをインストールしておきます。
MediaWiki 用のデータベースを作成しておきます。
[root@localhost ~]# mysql -u root -p |
Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # 「mediawiki」データベース作成 ( 'password'の箇所は設定するパスワードを入力 ) |
MariaDB [(none)]> create database mediawiki; |
Query OK, 1 row affected (0.00 sec) |
MariaDB [(none)]> grant all privileges on mediawiki.* to mediawiki@'localhost' identified by 'password'; |
Query OK, 0 rows affected (0.00 sec) |
MariaDB [(none)]> flush privileges; |
Query OK, 0 rows affected (0.00 sec) |
MariaDB [(none)]> exit |
Bye |
( 最新版を確認してダウンロードしてください ⇒ https://www.mediawiki.org/wiki/Download/ja )
[root@localhost ~]# yum --enablerepo=remi-safe install php73-php-mysql php73-php-mbstring |
[root@localhost ~]# wget http://releases.wikimedia.org/mediawiki/1.27/mediawiki-1.27.1.tar.gz |
[root@localhost ~]# tar zxvf mediawiki-1.27.1.tar.gz |
[root@localhost ~]# mv mediawiki-1.27.1 /var/www/html/mediawiki |
[root@localhost ~]# chown -R apache. /var/www/html/mediawiki |
[root@localhost ~]# systemctl restart httpd |
SELinux を有効にしている場合は、対象ディレクトリに対してポリシーの許可設定が必要です。
[root@localhost ~]# chcon -R -t httpd_sys_rw_content_t /var/www/html/mediawiki |
[root@localhost ~]# semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/mediawiki |
任意のクライアントで Web ブラウザを起動し、「http://(サーバーのホスト名またはIPアドレス)/mediawiki/mw-config/」にアクセスして言語の設定をします。
画面を下までスクロールして「続行」ボタンをクリックし、続行します。
作成した MediaWiki 用データベースの情報を入力します。
ここはデフォルトのままで OK です。変更したい場合は変更ください。
Wiki 名や管理者アカウントの設定をします。
続行します。
続行します。
インストール完了です。この画面で「LocalSettings.php」がダウンロードできます。 それをサーバー上の「mediawiki」ディレクトリ直下に配置して全て完了です。
メイン画面です。ここから WikiPedia のような Wiki サイトを作成することができます。