Forum: 
Tags: 

How to install the latest version of MediaWiki?

Hello everyone,

I'm a new user to Turnkey Linux and I'm interested in starting 2 MediaWiki servers that are running the latest version of the MediaWiki software. 

So far I have started a micro server using the free usage tier and selected the mediawiki applicance to be installed. This worked like a charm, no problems there. However, I realised the version installed (1.15) is incompatible with the extensions I need (such as Semantic Wiki, which requires at least 1.17). 

I did a search on how to upgrade and came across this thread: http://www.turnkeylinux.org/forum/support/20110920/how-upgrade-mediawiki... (note that I'd like to upgrade to 1.21.2)

With no data no backup, I decided to proceed with removing the mediawiki 1.15 appliance using:

    apt-get purge mediawiki

I now need to install from the upstream and this is where I'm unsure on what next step to take. The main thing I'm concerned about is installing it in the most efficient way possible. I have zero experience with managing servers from a command line--and my command line knowledge is very limited in the first place.

There's a few questions I have in this regard which I was hoping someone could help me out with. I just need a few pointers in the right direction:

  1. Does installing the latest MediaWiki version from scratch on a TLK server imply I have to follow every single step listed here: http://www.mediawiki.org/wiki/Installing (?) For example I don't know whether I'd have to mess around with MySQL. I think those are still present on the server as I only removed the mediawiki appliance.
  2. Is there a way of installing the entire thing over the command line or do I have to upload the .tar.gz to the server and *then* perform the necessary operations?
  3. In relation to #2, have there been any changes over the last two years (since the time of writing for the post I linked), where someone can install the default mediawiki appliance and then upgrade through the command line?

I'd like to first set-up 1 MediaWiki server, take a snapshot of that, and then use it for the second one. I understand that going "upstream" means more maintenance time and potential security risks if I fail to update. These aren't issues.

Thank you for reading!

Optimae

Jeremy Davis's picture

But the other thing I would consider if I were you would be to start with the LAMP appliance rather than the Mediawiki one. The logic behind that suggestion is that if you use the LAMP appliance then iwhen you do a backup with TKLBAM all the Mediawiki files will also be included. This will make your backup larger, but will also mean that if you restore your backup (to a new TKL LAMP server) then it will work OOTB. Whereas if you restore to a Mediawiki appliance it will require tweaking and mucking around to get it all working again.

So assuming that you follow my suggestion (and start with a LAMP appliance) then the answers to your questions are:

  1. Yes pretty much (although you can start from step 1 - you don't need to install Apache, MySQL and PHP as they are all there in LAMP). Because you are creating a new install you may need to create a MySQL DB and Mediawiki user. If you are unfamiliar with MySQL then I suggest that you use phpMyAdmin (A MySQL WebUI that comes with TKL, it is accessable via https:<appliance-hostname-or-ip>:12322)
  2. If you download Mediawiki software from the commandline (i.e. via wget command) and then unzip (as described in install docs). then you can do it all from there (as in step 1 in those instructions). You can skip step 2 (as you don't need to upload files). In step 3, I'd sugggest that rather than chmod 777 (giving all users read/write/execute) you instead give ownership of the directories to www-data (the webserver user account). That would look something like this: chown www-data:www-data /var/www/whatever-folder 
    Bottom line is though that this probably won't make a huge difference, it's just better practice IMO
  3. Yes, but just my advice (i.e. use LAMP as base rather than Mediawiki appliance).

If you go this way then you should then be able to run a TKLBAM backup (or a snapshot) and start a fresh and all should be good to go! :)

If you have any issues post back and I'll try to help.

This is awesome! Thank you, Jeremy! I followed your advice to the letter and other than a small hiccup from a MediaWiki extension I'd enabled, everything worked smoothly. I've done the backup and everything. How can backing up be so ridiculously easy? I'm starting to "get" the whole TLK thing :).

For anyone reading this later and who wants to install their own MediaWiki 1.21+, these are the exact steps I carried out:

1. Start a new LAMP server
2. Login to Shell In A Box as root
3. wget the latest version of MediaWiki (download MediaWiki)
4. mv mediawiki-1.21.2 to w (rename folder)
5. mv w /var/www/ (I had installed it to /root)
6. cd /var/www/w (Navigate to the MediaWiki folder)
7. chown www-data:www-data /var/www/w (Set permissions to web account)
8. Browse to http://www.mywebsite.tklapp.com/w/index.php
9. Click the button to start installation script and follow instructions
10. Upload LocalSettings.php

(The above is for newbies like myself)

Jeremy Davis's picture

Glad it worked out for you!

And thanks for posting back with more detailed instructions, I'm sure someone will find that useful.

Charles Palanzo's picture

I guess after installing MediaWiki on Lamp you'd have to get the Semantic Bundle zip, decompress and install also? Has anyone done this?

Any way to use the Git install option?

Yes, get the bundle, decompress and then set it all up. I followed these steps: http://www.semantic-mediawiki.org/wiki/Help:Installation#Installation and didn't have any hiccups.

 

Charles Palanzo's picture

Okay... Sorry, I'm new to this will little experience - but some basics are not working.

I created the LAMP server, logged in as root using Shell in A Box.

Used wget to get Mediawiki - and confirmed it is downloaded use "ls" - but that's it only the zip is present.

There doesn't seem to be any other directories - no web server folders.. no /var/www

I tried "ls -d" ... nothing listed.

Apache is running according to my control panel.. not sure what I'm doing wrong.

Definitly logged in as root.

 

Jeremy Davis's picture

And the contents of the zip go in /var/www. Perhaps where you are getting stuck is that when you log in you default to your home folder (in the case of root that is /root). Just to add to the confusion / is the root folder and /root is root's home folder (i.e ~)

Charles Palanzo's picture

I did not see /var/www - the shell program seems to take some time before it recognizes the directories on Amazon EC2 servers... finally it all installed and worked.

However - I installed Mediawiki then went for Semantic Bundle... I found a problem - when you uncomment the various extensions in Semantic bundle the database will "fail" if you try and use "Approved Revs" because this requires a directory be created under the Wiki folder. If you follow instructions and remove the comment on the line - you fail. You have to comment this extension our - OR create the required directory.  Hope that saves some time for someone.

Thanks.

Post new comment