Manual:Installing MediaWiki/ja
MediaWiki installs itself using an interactive, web-based installation script. Before you can run this script, you need to do a couple of things: see prerequisites or short installation guide for experts.
MediaWiki can be difficult to install for the average computer user who does not have experience with Apache, PHP and MySQL. Most users who wish to use wiki software may benefit from using a free MediaWiki host or via a software appliance.
注: トラブルシューティング情報に関しては、インストールエラーをご覧ください。
Contents
MediaWiki ソフトウェアのダウンロード[edit | edit source]
MediaWiki のリリース版は、公式ダウンロード ページでダウンロードできます。generally, if you're using a production environment, you want to be running the stable release.
開発者は、開発中の最新のコードを Git からダウンロードしてローカルにリポジトリを構築できます。
次のコマンドを使用して最新の*nix対応版MediaWiki 1.23.4をダウンロードすることができます。
wget http://releases.wikimedia.org/mediawiki/1.23/mediawiki-1.23.4.tar.gz
wgetの代わりにこのコマンドも使用できます。 cURL:
curl -O http://releases.wikimedia.org/mediawiki/1.23/mediawiki-1.23.4.tar.gz
ダウンロードされたファイルは .tar.gz
形式です。使う前に解凍してください。これはローカル、またはFTP経由でアップロードされたあなたのサーバーのディレクトリで実行できます。解凍によく使われるソフトは以下の様なものがあります。 7-Zip (無料), WinZip, WinRAR or IZArc (無料)
Linux及びMac OS X上ではこのコマンドを使用してファイルを解凍することができます。
tar xvzf mediawiki-*.tar.gz
注:もしあなたがrootとしてファイルを解凍した場合は chown, コマンドを用いて所有者をuser#1000に変更する必要があります。これはあなたが望むものではないかもしれません。
ファイルをアップロードする[edit | edit source]
まだファイルをWebサーバーにアップロードしていない場合はここでアップロードしてください。
「ファイル名を小文字にする」オプションが無効になっていることを確認して下さい。
ファイルをあなたのWebサーバーのディレクトリにアップロードしてください
- directly copying the unzipped folder or
- 次の様なFTPソフトを使って FileZilla (Open Source Software, Windows, OSX and Linux) or Cyberduck (OSX).
If you installed Apache, the correct directory is specified in your httpd.conf
file (it's typically <apache-folder>/htdocs
).
If you are using a Linux or Unix server you can instead copy the files to any directory on your server and then make a symbolic link to that folder from your web server's web directory.
Rename the uploaded folder to whatever you would like to have in the URL. If your web server is running as http://localhost
for example, renaming to /w/
directory would mean you would access your wiki at http://localhost/w/index.php
. Do not use /wiki/
if you want to use it as a Short URL. (And don't set up short URLs until you have run the installation script.)
This (renamed) folder will now be referred as <MediaWiki-folder>
.
データベースの作成[edit | edit source]
データベースのルートパスワードを知っている場合、MediaWikiインストールスクリプトは新しいデータベースを作成します。この場合、下記のインストールスクリプトの実行を省略することが出来ます。ルートパスワードを知らない場合、例えば、ホストサーバー上にいる場合、今、新しいデータベースを作成しなければなりません。現在、wikiの実際のコンテンツを保存するためにMySQLまたはPostgreSQLを使用しなければなりません。
SQLite[edit | edit source]
MediaWiki supports SQLite since version 1.13, however at least 1.16 is highly recommended. SQLite is a stand-alone database library that stores the database contents in a single file. If PHP has the pdo-sqlite module, no further setup is required.
On the installation page, you will need to choose a database name (which can be anything) and the SQLite database directory. For the database directory, the installer will attempt to use a subdirectory outside of the document root and create it if needed. If this directory is not safe (for example, web-readable), change it manually to avoid making it accessible to everyone on the web.
MySQL[edit | edit source]
- MediaWikiをインストールする前にMySQLデータベースとユーザーを作成する必要があります。多くの共有サーバーで利用できるPhpMyAdminといった様々なコントロールパネルを使ってこの作業を行うことが出来ます。もしくはSSHを使用してホストにログインをしてMySQLプロンプトにコマンドを入力します。該当するドキュメントをご覧ください。他の方法では、あなたのアカウントを作るようにホストプロバイダーに連絡をしてください。
Unix/Linux でのインストール[edit | edit source]
-
- Download and install MySQL - MediaWiki supports version 5.0.2 or later. MySQL typically installs in /usr/local/mysql. (If you use your Linux distribution's package manager to install MySQL, the following commands may be in some other directory; try typing them without the path prefix /usr/local/mysql/bin/ .)
- Check and see if the database server is running; for example, run /usr/local/mysql/bin/mysqladmin status. If it is not, run mysqld_safe to start it: sudo /usr/local/mysql/bin/mysqld_safe &.
- Another way to initially start the MySQL server is to run the configure script available at the root of the installation. It creates the initial tables and automatically starts the mysql daemon
- Set a password for the "root" account on your database server. /usr/local/mysql/bin/mysqladmin -u root password yourpassword
- Run the MySQL command-line client: /usr/local/mysql/bin/mysql -u root -p
- This will prompt for the "root" database password you just set, then connect to the MySQL server. Now, continue with the SQL commands below.
Windows でのインストール[edit | edit source]
-
- Download MySQL msi (mysql-5.5.22-winx64.msi for example)
- Run msi file and accept all defaults. When creating the root account, use a password that you will remember.
- Run Start->All Programs->MySQL->MySQL Server->MySQL Command Line Client
- Enter the root password you just created
- Now continue with the instructions below
Installation continued[edit | edit source]
create database wikidb; grant index, create, select, insert, update, delete, alter, lock tables on wikidb.* to 'wikiuser'@'localhost' identified by 'password';
データベースサーバーとウェブサーバーが異なる場合、適切なウェブサーバーのホスト名を入力します -- 例えば、mediawiki.example.comであるなら -- 次の通りです:
grant index, create, select, insert, update, delete, alter, lock tables on wikidb.* to 'wikiuser'@'mediawiki.example.com' identified by 'password';
PostgreSQL[edit | edit source]
PostgreSQLを使用する場合、データベースを持ちあなたのためにユーザーを作成する必要があるもしくはシンプルにPostgesの名前と"superuser"の特権をコンフィギュレーションフォームに入力します。よくあるデータベースユーザー名はpostgresです。
MediaWikiが使用するデータベースにplpgsqlとtsearch2の両方がインストールされていることが必要です。インストーラースクリプトはpspgsqlをインストールしようとしますが、tsearch2はあなた自身でインストールする必要があることがあります。(tsearch2はwikiのテキストを検索するために使用します。)よくあるセットアップの方法です。Unixライクなシステムで、plpgsqlとtsearch2が既にインストールされていることを前提とします。この例では、wikidbという名前のデータベースを作成し、wikiuserという名前のユーザーが所有します。コマンドラインから、postgreSQLユーザーとして次のステップを実行します。
createuser -S -D -R -P -E wikiuser (then enter the password) createdb -O wikiuser wikidb
or as superuser (default postgres) execute the following commands at the database prompt:
CREATE USER wikiuser WITH NOCREATEDB NOCREATEROLE NOSUPERUSER ENCRYPTED PASSWORD 'password'; CREATE DATABASE wikidb WITH OWNER wikiuser;
注: If you're using PostgreSQL 9.0 and above, you don't need to add pl/pgsql as it is installed by default.
createlang plpgsql wikidb
tsearch2 の追加[edit | edit source]
注: If you're using PostgreSQL 8.3.x and above, you don't need to perform the following steps to install tsearch2 since it has been integrated into the core.
tsearch2をデータベースに追加することは単純なステップではありませんが、できれば、tsearch2モジュールをインストールしたパッケージング処理が何であれ既に行われることになります。どの場合でも、tsearch2が見つからない場合はすぐにインストーラーがそのことを教えてくれます。
上記のステップはすべて必要ではありません。スーパーユーザー名とパスワードを入力した場合、インストーラーが代わりにいくつかの作業を試してくれるからです。
Windowsでtsearch2をwikidbデータベースにインストールするためには、次のステップを行います:
- tsearch2.sqlを見つけ(おそらく.\PostgreSQL\8.x\share\contribの元にあります)、postgresql\8.x\binディレクトリにコピーします;
- postgresql\8.x\binディレクトリでコマンドプロンプトから、"psql wikidb < tsearch2.sql -U wikiuser"を入力します;
- wikiuserのためのパスワードを入力するように促されます;
これでお終いです!
ポイント(2)はWindows上のみで動作するようです。debian linux 4.0 (etch)上では、言語 cで許可されます。ですのでコマンドで呼び出さなければなりません:
su - postgres -c psql wikidb < tsearch2.sql
Granting select rights[edit | edit source]
Afterwards you must grant select rights to wikiuser(s) to the tsearch tables and insert the correct locale.
PostgreSQL 8.2 以前[edit | edit source]
su - postgres psql -d wikidb -c "grant select on pg_ts_cfg to wikiuser;" psql -d wikidb -c "grant select on pg_ts_cfgmap to wikiuser;" psql -d wikidb -c "grant select on pg_ts_dict to wikiuser;" psql -d wikidb -c "grant select on pg_ts_parser to wikiuser;" psql -d wikidb -c "update pg_ts_cfg set locale = current_setting('lc_collate') where ts_name = 'default' and prs_name='default';"
上記の文を実行するときに"ERROR: relation "pg_ts_cfg" does not exist"のようなエラーを取得する場合、tsearch2をwikidbデータベースに再びインストールしてみるか、代わりにこれらの2つの異なるステップを使用してください(そしてgrant文も再度試してください):
1) su - postgres 2) psql wikidb -f tsearch2.sql
PostgreSQL 8.3 以降[edit | edit source]
su - postgres psql -d wikidb -c "grant select on pg_ts_config to wikiuser;" psql -d wikidb -c "grant select on pg_ts_config_map to wikiuser;" psql -d wikidb -c "grant select on pg_ts_dict to wikiuser;" psql -d wikidb -c "grant select on pg_ts_parser to wikiuser;"
インストール スクリプトの実行[edit | edit source]
Once all of the above steps are complete, you can complete the installation through a web browser by going to the index.php URI in your browser -- check the instructions mentioned in Special:MyLanguage/Manual:Config script.
If needed, you can run the command-line installer or CLI: php maintenance/install.php
.
注:MediaWiki 1.16 and earlier needed to be able to write to the
<MediaWiki-folder>/config
directory when it ran its installation script. This is no longer required.
最新の状態に保つ![edit | edit source]
Once installed, make sure you stay up to date with releases, and keep your server secure!
インストール補助[edit | edit source]
- FAQ: FAQ#Installation and configuration
- mediawiki-l (Mailing List) is the high-traffic mailing list to ask for support
関連項目[edit | edit source]
- Manual:Page customizations lists wiki pages that MediaWiki messages link to, you need to create these pages or edit the messages.
- Manual:Configuring MediaWiki for links to more advanced configuration.
- Manual:Short URL for having more user-friendly URL to article pages.
- Manual:Wiki family to setup multiple instances of MediaWiki with single set of MediaWiki files.
and
言語: | English • català • dansk • Deutsch • español • français • Bahasa Indonesia • italiano • 日本語 • 한국어 • português do Brasil • русский • 粵語 • 中文 • 中文(台灣) |
---|