Manual:Installing MediaWiki/ja

MediaWikiはウェブ画面から対話形式のスクリプトでインストールされます. スクリプトを実行する前にインストール要件を確認してください. また、簡易インストールガイドに要約があります.

Apache、PHP、MySQL/MariaDBについて経験の無い一般的なユーザにとって、インストール作業は難しく感じるかもしれません. 多くの場合、free MediaWiki hostかsoftware bundlesを利用すると良いでしょう.

トラブルシューティングにはManual:Errors and Symptoms#Installation Errorsを参照してください.

MediaWiki ソフトウェアのダウンロード
MediaWikiのリリースバージョンは公式ダウンロードページから入手できます. 本番環境を利用する場合、安定版を実行する必要があります.

最新の安定版MediaWikiを*nix環境にダウンロードするには以下のコマンドを実行します. wget https://releases.wikimedia.org/mediawiki//mediawiki-.tar.gz または、cURL:も利用できます.

curl -O https://releases.wikimedia.org/mediawiki//mediawiki-.tar.gz

ダウンロードしたファイルは 形式のため解凍が必要です. ローカルで（そしてFTP経由でアップロードして）行うことも、サーバー上で直接行うこともできます. Windowsの場合、一般的には7-Zip (free), WinZip, WinRAR or IZArc (free) で実施します. Linux、Mac OS Xの場合、以下で解凍できます.

tar xvzf mediawiki-*.tar.gz

root権限でtar解凍した場合、おそらくchown,で所有権を変更する必要があります. そうしない場合、ファイルはユーザー＃1000として所有されてしまいます.

開発者向け
一方、開発者の場合は download from Gitで、開発中の最新コードでローカルリポジトリを設定するべきです. その場合はComposerで依存性を手動で解決する必要があります.

アップロードされたファイル
If you have not already uploaded the files to your web server, do so now.

Make sure the "Change file names to lowercase" option for upload is disabled.

Upload the files to your web server's web directory either by:


 * 1) directly copying the unzipped folder or
 * 2) by using an FTP client such as FileZilla (Open Source Software, Windows, OSX and Linux) or Cyberduck (OSX).

If you installed Apache, the correct directory is specified in your  file (it's typically  ). Note: This changes in Ubuntu 14.04 with Apache 2.4.7 where the primary config file for Apache server settings and directories is.

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  for example, renaming to   directory would mean you would access your wiki at. Do not use  if you want to use it as a Short URL. (And don't set up short URLs until you have run the installation script.)

Note that in certain cases, like when a local repository is set-up using Git, on browsing to  the Linux server might show the "500 Internal server Error". This is possibly a permissions error which can be resolved on changing the file and directory permissions by running the following command in SSH after changing directory to "w":

This (renamed) folder will now be referred as.

データベースの作成
If you already have a database server and know the root password for it, the MediaWiki installation script can create a new database for you. If this is the case, you can skip to the Run the installation script section below. If you don't know the root password, for example if you are on a hosted server, you will have to create a new database now. Currently, you must use SQLite, MariaDB/MySQL or PostgreSQL to store the actual contents of your wiki.

SQLite
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.

MariaDB/MySQL
MediaWiki will ask you for database and user name and will attempt to create them if they don't already exist. If doing so from MediaWiki is impossible, you can do this using various control panels such as PhpMyAdmin, which are often available from shared hosts, or you may be able to use ssh to login to your host and type the commands into a MySQL prompt. 対応する説明文書を参照してください. Alternatively, contact your host provider to have them create an account for you.

Unix/Linux でのインストール

 * 1) Download and install MariaDB/MySQL. Depending on how MariaDB/MySQL was installed on your system the commands ,   and   may need to be amended to include the installation directory of MariaDB/MySQL (for example, by adding   in front of them).
 * 2) Check and see if the database server is running; for example, run  .  If it is not, run mysqld_safe to start it:.
 * 3) * Another way to initially start the MariaDB/MySQL server is to run the configure script available at the root of the installation. It creates the initial tables and automatically starts the MariaDB/MySQL daemon.
 * 4) * Alternatively you can start the MariaDB/MySQL daemon with systemd using: . You may also wish to enable the   service with , so that the MySQL service is started automatically on startup.
 * 5) Set a password for the "root" account on your database server.
 * 6) Run the MariaDB/MySQL command-line client:
 * 7) This will prompt for the "root" database password you just set, then connect to the MariaDB/MySQL server. Now, continue with the SQL commands below.

Windows でのインストール

 * 1) Download MySQL msi (mysql-5.5.22-winx64.msi for example)
 * 2) Run msi file and accept all defaults. When creating the root account, use a password that you will remember.
 * 3) Run Start->All Programs->MySQL->MySQL Server->MySQL Command Line Client
 * 4) Enter the root password you just created
 * 5) Now continue with the instructions below

Installation continued
If your database is not running on the same server as your web server, you need to give the appropriate web server hostname -- mediawiki.example.com in my example -- as follows:

MySQL/MariaDB on UNIX/Linux logs all queries sent to it to a file, which will include the password you used for the user account. If this concerns you, delete your  file after running these queries. This file may be found in your home directory.

PostgreSQL
If you are using PostgreSQL, you will need to either have a database and user created for you, or simply supply the name of a PostgreSQL user with "superuser" privileges to the configuration form. Often, this is the database user named postgres.

Here's one way to do most of the setup. This is for a Unix-like system. In this example, we'll create a database named wikidb, owned by a user named wikiuser. From the command-line, as the postgres user, perform the following steps.

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;

Beware of the list of known issues when running MediaWiki with PostgreSQL.

Run the installation script
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:.

MediaWiki 1.16 and earlier needed to be able to write to the  directory when it ran its installation script. This is no longer required.

Keep up to date!
Subscribe to our release announcements mailing list.

Once installed, make sure you stay up to date with releases, and keep your server secure!

Installation assistance

 * FAQ: FAQ
 * mediawiki-l (Mailing List) is the high-traffic mailing list to ask for support

関連項目

 * 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 set up multiple instances of MediaWiki with single set of MediaWiki files.