How to enable upload files into MediaWiki on Debian

As you know from my previous posts on this blog I am running MediaWiki on Debian GNU/Linux 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 MediaWiki by users.

This is very simple and easy task. You will need just log on to your Debian Gnu/Linux 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 MediaWiki 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 MediaWiki 🙂

More info on features and functionality – check MediaWiki official Article