Manual:Installing MediaWiki/ko

From MediaWiki.org

Jump to: navigation, search
Tournesol.png 설치 안내 | 미디어위키에 대해
Help-browser.svg 특징 | 설치 필요조건
Preferences-system.svg 다운로드 | 설치 | 설정


미디어위키는 웹 기반의 설치 스크립트를 통해 설치됩니다. 스크립트를 실행하기 전에 몇 가지 준비 과정이 필요합니다. 먼저, 설치하려는 서버에 아파치, PHP, MySQL이 설치되어 있는지를 확인해주세요. 그 다음에는 미디어위키 프로그램을 받아서 서버에 올려야 합니다. 또한 위키에 사용할 데이터베이스를 만들어야 합니다. 필요하다면 시스템 계정을 만들어야 할 수도 있습니다(관련 도움말(영어)).

Contents

미디어위키 다운로드하기

미디어위키는 정식 다운로드 문서에서 받거나, 또는 SVN에서 받을 수 있습니다.

받은 파일을 현재 컴퓨터나, 서버의 웹 디렉토리에서 에서 압축을 풉니다. 마이크로소프트 윈도의 경우 압축 프로그램으로 7-Zip(오픈 소스), WinZip, WinRAR, IZArc 등이 있습니다.

리눅스의 경우에는 다음의 명령어를 콘솔 창에 입력해주세요. 이때 .tar.gz 파일은 실제 다운로드한 파일 이름으로 써 주어야 합니다.

tar xvzf mediawiki-*.tar.gz

아직 서버에 미디어위키 프로그램을 올리지 않았다면 지금 서버의 웹 디렉토리로 해당 파일을 올려 주세요. FTP 프로그램이 필요한 경우 윈도에서는 FileZilla(오픈 소스), 맥 OS X에서는 Cyberduck 등의 프로그램을 사용할 수 있습니다.


디렉토리 설정하기

미디어위키를 설치하려면, 미디어위키가 있는 폴더의 config 디렉토리에서 쓰기 권한이 있어야 합니다. 아직 설정이 되어 있지 않다면 FTP나 콘솔을 통해 설정할 수 있습니다. 예를 들어 FileZilla의 경우, config 디렉토리에서 마우스 오른쪽 버튼을 눌러 팝업 메뉴에서 'attributes...'를 선택한 다음, Owner에 Write 속성을 체크해 주면 됩니다. 서버에 따라서는 모든 속성을 체크해 주어야 할 경우도 있습니다.

프로그램에 따라서는 권한을 숫자로 입력해야 할 수 있습니다. 이 때에는 755를 입력해 주면 됩니다(레드햇 리눅스의 경우 777을 써 주어야 합니다). 콘솔에서 바꿀 경우에는 wiki 디렉토리에서 chmod 755 config를 입력해주세요.

데이터베이스 만들기

데이터베이스 루트 암호를 알고 있다면 미디어위키 설치 과정에서 새 데이터베이스가 자동으로 만들어집니다. 또는 호스팅 업체에서 데이터베이스를 제공하고 있을 수 있고, 위키에 사용할 데이터베이스가 이미 있는 경우 다음 과정으로 건너뛰어도 됩니다. 루트 암호를 모르고 데이터베이스가 없다면, 새 데이터베이스를 만들어야 합니다. 현재 미디어위키에서는 MySQL이나 Postgres를 지원합니다.

MySQL

  • You need to create a MySQL database and a user before installing MediaWiki. 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. See the corresponding documentation. Alternatively, contact your host provider to have them create an account for you
    1. Download and install MySQL 5.0. It should put itself in /usr/local/mysql
    2. Check and see if the database server is running ("/usr/local/mysql/bin/mysqladmin status"), If not, sudo /usr/local/mysql/bin/safe_mysqld &.
      (For Fedora Core 5, use /usr/bin/mysqld_safe)
      1. Another way to start initially 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
    3. Set a password for the "root" account on your database server. /usr/local/mysql/bin/mysqladmin -u root password yourpassword
    4. Set up a user in MySQL for your Wiki--do this in your terminal: /usr/local/mysql/bin/mysql -u root -p mysql
    5. This starts up the MySQL command line client. Now, do this in the client:
 create database wikidb;
 grant create, select, insert, update, delete, alter, lock tables on wikidb.* to 'wikiuser'@'localhost' identified by 'password';
 flush privileges;
 \q

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:

 grant create, select, insert, update, delete, alter, lock tables on wikidb.* to
 'wikiuser'@'mediawiki.example.com' identified by 'password';

Postgres

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

The database that MediaWiki will use needs to have both plpgsql and tsearch2 installed. The installer script will try to install plpgsql, but you may need to install tsearch2 yourself. (tsearch2 is used for searching the text of your wiki). Here's one way to do most of the setup. This is for a Unix-like system, and assumes that you have already installed the plpgsql and tsearch2 modules. 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
 createlang plpgsql wikidb

Adding tsearch2 to the database is not a simple step, but hopefully it will already be done for you by whatever packaging process installed the tsearch2 module. In any case, the installer will let you know right away if it cannot find tsearch2.

The above steps are not all necessary, as the installer will try and do some of them for you if supplied with a superuser name and password.

For installing tsearch2 to the wikidb database under Windows, do the following steps:

  1. find tsearch2.sql (probably under .\PostgreSQL\8.x\share\contrib) and copy it to the postgresql\8.x\bin directory;
  2. from a command prompt at the postgresql\8.x\bin directory, type "psql wikidb < tsearch2.sql -U wikiuser";
  3. it will prompt you for the password for wikiuser;

That's it!

Point (2) seems only to work on windows, cause on debian linux 4.0 (etch) only user postgres is allowed to use language c. so there it must be called by:

su - postgres -c psql wikidb < tsearch2.sql

afterwards you must grant select rights to wikiuser to the tsearch tables and insert the correct locale.

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';"

If you receive an error similar to "ERROR: relation "pg_ts_cfg" does not exist" when executing the above statements, try installing tsearch2 to the wikidb database again, but instead use these two separate steps (and then try the grant statements again):

1) su - postgres
2) psql wikidb -f tsearch2.sql

Run the installation script

Once all of the above steps are complete, you can complete the installation in a web browser. See Manual:Config script for details.