How to enable upload files into MediaWiki on Debian

As you know from my previous posts on this blog I am running [easyazon-link asin=”1847196047″ locale=”us”]MediaWiki[/easyazon-link] on [easyazon-link asin=”1593270690″ locale=”us”] Debian GNU/Linux [/easyazon-link] server and users are authenticated against Active Directory on Microsoft SBS 2008 server. Last time I did not allow to upload any files into MediaWiki but as the time progress and you start using the platform, you will need to enable upload files such .jpeg, .png or ppt into [easyazon-link asin=”B0043EWTTY” locale=”us”] MediaWiki [/easyazon-link] by users.

This is very simple and easy task. You will need just log on to your [easyazon-link asin=”B00005R099″ locale=”us”] Debian Gnu/Linux [/easyazon-link] or whatever Linux server you run and navigate to your installation folder for MediaWiki. In my case, I have created the installation under /var/www/wiki. At this folder use any of your favorite editors and open LocalSettings.php file. This is the file which control your MediaWiki installation. One you have it open, you will need edit 2 lines and add this line as show bellow:

su
cd /var/www/wiki
gedit LocalSettings.php

Now you edit the LocalSettings.php file with this:

# enable upload of files
$wgEnableUploads = true;
$wgUseImageMagic = true;
# Add this line and select what type of files you allow to upload
$wgFileExtensions = Array ('png','jpg','jpeg','svg','doc','ppt');

Once you saved your editing you will need to complete this with additional two steps. You will need assign permissions to /image folder where the uploads are going and restart your Apache server and once the users log off and log on to [easyazon-link asin=”0470126906″ locale=”us”] MediaWiki [/easyazon-link] they will have now option to upload files with the extensions type you have allowed.

# add the permisions for /images folder in MediaWiki so it is writable
su
chmod -R a+rwx images
# restart Apache server
cd /etc/init.d
./apache2 restart

Once this is done, your users can use the feature and upload the files into [easyazon-link asin=”1847195202″ locale=”us”] MediaWiki [/easyazon-link] 🙂

More info on features and functionality – check MediaWiki official Article

[easyazon-image align=”none” asin=”1904811590″ locale=”us” height=”160″ src=”http://ecx.images-amazon.com/images/I/51D0A-uBg5L._SL160_.jpg” width=”130″]

Leave a Reply