provides software and services that enable enterprises
Live Chat 1-888-673-6564

Open Source Software Technical Articles

  • Home
  • Search
  • Contact Us
  • Products and Support
  • Services
  • Enterprise OSS Blog
  • Wazi Technical Blog
  • About Wazi
  • Attributions and Licensing
  • Supply Chain Compliance
  • How to Contribute
  • Contributors
  • Resources Library
  • Cloud Services
  • Partners
  • Customers
  • Community
  • Company
  • Careers
  • News and Events

Subscribe to Wazi by Email

Your email:


Enterprise Developer Support 24 x 7, Get a Support Quote Now!


click-here-to-chat-with-an-online-representative

download-oss-discovery

Latest Posts

  • Use Perl to enhance ModSecurity
  • The secret to great reporting with Drupal 7
  • A more colorful LibreOffice unveiled
  • Toward a more colorful LibreOffice
  • Flexible administration with Puppet's Facter and templates
  • Knock for OpenSSH
  • Get more out of phpMyAdmin
  • Image annotation in GIMP, Dia, and OpenOffice Draw
  • Solr, Drupal 7, and faceted search
  • Using FreeNAS' new full disk encryption for ZFS

Connect with Us!

Current Articles | RSS Feed RSS Feed

MediaWiki Getting Started Guide

Posted by Matt Hartley on Thu, Apr 26, 2012
  
Email This Email Article  
Tweet  
  

MediaWiki is the software that powers Wikipedia and countless other wiki-based websites. With wiki software, everyday users can add, delete, and revise content in a collaborative manner. MediaWiki has proven itself to not only be reliable, but it's also supports a multitude of languages and allows administrators complete control over the content presented, while still providing a collaborative atmosphere for non-admin users as well.



If those features have you eager to try MediaWiki, you have two options. If you're in a hurry, you can try a hosted version, but chances are you'll want to install the software on your own servers. This guide walks you through installing MediaWiki and offers some tips and tricks for configuring it to make it more useful.



The first step to successfully running MediaWiki is to install the needed software dependencies. Assuming you're using a common server distribution like CentOS, you can follow the instructions below. Just remember that you're going to run http://localhost on a local server and http://YourDomain.com if it's a server that hosted elsewhere.



First, install and set up the Apache web server on CentOS:



yum install httpd
chkconfig --levels 235 httpd on


Edit /etc/httpd/conf/httpd.conf, uncomment the line of text that specifies NameVirtualHost *:80, and save the file. Restart Apache with the command service httpd restart and try visiting localhost in your web browser. If it works, you'll see an Apache test page.



Next, set up MySQL with PHP:



yum install mysql-server mysql php-mysql
chkconfig --levels 235 mysqld on
service mysqld start


Then create the MySQL wiki database:



mysql
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> CREATE DATABASE wiki;
mysql> CREATE USER 'wikiuser'@'localhost' IDENTIFIED BY 'wikipassword';
mysql> GRANT ALL ON wiki.* TO 'wikiuser'@'localhost';
mysql> exit


Now you can download the latest MediaWiki package and untar it to Apache's document root:



wget http://download.MediaWiki.org/mediawiki/1.18/mediawiki-1.18.2.tar.gz
tar -xvvf mediawiki-1.15.1.tar.gz
mv mediawiki-1.15.1 /var/www/html/wiki


Change the permissions for the config directory:



chown -R apache:apache /var/www/html/wiki
chmod a+w /var/www/html/wiki/config


  • Then restart Apache with the command service httpd restart. You should now have MediaWiki and all the software it depends upon installed and running.

     



    Before you can run MediaWiki you need to specify some settings. Visit http://localhost/wiki/config/index.php and enter the wiki name, contact email address, copyright license, admin username, and password. Set up your email notifications and authentication preferences by selecting the corresponding boxes to meet with your needs. In the MySQL section of Database config, enter a MySQL database name, and optionally a table prefix. Select MyISAM (recommended for speed) for the storage engine and choose UTF-8 for your character set. Finally, click the Install MediaWiki button.



    Once the installation is complete, your MediaWiki installation should be accessible from http://localhost/wiki or, if you installed it on a remote server, http://www.YourDomain.com/wiki. At this point you should move your LocalSettings.php file from the /config/ directory to the root wiki directory to give MediaWiki the files that control the settings it needs. The easiest approach to moving this directory depends on whether it's a local installation or not. If it's local, just drag the directory to the /httpdocs directory in your preferred file manager. If it's a remote server you're working with, I suggest dragging the config directory to your /httpdocs directory through a reliable FTP client such as FileZilla.



    Adjusting User and Group Rights



    Now you can start letting wiki visitors register themselves as users by using the register link located on the main page. User and group permission rights help the site admin control who can read, post, and edit content. When a new user registers, he is assigned by default to the user group, whose members are able to read, add, and modify existing wiki pages. Other groups include:




      • Bot group, generally reserved for automated maintenance scripts, such as one for dealing with wiki spam.

      • Sysop group, whose members can delete and restore pages from previous versions, and have some user moderation power. They can block and unblock standard users.

      • Bureaucrat group, whose members have the ability to change users' rights.



    Most users will not need their permissions changed, but if you do need to promote an existing user to help you with managing other users, you can change his group privileges.



    To modify a specific user's privileges, click the Special Pages link on a wiki page sidebar while logged in as an administrator. Look for Restricted special pages, and click on User rights management. Enter the specific username you'd like to modify. Select the Edit User Groups button, then choose the desired groups you'd like to assign that user to. When you're done, click the Save User Groups button.



    To modify group privileges, edit /includes/DefaultSettings.php. You can set the options presented to true or false depending on the group rights you're looking for. Keep track of any changes you make, in case you need to revert back to an original setting.


    19a98812-f823-48dc-841e-bf029c63c6d7

    Specifying a Site Logo



    With user privileges in hand, the next step is to brand your pages to reflects your wiki's niche. This translates into adding a logo to your wiki site. The logo needs to be 135x135 pixels in size, and for maximum rendering compatibility you should use a PNG image.



    Move the logo image file to the /skins/common/images/ directory. Edit the LocalSettings.php file in the root directory of your wiki installation. Locate $wgLogo, and change the path associated with it to point to the name to the image you wish to use – e.g. /skins/common/images/NewImageName.png. Save the changes, and the new logo will be displayed from now on.



    Creating Pages and Sidebar Links



    What's a wiki site without pages? When you're logged in as the administrator, you'll notice edit links on the main page. You can make changes to the page by clicking edit and then adding the content you wish to include.



    Creating new wiki pages requires some additional steps. Go to the wiki search box, type in the name of the page you'd like to create, and click on the Go button. You will be presented with an editing page, where you can create the content you want with the text editor offered on that page. Be aware that you need to use specific MediaWiki markup in place of typical HTML code. For instance, using double brackets ([[NameOfPage]]) creates a dynamic link to the destination page you want to link to. When you've finished, preview your page with the Preview button, and if you like what you see, click on Save Page.



    In addition to pages, you can create sidebar links for specific pages that might end up serving as lead pages to other, more elaborate pages. While you're logged in as an administrator, click on the Edit Navigation link on the sidebar. You will be presented with a text editor where you can add or remove navigation links. To add a new link, simply type in a new word that will correspond to a new link, highlight the word you just created, and click on the "add a link" icon in the text editor to bring up a dialog box. Move your cursor to Page Name and select the page you created earlier. Click OK when finished adding the link to the navigation. You can repeat the process for other pages. To finalize all your changes, click on Save. You should then see the new pages added to the sidebar navigation.



    Creating Wiki Categories



    Wiki categories are designed by the wiki admin to make locating information as easy as possible. A wiki category is simply a navigation link presented on wiki pages that allows wiki users to located additional information on a topic without relying on the search function. Categories can also be an organizational tool for wiki information.



    Creating categories for your new wiki isn't difficult, but there are policies you should consider before creating new categories. For instance, choose category names carefully. The naming scheme should reflect the topic at hand. Another consideration is whether a category is to be used as a list or a means of new content discovery. Of course a category can serve both ends, as long as it does both jobs as accurately as possible.



    To create a new category, start by visiting a wiki page you wish to add to a category to. Edit the page, and underneath the content you created earlier, create a category reference in the format [[Category:Category Name]]. To place the page into more than one category, repeat the process with different category names.



    Since you haven't actually created the categories yet, clicking on page preview will show the new links in red at the bottom of the page. Click on a red link to open an edit page where you can describe what the category is about.



    You can create a hierarchy of categories and subcategories. To create a subcategory, simply type something like [[Category: SubCategory Name]] into the area below the category content you added previously.



    Creating Sysops



    Generally, wiki sites organize large amounts of information into easy-to-follow pages. The most difficult part of building a wiki isn't the setup, it's cataloging all of the content that you may wish to add to it. This is a huge job, so enlisting help from a community of people who share an interest in your wiki topic can be a big help. However, you need to be careful about how much control you give to users. You need to avoid allowing random wiki visitors to potentially vandalize your wiki.



    When you identify individuals you're willing to trust to help build up your wiki's content, you can promote them from the role of default user by adding them to the sysop group. To promote a user, look to the sidebar menu, then go to Toolbox -> Special pages, scroll down to and click on Restricted special pages, then click on User rights management. Search for the name of the person to be promoted, then click the Edit User Groups button to change their permissions to reflect that of a sysop.



    Final Thoughts



    With this bootstrap guide, you should easily get MediaWiki installed, set up, and ready to share content. To learn more about how to manage MediaWiki, visit the project's technical manual. It's vastly more complex than the instructions provided here, but it's a complete guide for anyone looking to take their wiki to the next level.

    Follow @openlogic
    Follow @CloudSwing

    This work is licensed under a Creative Commons Attribution 3.0 Unported License
    Creative Commons License.
Follow @openlogic
Follow @OSCloudServices

This work is licensed under a Creative Commons Attribution 3.0 Unported License
Creative Commons License.
Tags: MySQL, Apache, PHP, CentOS, Technical, Tutorial, Web Server, mediawiki, FileZilla

Comments

Currently, there are no comments. Be the first to post one!
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics

Loading...
Error sending email
Email sent successfully

Email article
Email To : 
Your name : 
Message : (maximum 200 characters)
Home | Search | Contact Us | Products and Support | Services | Enterprise OSS Blog | Wazi Technical Blog | Resources Library | Cloud Services | Partners | Customers | Community | Company | Careers | News and Events
Products
OpenLogic Exchange (OLEX)
License Compliance Module
OSS Discovery
OSS Deep Discovery
OpenUpdate
Services
Open Source Support
CentOS Support
Scanning & Compliance
Open Source Training
Professional Services
Solutions
Support & Indemnification
Open Source Governance
Open Source Scanning
Open Source Provisioning
Consulting & Training
Contact Us
1-888-673-6564


© 2013 OpenLogic, Inc. All rights reserved.
Site Map  |  Privacy Policy