Difference between revisions of "Mediawiki"

From Univention Wiki

Jump to: navigation, search
(Redirect to new cool solution article.)
 
Line 1: Line 1:
{{Version|UCS=3.1}}
+
#REDIRECT [[Cool Solution - Setting up MediaWiki with LDAP authentication]]
This article describes how to install and configure the mediawiki software in an UCS 3.1 environment. For a guide on UCS 4.1 please head to [http://wiki.univention.com/index.php?title=Setting_up_MediaWiki_with_LDAP_authentication this article].
 
 
 
== Installation ==
 
 
 
The mediawiki package is provided in the UCS 3.0 unmaintained repository:
 
<pre>
 
univention-config-registry set repository/online/unmaintained="yes"
 
</pre>
 
 
 
Now Mediawiki and the LDAP-plugins can be installed:
 
<pre>
 
univention-install mediawiki mediawiki-extensions-base mediawiki-extensions-ldapauth
 
</pre>
 
 
 
== Configuration ==
 
 
 
The configuration of mediawiki including the cooperation with UCS is split into three parts:
 
*making mediawiki accessable via the Apache webserver
 
*enabling LDAP authentication
 
*adding a mediawiki link to the UCS overview page
 
 
 
=== Configuration of the Apache webserver ===
 
 
 
In the file '''/etc/mediawiki/apache.conf''' the following line must be uncommented:
 
<pre>
 
#Alias /mediawiki /var/lib/mediawiki
 
</pre>
 
 
 
Alternatively a custom alias can be created:
 
<pre>
 
Alias /<my-alias> /var/lib/mediawiki
 
</pre>
 
 
 
Afterwards, please restart the Apache webserver:
 
<pre>
 
/etc/init.d/apache2 restart
 
</pre>
 
 
 
Now the initial configuration must be run. This can be done by opening the configuration interface in a webbrowser:
 
<pre>
 
http://<fqdn>/mediawiki/config/index.php
 
</pre>
 
 
 
respectively
 
<pre>
 
http://<fqdn>/<my-alias>/config/index.php
 
</pre>
 
 
 
Finally, the configuration file must be moved:
 
<pre>
 
mv /var/lib/mediawiki/config/LocalSettings.php /etc/mediawiki
 
</pre>
 
 
 
The mediawiki can now be accessed by opening:
 
<pre>
 
http://<fqdn>/mediawiki/
 
</pre>
 
 
 
respectively
 
<pre>
 
http://<fqdn>/<my-alias>/
 
</pre>
 
 
 
=== LDAP authentication ===
 
 
 
To enable the LDAP authentication with mediawiki, the following link must be set:
 
<pre>
 
ln -s /etc/mediawiki-extensions/extensions-available/LdapAuthentication.php /etc/mediawiki-extensions/extensions-enabled/LdapAuthentication.php
 
</pre>
 
 
 
Now, the plugin must be configured. This is done by adding the settings to the standard mediawiki configuration files:
 
<pre>
 
echo "\$wgAuth = new LdapAuthenticationPlugin();" >> /etc/mediawiki/LocalSettings.php
 
echo "\$wgLDAPDomainNames = array('$(ucr get domainname)');" >> /etc/mediawiki/LocalSettings.php
 
echo "\$wgLDAPSearchStrings = array( '$(ucr get domainname)' => 'uid=USER-NAME,cn=users,$(ucr get ldap/base)' );" >> /etc/mediawiki/LocalSettings.php
 
echo "\$wgLDAPEncryptionType = array('$(ucr get domainname)' => 'ssl');" >> /etc/mediawiki/LocalSettings.php
 
echo "\$wgLDAPPreferences = array('$(ucr get domainname)' => array( "email" => "mailPrimaryAddress", "realname" => "displayName", "nickname" => "uid"));" >> /etc/mediawiki/LocalSettings.php
 
echo "\$wgLDAPBaseDNs = array('$(ucr get domainname)' => '$(ucr get ldap/base)');" >> /etc/mediawiki/LocalSettings.php
 
echo "\$wgLDAPServerNames = array('$(ucr get domainname)' => '$(ucr get ldap/master):7636');" >> /etc/mediawiki/LocalSettings.php
 
</pre>
 
 
 
After reloading the mediawiki in your browser, any domain user can log into the mediawiki using the known username and password.
 
 
 
=== Including mediawiki in the UCS overview page ===
 
 
 
To include a link to the mediawiki into the UCS overviewpage, the files '''/etc/univention/templates/files/var/www/ucs-overview/de.html.d/21Wiki.html''' and '''/etc/univention/templates/files/var/www/ucs-overview/en.html.d/21Wiki.html''' must be filled with the following:
 
 
 
<pre>
 
<tr>
 
<td class="overview">
 
<a href="../univention-management-console/">
 
<img src="../icon/about.png" alt="Mediawiki" border="0" />
 
</a>
 
</td>
 
<td class="overview"><a href="../mediawiki/">Mediawiki</a></td>
 
<td class="overview">Mediawiki auf @%@hostname@%@</td>
 
</tr>
 
</pre>
 
 
 
Additionally, the info file '''/etc/univention/templates/info/mediawiki.info''' must be created and filled with the following content:
 
<pre>
 
Type: subfile
 
Multifile: var/www/ucs-overview/de.html
 
Subfile: var/www/ucs-overview/de.html.d/21Wiki.html
 
 
 
Type: subfile
 
Multifile: var/www/ucs-overview/en.html
 
Subfile: var/www/ucs-overview/en.html.d/21Wiki.html
 
</pre>
 
 
 
Finally, restart the Apache webserver:
 
<pre>
 
/etc/init.d/apache2 restart
 
</pre>
 
 
 
[[Category:Howtos]]
 
[[Category:EN]]
 

Latest revision as of 12:47, 16 June 2016

Personal tools