MediaWiki
(→Аутентификация через Communigate Pro) |
(→Аутентификация через AD) |
||
Строка 68: | Строка 68: | ||
Файл LocalSettings.php должен содержать следующие строки: | Файл LocalSettings.php должен содержать следующие строки: | ||
<pre> | <pre> | ||
+ | #Enable LDAP authentification | ||
+ | require_once( "$IP/extensions/LdapAuthentication/LdapAuthentication.php" ); | ||
$wgAuth = new LdapAuthenticationPlugin(); | $wgAuth = new LdapAuthenticationPlugin(); | ||
$wgLDAPDomainNames = array('ADDOMAIN'); | $wgLDAPDomainNames = array('ADDOMAIN'); |
Версия 15:15, 4 декабря 2012
![]() | 外國 language! В статье используется несколько языков. Необходимо использовать один. Совсем неплохо, если это будет русский. |
Содержание |
Установка
Конфигурационный файл Nginx для работы с MediaWiki через fast-cgi модуль php5:
Кеширование и производительность
- http://www.mediawiki.org/wiki/Manual:Performance_tuning
- http://www.mediawiki.org/wiki/Manual:$wgMainCacheType
Загрузка дополнительных типов файлов
LocalSettings.php
# Разрешить дополнительно загружать следующие типы файлов: $wgStrictFileExtensions = false; $wgFileExtensions[] = 'doc'; $wgFileExtensions[] = 'xls'; $wgFileExtensions[] = 'pdf'; $wgFileExtensions[] = 'odt'; $wgFileExtensions[] = 'ods';
Внешний вид
Как поменять шрифт по-умолчанию
add the following to your MediaWiki:Common.css page (NOTE: MediaWiki:Common.css is a page ON THE WIKI, such as mywiki.com/wiki/MediaWiki:Common.css. It is NOT in the filesystem. Chances are it doesn't exist yet, so you need to create it)
body { font-family: "Century Gothic", Arial, sans-serif; }
How do I change the logo?
The logo that appears in the top left of each page is determined by the $wgLogo configuration line in the LocalSettings.php file.
There are two ways to change the logo:
Upload a picture to your wiki using the normal file uploading interface. This allows the logo to be replaced easily, so you may want to protect the page if you use this method.
Then add the $wgLogo line to LocalSettings.php, for example:
$wgLogo = 'http://www.example.com/wiki/images/6/62/photoname.jpg';
Or upload an image to your server by other means (such as FTP). Add the $wgLogo line to LocalSettings.php, for example:
$wgLogo = "{$wgScriptPath}/photoname.jpg";
In this example, the photo is in the same folder as the LocalSettings.php file.
![]() | ВНИМАНИЕ! Do not simply overwrite the default logo installed with MediaWiki ( /skins/common/images/wiki.png ); this file will be overwritten when you upgrade. |
Tip: The logo image should be 135 x 135 pixels.
Дополнения
- http://www.mediawiki.org/wiki/Extension:Add_to_Any_Share/Save/Bookmark_Button
- SyntaxHighlight_GeSHi
- ConfirmEdit
- http://www.mediawiki.org/wiki/Extension:UsabilityInitiative
- http://www.mediawiki.org/wiki/Extension:DynamicPageList_%28Wikimedia%29
- http://ru.wikipedia.org/wiki/Википедия:Викификатор
- http://www.mediawiki.org/wiki/Extension:ParserFunctions
- http://fs.fsinf.at/wiki/SecurePages Confidential Information, most commonly passwords, should never be transmitted through a plain HTTP connection since an eavesdropper can easily intercept that information. Using HTTPS is a solution but adds an additional load to your servers (for the encryption) so you don't want to use https if you are on "normal" pages. This extension solves just that problem: It redirects the user to HTTPS on just some pages while redirecting to HTTP on any other page.
LDAP аутентификация
Для реализации LDAP аутетификации прежде всего надо скачать плагин gпо адресу http://www.mediawiki.org/wiki/Extension:LDAP_Authentication. Следуйте указаниям разработчика плагина для его распаковки. После его распаковки запустите update.php
# Run this from the top level of your MediaWiki installation directory php maintenance/update.php
Далее отредактируйте файл $IP/LocalSettings.php
Аутентификация через AD
Файл LocalSettings.php должен содержать следующие строки:
#Enable LDAP authentification require_once( "$IP/extensions/LdapAuthentication/LdapAuthentication.php" ); $wgAuth = new LdapAuthenticationPlugin(); $wgLDAPDomainNames = array('ADDOMAIN'); $wgLDAPServerNames = array('ADDOMAIN' => 'controller1.addomain.com controller2.addomain.com'); $wgLDAPSearchStrings = array('ADDOMAIN' => 'ADDOMAIN\\USER-NAME'); $wgLDAPEncryptionType = array('ADDOMAIN' => 'clear'); $wgMinimalPasswordLength = 1; $wgLDAPBaseDNs = array('ADDOMAIN' => 'dc=addomain,dc=com'); $wgLDAPLowerCaseUsername = array('ADDOMAIN' => true); $wgGroupPermissions['*']['createaccount'] = true; $wgLDAPDebug = 10; $wgShowExceptionDetails = true;
Аутентификация через Communigate Pro
#Enable LDAP authentification require_once( "$IP/extensions/LdapAuthentication/LdapAuthentication.php" ); $wgAuth = new LdapAuthenticationPlugin(); $wgLDAPDomainNames = array('CGDomain'); $wgLDAPServerNames = array('CGDomain' => 'CGDomain.example.com'); $wgLDAPSearchStrings = array('CGDomain' => 'uid=USER-NAME, cn=example.com'); $wgLDAPEncryptionType = array('CGDomain' => 'clear'); $wgMinimalPasswordLength = 1; $wgLDAPSearchAttributes = array('CGDomain'=>'uid'); $wgLDAPBaseDNs = array('CGDomain' => 'dc=example,dc=com'); $wgLDAPLowerCaseUsername = array('CGDomain' => true); $wgGroupPermissions['*']['createaccount'] = true; $wgLDAPDebug = 10; $wgShowExceptionDetails = true;
Боремся со спамом
Средства Apache
Создаем файл .htaccess, который заблокирует досуп браузерам/скриптам с пустой строчкой User-agent
SetEnvIf User-Agent ^$ spammer=yes # block blank user agents Order allow,deny allow from all deny from env=spammer
Средства MediaWiki
Мы используем следующую конструкцию, добавляем следующие параметры в LocalSettings.php:
$wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createpage'] = false; $wgGroupPermissions['user']['move'] = false; $wgGroupPermissions['user']['read'] = true; $wgGroupPermissions['user']['edit'] = true; $wgGroupPermissions['user']['createpage'] = true; $wgGroupPermissions['user']['createtalk'] = true; $wgGroupPermissions['user']['upload'] = true; $wgGroupPermissions['user']['reupload'] = true; $wgGroupPermissions['user']['reupload-shared'] = true; $wgGroupPermissions['user']['minoredit'] = true; $wgGroupPermissions['user']['purge'] = false; $wgGroupPermissions['sysop']['edit'] = true; $wgGroupPermissions['sysop']['createpage'] = true;
Блокировки по ip-адресам
Подтверждение адреса электронной почты для редактирвоания статей
$wgEnableEmail = true; // enable the e-mail basic features $wgEmailAuthentication = true; // require email authentication for using any email function (except password reminder which works independently from this setting) $wgEmailConfirmToEdit = true; // Require a confirmed address to edit pages
Дополнение SpamBlackList
Дополнение ConfirmEdit
Скачиваем и устанавливаем дополнение. Чтобы скачать версию для PHP4 необходимо обратиться к SVN:
svn checkout -r 21970 http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ConfirmEdit/
Чтобы обойти глюк с сообщениями плагина (на китайском) надо добавить следующую строчку в конец файла ConfirmEdit.i18n.php:
$wgConfirmEditMessages['last'] = $wgConfirmEditMessages['ru'];
Дополнение ConfirmAccount
Решить проблему с бесконтрольной регистрацией пачек спам-аккаунтов можно при помощи расширения ConfirmAccount.
Установка и настройка достаточно проста:
- Скачать последнюю версию расширения по ссылке и разархивировать в папке с расширениями: http://www.mediawiki.org/wiki/Special:ExtensionDistributor/ConfirmAccount
- Добавить в конфигурационный файл LocalSettings.php строку require_once("$IP/extensions/ConfirmAccount/ConfirmAccount.php");
- Запустить в консоли в папке с установленной вики следующую команду php maintenance/update.php
Если в процессе установки вылезет ошибка: The last attempted database query was: "CREATE INDEX acr_email_token ON `account_requests` (acr_email_token)" from within function "DatabaseBase::sourceFile( /srv/www/vhosts/wiki.rsu.edu.ru/extensions/ConfirmAccount/ConfirmAccount.sql )". Database returned error "1170: BLOB/TEXT column 'acr_email' used in key specification without a key length (localhost)"
Необходимо вручную из БД MediaWiki удалить таблицу account_requests и поправить файл extensions/ConfirmAccount/ConfirmAccount.sql следующим образом.
Находим строку:
CREATE UNIQUE INDEX /*i*/acr_email ON /*_*/account_requests (acr_email(255));
И переносим ее следом за строкой:
CREATE INDEX /*i*/acr_type_del_reg ON /*_*/account_requests (acr_type,acr_deleted,acr_registration);
Снова запускаем php maintenance/update.php
В системе появится страница Служебная:ConfirmAccounts на которой можно будет отклонять или подключать новых пользователей системы.
Дополнение UsabilityInitiative
Скачиваем отсюда http://www.mediawiki.org/wiki/Special:ExtensionDistributor/UsabilityInitiative
// UsabilityInitiative/Vector require_once("$IP/extensions/UsabilityInitiative/Vector/Vector.php"); $wgVectorModules['collapsiblenav']['global'] = true; // Turns on collapsible sidebar navigation by default $wgVectorModules['editwarning']['global'] = false; // Don't enable EditWarning globally $wgVectorModules['editwarning']['user'] = true; // Allow users to enable EditWarning in their preferences $wgVectorUseSimpleSearch = true; // Need this as well for SimpleSearch $wgDefaultSkin = 'vector'; // If you want to change the default skin for new users $wgVectorUseIconWatch = true; //Enable star icon to add/remove page from watchlist // UsabilityInitiative/WikiEditor require_once("$IP/extensions/UsabilityInitiative/WikiEditor/WikiEditor.php"); $wgDefaultUserOptions['wikieditor-highlight'] = 0; $wgDefaultUserOptions['wikieditor-preview'] = 1; $wgDefaultUserOptions['wikieditor-publish'] = 0; $wgDefaultUserOptions['usenavigabletoc'] = 0; $wgDefaultUserOptions['wikieditor-template-editor'] = 0; $wgDefaultUserOptions['usebetatoolbar'] = 1; $wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
См. также
Ссылки
- http://www.mediawiki.org/wiki/Manual:FAQ
- http://www.mediawiki.org/wiki/Manual_talk:$wgGroupPermissions
- http://www.wikiknowledge.net/wiki/MediaWiki
- http://wiki.evernex.com/index.php?title=Blocking_Spam_in_Mediawiki
- http://www.mediawiki.org/wiki/Manual:$wgGroupPermissions
- http://www.mail-archive.com/gnustep-webmasters@gnu.org/msg00179.html
- http://techblog.wikimedia.org/2010/07/mediawiki-1-16-0/