Skip to main content

Installing and Configuring a Mediawiki wiki on Mageia5

I started a MediaWiki wiki for my hobby, to serve as a convenient place to collect and centralize all the bits of information that I find scattered about the internet.

Creating such a wiki can be a daunting task, but if broken down into small tasks, it can be done. The most difficulty I had was that there were no specific instructions for Mageia. The best general instructions I could find were from the Mediawiki site, but were  for Ubuntu. Mageia configures its default configurations slightly different.

I chose to tun the wiki and its associated webserver and database in a virtual machinate using VirtualBox, so we can tackle that first assuming that you already know how install and configure VirtualBox.

Installing A Minimal Mageia Base
During the installation, deselect all the pre-configured options, but do select the option to select individual packages. You will select a minimal install with no X11 or documentation, but with urpmi.

The remaining installation is pretty straightforward and quick. On re-booting, you will see a prompt; you can log in as root. At this point, you'll need to use vi to edit files, so brush up if your vi-fu is rusty.

Modify /etc/group to add your personal account as a member of the wheel group and modify /etc/sudoers to you liking as to whether or not a password will be required.

Then we will remove the DVD-based repositories, add some web-based ones, perform and update of our base system, and then install the additional applications we need.

# urpmi.removemedia -av

# urpmi.addmedia --distribute --moralist 'http://mirrors.mageia.org/api/mageia.5.x86_84.list'

# urpmi --replacefiles --auto-update --auto -v && urpmi --replacefiles --auto-update --auto -v && shutdown -r now

The last instruction to run the command twice is at the suggestion of Mageia when doing a distro upgrade. here, it's just added insurance that all the files will be updated before you reboot.

Install Something to Send Mail From Your Wiki
We will need an application to send mail from our wiki. Rather than use a heavyweight like sendmail, I prefer the very lightweight /bin/mail, and that requires some additional configuration.

# urpmi mailx

Make the system's /etc/alternatives aware of /bin/mail and make it the default selection.

# update-alternatives --install /etc/alternatives/sendmail-command sendmail-command /bin/mail 1 

I needed to configure /etc/nail.rc to accommodate  my Gmail account.

Install Needed and Useful Applications
Let's add a few things to make it easier on ourselves. We need an ssh sever so we can log in remotely (actually while we log in from the host while the server runs in headless mode) and my favorite file manager, the Midnight Commander.

# urpmi openssh-server mc

Now it's time to not only install MediaWiki, but all the things that will be needed. In the Ubuntu tutorial and in the web-based MediaWiki setup procedure you will follow later, you will learn what you need, but here it is all laid out beforehand to make our job easier.

# urpmi task-lamp php-apc mediawiki-mysql git imagemagick 

Configure PHP
The /etc/php.ini file needs to be modified to reflect your timezone and allow large files to be uploaded. Here's the examples:

Date]              
; Defines the default timezone used by the date functions  
; http://php.net/date.timezone  
;date.timezone = "US/Eastern"

That web address will help you locate the appropriate value for the timezone.

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize 
upload_max_filesize = 20M

Configure Apache
Apache is installed with some good and useful pre-made configurations, but at the advice of MediaWiki, we should make the image upload directory more secure so bad actors can't do bad things.  

Edit /etc/httpd/conf/sites.d/mediawiki.conf to add:  
         
    # Ignore .htaccess files 
    AllowOverride None      
    # Serve HTML as plaintext, don't execute SHTML 
    AddType text/plain .html .htm .shtml .php .phtml .php5 
    # Don't run arbitrary PHP code.    
    php_admin_flag engine off      
    # If you've other scripting languages, disable them too.    

Start Apache : # systemctl start httpd.service

Start MySQL: # systemctl start mysqld.service

Make MySQL Safer
You should launch a special configuration application to make the MySQL server more secure and establish a root password.

# mysql_secure_installation

Configure MediaWiki
The initial configuration of our MediaWiki is done through a  web-based interface. This is fine if you're installing it on real hardware, but we're doing it on a headless virtual server with no X server. Theoretically, it should be possible to install a modern web browser like Firefox on our headless, X-less sever (it's only an X client after all) and run it over ssh on our local X-server.

Use ssh to access the server, install and launch Firefox to start the MediaWiki configuration.

During the web-based configuration, take the time to read everything it says and understand everything it says and make a note of every entry you make.

By the way, if you futz up at this point, just delete that one file and begin the web-based configuration again. It can be found at /etc/mediawiki/.

One Last Thing
We need to have good security for our server since it will face the Internet. To do this, we'll use Mageia's msec tool and we'll uninstall all applications we will no longer be using.

# urpmi msec && msec -l server
# urpme firefox && urpme --auto-orphans

Access Your New Wiki
Now here's the thing, the URL to access you new wiki is http://yourdomain/mediawiki. There are some valid reasons for making it so, but it's awkward. My workaround is to edit the default Apache file index.html to become a "welcome page" with a link to the funky address of the wiki.

Make Your URLs Pretty
If you don't like the ugly PHP URLs, you can find instructions on how to modify Apache to show prettier URLs. I didn't feel the need to do that.

Make a Custom Logo
The default logo for your site is located at /usr/share/mediawiki/skins/common/images/wiki.png
Make you own logo, name it wiki.png and replace the default logo.

REFERENCES

Installation Requirements

Installation Guide

System Administration

Running MediaWiki on Ubuntu  <-- followedl="" good.="" i="" it="" p="" pretty="" s="" what="">

Comments

Popular posts from this blog

DOS4GW.EXE Version 2.01a and Alternative DOS Extenders

DOS4GW.EXE The Tenberry DOS extender DOS4GW.EXE was used by many early DOS games. I still enjoy playing many of these games and DOS4GW.EXE is usable with DOSBox , so they can be played on Linux. However, the version of DOS4GW.EXE that was included with the game was whatever was current at the time. The most recent version that includes many bugfixes that possibly affected the games when used with DOSBox have been fixed in the latest version, 2.01a. It's not free at US$49, but you can downloaded it here . Simply substitute it for whatever version of DOS4GW.EXE your game provided and enjoy the bug-fixed goodness. Tenberry also makes a "high-performance" "pro" version of DOS4GW.EXE, but it costs $300. I think that they could sell quite a few of these to hobby users (since, you know, DOS is dead) for US$5. Open Souce to the Rescue There are better performing, free and Open Source alternatives available and worth a look. DPMI Explained Let's unders...

Return to Castle Wolfenstein for Modern Linux

Return to Castle Wolfenstein is a first-person shooter originally released on November 19, 2001. The game, like many other classic games, is available at GOG.com and costs only US$5.99. iortcw for Linux Don't bother with old and crusty Linux binaries offered by idsoft; they are problematic and it's painful to use them on a modern Linux. Fortunately for us, there are more modern GPL-licensed Linux binaries available for 32- and 64-bit systems as well as high resolution textures packages. The project at GitHub provides source code that can also be compiled for MS Windows using MinGW. iortcw for Windows and Mac You can download pre-compiled binaries for 32- and 64-bit Linux, MS Windows and Mac from here . Let's put our files in /usr/local/games/rtcw . As root, extract the downloaded .ZIP file for your architecture to  /usr/local/games/rtcw . All we are missing are the game data files. I purchased them from GOG.com. The game installer downloaded from GOG.com can be ...

Unpack those .EXE game files from GOG.com (Plus other un-packers)

I just came upon innoextract today. I have many of the wonderful games from GOG.com, some of which have native Linux Clients. Before now, I've had to use PlayOnLinux or Crossover to install these for use with WINE, then add the Linux client. InnoSetup as a way to create an installer to install the games on Windows.  Daniel Scharrer has created innoextract to allow the unpacking of those archives on a non-Windows platform. The website provides information on using innoextract , but this information from the page is very useful: GOG.com Installers GOG.com installers with a 2.x.x version number on the download page or in the filename use InnoSetup 5.5.0 and cannot be extracted by innoextract 1.2 and older. Older installers use InnoSetup 5.2.3 and usually have no version in the filename. Some GOG.com multi-part installers with version 2.1.x or higher use RAR archives (renamed to .bin) to store the game data. These files are not part of the InnoSetup installer and require...