Manual:System administration/ru

From MediaWiki.org

Jump to: navigation, search

This page is in progress of translating to Russian. You can help translating it or go to another language version that follows:

Эта страница в процессе перевода на русский язык. Вы можете помочь в переводе или перейти на другие языковые версии, указанные ниже:


На этой странице описаны задачи администратора, которые необходимо выполнить после завершения установки MediaWiki.

Contents

[edit] Включение/отключение загрузки файлов

Смотрите справку по настройке функции загрузки файлов

[edit] Назначение полномочий пользователям

MediaWiki - система, основанная на разделении прав. Это означает, что каждый пользователь может делать лишь то, что ему разрешено. Назначение прав отдельно каждому пользователю - слишком нудная процедура, поэтому, предпочтительнее, использовать группы доступа. Вы можете использовать, как встроенные группы, так и создавать новые (некоторым расширения необходимо создание новой группы доступа).

Редактирование групп пользователей производится с помощью соответствующей настройки параметра $wgGroupPermissions в файле LocalSettings.php.

Смотрите также: Manual:Security

[edit] Администратор

Наиболее частый случай использования. Пользователь, наделённый флагом администратора ('sysop') может удалять и восстанавливать статьи, блокировать и разблокировать IP/пользователей, выполнять SQL-запросы на чтение к базе данных, а также использовать функцию откатить к предыдущей версии пользователя при просмотре вклада участника. (Для подробной информации смотрите Wikipedia:Administrators.)

[edit] Бот

Зарегистрированный аккаунт бота. Правки с этого аккаунта не будут отображаться на спецстранице свежих правок (при настройках по-умолчанию). Подобные аккаунты используются для массового редактирования (чаще всего 'заливок') статей, при этом все правки скрыты от обычных участников (чтобы всё-таки увидеть подобные правки, добавьте к веб-адресу страницы списка свежих правок параметр &hidebots=0, как здесь).

[edit] Изменение оформления

На данный момент, доступные следующие стили оформления:

Для изменения темы оформления по-умолчанию, отредактируйте параметр $wgDefaultSkin в файле LocalSettings.php. Некоторые другие настройки также относятся к стилям оформления.

[edit] Локализация

Интерфейс MediaWiki переведён более чем на 100 языков, но, при необходимости, вы можете создать собственный вариант локализации. Все интернациональные сообщения расположены в пространстве имён MediaWiki: вы можете найти нужную вам страницу и отредактировать её (ваша учётная запись должна обладать правом 'editinterface', которое, по-умолчанию, есть у администраторов).

Если вы просто хотите изменить язык вашего вики-проекта на один из имеющихся, измените соответствующий параметр в настройках. Если вы выбрали неверный язык при установке MediaWiki, измените $wgLanguageCode в LocalSettings.php.

Note Замечание: В MediaWiki постоянно добавляются новые возможности, поэтому некоторые сообщения могут быть не переведены. Если вы перевели часть интерфейса, пожалуйста отправьте ваши изменения Bugzilla, чтобы другие пользователи могли их использовать.

[edit] Обновление MediaWiki

Смотрите Manual:Upgrading/ru

[edit] Наполнение вики-проекта: импортирование дампа базы данных

Если вы хотите импортировать какие-либо статьи в ваш локальный вики-проект, вы можете воспользоваться дампами (снимками) базы данных различных сайтов Wikimedia. Некоторую информацию вы можете найти здесь, а сами дампы можно скачать с download.wikipedia.org.

[edit] Установка необходимого ПО

Для распаковки архивов вам потребуется утилита ru:bzip2 (также подойдёт ru:WinRAR или ru:7-zip).

bzip2 можно совершенно бесплатно скачать со следующих сайтов:

  • Microsoft Windows: Windows-версия bzip2, работающая в режиме командной строки доступна под лицензией BSD ([1]). Архиватор 7-zip с графическим интерфейсом, распространяемый под лицензией LGPL, способен открывать запакованные bz2 файлы ([2]).
  • GNU/Linux: большинство дистрибутивов уже имеют утилиту bzip2. К примеру, пользователи Debian/GNU Linux могут установить bzip2 с помощью apt-get.
  • MacOS X: имеет встроенную утилиту bzip2.

[edit] Скачивание дампов

Дампы базы данных Википедии и других сайтов WikiMedia доступны на download.wikipedia.org (смотрите meta:Data dumps для более подробной информации). Вы можете скачивать их бесплатно и использовать на основе лицензии GNU Free Documentation License.

Дампы создаются несколько раз в месяц, однако, создание полных дампов самых крупных проектов может продолжать несколько недель, а размер базы данных при этом достигает десятков гигабайт.

На download.wikipedia.org размещён алфавитный список проектов WikiMedia. Для каждого проекта доступны как полные дампы со всеми версиями статей, так и дампы только текущих версий.

Заметьте, что в дампы попадают только страницы описаний изображений, но не сами изображения или звуковые файлы.

[edit] Проверка архива на наличие ошибок

Чтобы убедиться, что архив был скачан без ошибок, воспользуйтесь проверкой контрольной суммы файла: для каждого файла посчитана оригинальная контрольная сумма архива, например

9aa19d3a871071f4895431f19d674650 enwiki-20080103-pages-meta-current.xml.bz2

Если контрольные суммы исходного файла и файла, скачанного вами, не совпадают, то, весьма вероятно, что при закачке архив был повреждён.

Для подсчёта контрольной суммы вашего файла вы можете использовать утилиту md5sum, бесплатную и доступную для всех платформ:

  • GNU/Linux: md5sum - часть текстовых утилит GNU (называемых теперь утилиты ядра GNU); их можно загрузить с сайта www.gnu.org, однако, они и так включаются в каждый дистрибутив GNU/Linux.
  • Microsoft Windows: например: md5sum.exe (48 кб) или [3];
  • MacOS X: имеет встроенную утилиту /sbin/md5.

Другая широко известная утилита, openssl, также может генерировать контрольные суммы MD5:

openssl md5 the_filename

Если контрольные суммы файлов совпадают - распакуйте архивы, в противном случае, скачайте их заново.

[edit] Импортирование дампа базы данных

Для правильного отображения интервики-ссылок необходимо импортировать соответствующий дамп:

mysql -u wikiadmin -padminpass wikidb < interwiki.sql.gz

Далее импортирование дампа собственно страниц:

php maintenance\importDump.php < maintenance\ruwiki-20080109-pages-meta-current.xml

В зависимости от мощности компьютера, этот процесс может занять от нескольких минут до нескольких часов.

После того, как база импортирована, для комфортной работы лучше создать индекс для поиска и список соответствия страниц своим категориям.

Перейдите в корневой каталог вашего вики-проекта, переименуйте файл AdminSettings.sample в AdminSettings.php. Замените в нём wikiadmin и adminpass на ваши логин и пароль от базы данных. Затем выполните следующую команду:

php maintenance\rebuildall.php

Процесс переиндексации занимает очень много времени, но не следует его прерывать.

[edit] Изображения и загруженные файлы

Архивы изображений и файлов с сайтов Wikimedia в данный момент не создаются по лицензионным соображениям, однако, вы можете использовать утилиты для полуавтоматической загрузки файлов - см. meta:Data_dumps#Downloading Images from Wikipedia and Wikimedia Commons.

[edit] Backing up data: Creating a database dump

You can create a backup of the live databases using the mysqldump program. A simple way to run it is:

mysqldump --user=<yourWikiSQLUsername> --password=<yourWikiSQLPassword> \
             <yourWikiDBName> > wiki-mysql-dump.txt

where the parameters to mysqldump should match your LocalSettings.php file as follows:

parameter value set in LocalSettings.php
<yourWikiSQLUsername> $wgDBuser
<yourWikiSQLPassword> $wgDBpass
<yourWikiDBName> $wgDBname

Depending on the size of your wiki, this could take a few seconds, to a few minutes. During that time, the database is locked, so parts of the wiki web interface will appear to be hung, or maybe spew out some weird error messages.

Instead of doing this, I have chosen to write a small script that makes a "hot copy" of the databases

#!/bin/sh

OLDAGE=10d
CURDATE=`date "+%Y.%m.%d"`
DESTDIR=/path/to/backup/destination
WIKIWEB=/path/to/html/wiki

echo "================================"
echo "Backing up the database files..."
cd $DESTDIR
/usr/local/bin/mysqlhotcopy -u wikiuser -p wikipass wikidb $DESTDIR
mv wikidb wikidb.$CURDATE

echo "================================"
echo "Checking for database corruption..."
cd wikidb.$CURDATE
/usr/local/bin/myisamchk -e -s *.MYI
cd ..

echo "================================"
echo "Creating tarball..."
tar -czpf wikidb.$CURDATE.tgz wikidb.$CURDATE
rm -rf wikidb.$CURDATE

echo "================================"
echo "Copying LocalSettings.php (if needed)..."
cp -nv $WIKIWEB/LocalSettings.php .

echo "================================"
echo "Incrementally copying the images..."
#cp -Rpnv $WIKIWEB/images .
/usr/local/bin/rsync -av $WIKIWEB/images .

echo "================================"
echo "Removing old backups"
find $DESTDIR -name "wikidb.*.tgz" -ctime +$OLDAGE | xargs rm
# the above will try to return rm file not find when the find return nothing 
# its better to use 
#find $DESTDIR -name "wikidb.*.tgz" -ctime +$OLDAGE -exec rm -f {} \;
echo "================================"
echo -n "backup script completed "
date

(This might have some minor errors, I needed to make it more generic to publish it.)
--NickT 01:04, 1 Sep 2004 (UTC)

If you encounter problems with this backup script, try the following:

  • Check the paths (`which mysqlhotcopy myisamchk')
  • Remove the -n option to cp.
  • Connect to wikidb as the mysql root user, or grant the LOCK TABLES privilege to wikiuser
  • Execute the script as root, or some other user with access to the mysql files

Note that mysqlhotcopy needs to be run as root or a user that can access the mysql files. Also, mysqlhotcopy locks the database tables, but the mediawiki installation does not grant the LOCK TABLES privilege to wikiuser. To grant the privilege, do

mysql> grant lock tables on wikidb.* to wikiuser;
mysql> flush privileges;

-- 84.188.216.116 02:39, 18 August 2005 (UTC)

[edit] Extending the database: Converting (importing) existing content

For existing sites it is always a tough task to migrate to a Wiki structure; the process of wikifying existing content from text files, HTML websites, or even office documents can be automated, but you'll have to write appropriate scripts on your own. As far as we know, there are no general-user ready-to-run scripts available for this purpose. Opposed to commercial Content Management Systems like Hyperwave or HTML editors like Microsoft FrontPage, MediaWiki and other Open Source WikiWiki software does not include import filters. There are some exceptions which will be discussed in the following sections.

[edit] Converting content from a UseMod Wiki

Prior to MediaWiki (Wikipedia Software Phase III and Phase II), the Wikipedia utilized the UseMod Wiki software written by Clifford Adams. UseModWiki is a Perl script which uses a database of text files to generate a WikiWiki site. Its primary access method is through CGI via the Web, but can be called directly by other Perl programs. To convert an existing UseMod Wiki site, there is a script available in the /maintenance subdirectory of your MediaWiki source folder.

The storage format of UseMod Wiki is well documented: DataBase.

tbd

[edit] Converting content from a PHPWiki

If you only have a few pages to convert, and the content isn't sensitive, you might want to try WebForce's online markup converter.

For larger PHPWikis, Isaac Wilcox has written a Perl script to do the conversion. It converts all the commonly used markup (still not 100% of markup, but most PHPWikis will only need minor tweaks after conversion; patches are welcome). It's written for the Mediawiki 1.4.x database schema, though updating it to handle 1.5.x should be fairly easy (again, patches welcome).

The above script works well, but the schema has changed quite a bit since it was written. I found it easier to install the last stable 1.4.x version, import my data, then upgrade mediawiki. The script did an excellent job of preserving almost all of the formatting.

Also see PhpWiki conversion for a solution that uses "sed".

[edit] Converting JSPWiki format to MediaWiki format

You can use jspwiki2mediawiki.pl to convert JSPWiki pages to MediaWiki format.
The basis for this tool is php2mediawiki by Isaac Wilcox. php2mediawiki provided a convenient basis for this converter and the modifications added to it were introduced to support the conversion of the JSPWiki format.

[edit] Converting TracWiki format to MediaWiki format

You can use tracwiki2mediawiki.pl to convert TracWiki pages to MediaWiki format.
The basis for this tool is php2mediawiki by Isaac Wilcox. php2mediawiki provided a convenient basis for this converter and the modifications added to it were introduced to support the conversion of the TracWiki format.

[edit] Converting MoinMoin format to MediaWiki format

There are various scripts for this, all dodgy. See mw:MoinMoin.

[edit] Converting content from a database dump

tbd

[edit] Converting content from a CSV text file

tbd

[edit] Converting content from HTML text file

If you have only a HTML excerpt or a few pages to convert, you might want to try Diberri's html2wiki converter, which uses HTML::WikiConverter Perl module from CPAN. For larger collection of files one should probably use the module itself.

There are probably other HTML to Wiki markup converters.

See the section below for importing into MediaWiki.

[edit] Converting content from a MS-Word document

Try: Word2MediaWikiPlus.

The w:OpenOffice.org office suite also does a good job of reading MS Word and a usable job of exporting as MediaWiki wikitext.

[edit] Converting content from other sources

If you are able and willing to do some scripting by yourself, it is possible to import almost any existing textual content with a documented file format into MediaWiki.

The key to this is to insert rows into the cur table. Specifically, you need to fill the fields cur.cur_title and cur.cur_text. They contain the page titles and the wiki text, respectively. This is enough to start at. However, link tables must still be updated so the "What links here" etc. pages will work.

Note: As of version 1.5.0, the text above is incorrect; the database schema for handling revisions has changed significantly. I might be inclined to work upon some conversion scripts in the future, however. Rob Church Talk 12:06, 12 October 2005 (UTC)

As an example there might be the following script of some interest, which imports the public domain data from the CIA World Factbook 2002 into MediaWiki. It has been written by Evan Prodromou (E-Mail: evan(at)wikitravel(dot)org) for his own use on Wikitravel - The free, complete, up-to-date and reliable world-wide travel guide. It is licensed under the GNU General Public License and is available for download.

Please note that it's a one-time script; most paths and stuff are hard-coded, and lots of the code is for parsing the CIA World Factbook print pages, but it might serve as a good example of what can be done.

Does anybody know where this script is available? Matthewsim 23:27, 27 Aug 2004 (UTC)
found it on Wikitravel site Renmiri 21:57, 16 February 2006 (UTC)

[edit] Changing the tagline

A way to change the tagline that appears on top of every page just below the page title (but by default is hidden in Monobook skin except when printing pages) is to modify the MediaWiki:Tagline system message that if undefined defaults to From {{SITENAME}}.

Add the following to MediaWiki:Common.css if you want the taglin to display in all skins, or to MediaWiki:Monobook.css if you want to adjust only the Monobook skin:

   #siteSub { display:block; }

If you don't like the way it looks (the HTML displaying the text is H3 that displays bold by default in most browsers) add some CSS style declarations to that, eg:

   #siteSub { display:block; font-weight:normal; font-size:normal;}

[edit] Care and feeding of your MediaWiki

[edit] Maintenance scripts

Personal tools