Community Effort Community Effort
Total Page:16
File Type:pdf, Size:1020Kb
COVER STORY Mediawiki Configuring and Managing Mediawiki 1.4 CCOMMUNITYOMMUNITY EFFORTEFFORT The best way of organizing collaboration on the Web is with a Wiki. Mediawiki, the Wiki behind the famous Wikipedia project, sets the standard for web-based collaboration tools. BY ELISABETH BAUER iki fans will be familiar with proven its value for over two years in a will be using Mediawiki 1.4beta5. The the scenario: you spot a typo permanent production situation. This final version of 1.4 should have been Won a website and drag the trial by fire has allowed Mediawiki released by the time this magazine mouse around the screen vainly search- developers to quickly discover and reaches the newsstands, so you may be ing for the edit button. Until the incep- remove vulnerabilities, making Media- using a slightly different version. tion of the Wiki principle, it was consid- wiki one of the most stable and well Log on to the console as root, and ered unthinkable for any visitor to be tested Wiki options. change to the web server’s root direc- able to edit a Website. But now, projects tory; this is /opt/lampp/htdocs on like the free encyclopedia, Wikipedia Installation XAMPP, or /var/www, on Debian. Once [1], clearly demonstrate the viability of a Mediawiki requires a functional Apache you get to the web server’s root direc- collaborative effort involving thousands web server with the PHP module and a tory, you can type in the following com- of volunteers. Many business and open MySQL database. The Mediawiki man- mands: source projects have put Wikis to effec- agement scripts need the PHP command tive use in areas such as software docu- line interpreter, which Debian users will tar xzvf /path/to/U mentation, or simply as a means for find in a package of its own, php4-cli. To mediawiki-1.4beta5.tar.gz organizing documents on an enterprise generate thumbnails of images you will intranet. be using with the Wiki, you might also to unpack the Wiki software in the If you are interested in setting up your like to install ImageMagick or the PHP current directory. The new directory that own Wiki, you are spoiled for choice. graphical library, GD. Your web server this step creates will later become part of You’ll find over 50 Wiki engines in a will need to support PHP code execu- the URL for your Wiki, so you will want variety of programming languages. tion. to make sure you give the directory as Mediawiki [2], the software that Download the current version of short a name as possible, wiki, for exam- Wikipedia uses, is a Wiki tool that has Mediawiki from [2]. In this article, we ple: mv mediawiki-1.4beta5 wiki. 22 ISSUE 55 JUNE 2005 WWW.LINUX- MAGAZINE.COM Mediawiki COVER STORY Change to the directory by license for texts and other Advertisment entering cd wiki. documents that was inspired Then type by the GPL. The license allows free copying, modifi- chmod a+w config cation and commercial uti- lization. The Creative Com- to make the web server con- mons licenses allow you figuration directory writable more leeway; for example, temporarily. After completing you can prohibit any com- the installation, don’t forget mercial use and choose a to make the directory read version applicable to your only again. location. Click choose to go to Now, launch the installa- the selection dialog on the tion script in your browser: Creative Commons website, http://localhost/wiki/config/ where you can put together a index.php. license that reflects your The script first checks the requirements. Mediawiki installation requirements. If accepts your choice of license you see an error message at and displays a link to the this point, instead of the license in the footer of every dialog shown in Figure 1, you page. will need to go back, then You need to specify a user check and correct your account as your Sysop Apache and PHP settings. account; the sysop will have You will also be able to see if extended privileges for the the script has found either Wiki; the account name is ImageMagick or the PHP GD arbitrary. extension for generating To accelerate Mediawiki, thumbnails. the installer offers to enable Enter a name for your Wiki either Turck MMCache or in Site name:. The Site name Memcached – you will only will appear at several posi- want to enable these options tions in your Wiki as the if you have installed the project name, and Mediawiki cache software. Debian has will create a so-called project packages for both. Turck name space with this title – MMCache is a PHP bytecode but we will be returning to cache that is useful if you this subject later. will be running Mediawiki on The email address is the a single host. The Wikipedia contact address for error server farm uses Memcached, messages. Use the language a distributed caching system selection dialog to select the originally developed for Live- default language for the Wiki. journal, which runs as a Besides the interface lan- daemon. guage, you need to set char- The database settings are acter encoding. Setting us - the final stage. The install English - Unicode allows script creates a MySQL user users to add entries to the and a database. You can use Wiki in foreign character sets the defaults in most cases. If without needing a you want Mediawiki to share workaround via HTML enti- a database with other appli- ties. cations, enter the database On a local network, the name, and then enter a prefix Wiki licensing information is for the table name in Data- not that important, but if you base table prefix, mw_ for are running a public Wiki, example. This will avoid con- you might like to think about flicts if another application the subject. The GNU Free uses tables of the same name Documentation License is a (for example user). WWW.LINUX- MAGAZINE.COM ISSUE 55 JUNE 2005 23 COVER STORY Mediawiki Type your MySQL root password in the last field, DB root password. This is not the same as your Linux root pass- word, and some distributions allow you to use a blank password. Now click on Install, and the script will create the database, the MySQL and Wiki users, and the LocalSettings.php configuration file in the config directory. If all of this works as planned, you will see a success message with a link to the Wiki in the last line. Before you can visit your new Wiki, you will need to take a short detour via the console. In the Mediawiki directory, move the newly created local settings from the configuration directory to the main directory by typing mv config/LocalSettings.php . Your Wiki is now ready for use. The link Figure 1: Run a PHP script in your browser to install Mediawiki. The script prompts you for the displayed on your screen will take you to critical settings. the main page (see Figure 2). page already exists. The Mediawiki man- with the sysop account created previ- First Steps in the Wiki ual has more information on creating ously, the other settings involve editing Clicking on edit in the toolbar at the top pages [3]. the LocalSettings.php configuration file pops up a text window, which visitors As Mediawiki was developed with the created by the install. The configuration can use to populate the page with con- encyclopedia in mind, it differs from tra- options are located in includes/Default- tent in Wiki syntax (see Table 1). This is ditional Wikis at certain points. For Settings.php. If you want to change any just plain vanilla text with a few special example, Mediawiki introduces the con- of them, copy the values to your local formatting tags. Typing * at the start of a cept of namespaces, fixed prefixes that settings and change them there, as line allows you to create a list, for exam- appear in front of the page title. There is DefaultSettings.php is overwritten by ple, and you can put your text in two, a discussion page for each Wiki page, updates. three, or four sets of equals signs to use and a link in the toolbar at the top takes To add your own log, enter the path to headlines of different sizes: you there. Each user has a personal page the image file in LocalSettings.php: (a link in Wiki syntax [[User:Name]], ==Heading== which allows a user to introduce herself $wgLogo = U or make notes. If someone leaves a mes- "/path/to/your/logo.png"; An empty line gives you a new para- sage on a user’s discussion page, Medi- graph. But the links are the most fasci- awiki informs the user the next time that You can modify any text on the user nating functions. In contrast to classical user accesses a page. The software adds interface directly in the Wiki. http:// Wikis such as Usemodwiki or TWiki, a descriptive page with an image prefix localhost/wiki/index.php/Spezial: which rely on automatic link detection for images, and users can edit the page Allmessages gives you a list of the pages based on CamelCase format, Mediawiki just like any other Wiki page. in the MediaWiki namespace. Each page only supports free text links. Mediawiki Users can create and edit pages in the corresponds to a software message, such converts the text between square brack- Template namespace. {{Title}} allows as Login successful. ets into internal links. Type users to add the content of http:// MediaWiki 1.4 and later allows users localhost/wiki/index.php/Vorlage:Titel to modify the interface settings in their [[Testpage]] to any other page.