MediaWiki


Mediawiki is a web software that was made for Wikipedia. But one can install it to one’s own server to have a personal Wiki. Since Wiki is good for storing information about things, one can use it for storing personal research which can be a great help in the future.

Even if there one does not have a server, one can install it to one’s notebook. So I will introduce how this can be done.

image: https://lifetrg.files.wordpress.com/2013/02/0_users_jbkim_dropbox_blog_mediawikimac_mediawiki1.png


Steps in installing MediaWiki


Installing MediaWiki itself is quite easy, but there are a few web software that need to be installed before installing MediaWiki. Of course the software can be installed by different methods than written below.

To install MediaWiki (Version 1.20.2), one needs to install Apache, PHP (5.3.5+ version), and MySQL (5.0.2+ version). These software can be installed using MacPort. So to install MediaWiki the below steps must be done.
  1. Install MacPort
  2. Install MySQL
  3. Install PHP and Apache
  4. Install MediaWiki


1. Install MacPort


image: https://lifetrg.files.wordpress.com/2013/02/1_users_jbkim_dropbox_blog_mediawikimac_macports1.png

MacPort can be downloaded from http://www.macports.org/install.php. It is relatively easy to install. So I will not explain about how it can be installed. Of course a problem can occur while installing MacPort. But if one searches the internet, the solution can be found easily.


2. Install MySQL


MySQL is the place where MediaWiki stores it’s data. One can use MacPort to install it.

1. Install MySQL using the below command in the terminal
sudo port install mysql5-server

2. Setup MySQL using the below command in the terminal
sudo /opt/local/lib/mysql5/bin/mysql_secure_installation

3. Run and make it run at startup using the below command in the terminal
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist


3. Install PHP and Apache


PHP and Apache are web software where makes a place for MediaWiki. These can be installed using MacPort.

1. Install PHP and Apache using the below command in the terminal
sudo port install php54 php54-apache2handler php54-mysql

2. Setup PHP in Apache using the below command in the terminal
cd /opt/local/apache2/modules 
sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php54.so

3. To make the .php file run in Apache, one has to edit /opt/local/apache2/conf/httpd.conf. Open /opt/local/apache2/conf/httpd.conf and find the below line.
LoadModule php5_module modules/mod_php54.so
Write the below line under it.
AddHandler application/x-httpd-php .php

Also find DirectoryIndex and change it like below.
DirectoryIndex index.php index.html

4. Create the PHP setup file using the below command in the terminal
sudo cp /opt/local/etc/php54/php.ini-production /opt/local/etc/php54/php.ini

5. Open /opt/local/etc/php54/php.ini and find the below lines.
mysql.default_socket = "" 
mysqli.default_socket = ""
pdo_mysql.default_socket = ""
Change these lines as below.
mysql.default_socket = /opt/local/var/run/mysql5/mysqld.sock
mysqli.default_socket = /opt/local/var/run/mysql5/mysqld.sock
pdo_mysql.default_socket = /opt/local/var/run/mysql5/mysqld.sock
3. Run and make Apache run at startup using the below command in the terminal
sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist


4. Install MediaWiki


If you have came until here, installing MediaWiki is relatively easy.

1. Download MediaWiki at this site. http://www.mediawiki.org/wiki/Download

2. Extract the file to /opt/local/apache2/htdocs using the below line in the terminal
sudo tar -zxvf ~/Downloads/mediawiki-1.20.2.tar -C /opt/local/apache2/htdocs

3. Change the directory name to your wiki’s name using the below line in the terminal
sudo mv /opt/local/apache2/htdocs/mediawiki-1.20.2 /opt/local/apache2/htdocs/wiki

4. Open http://localhost/wiki/index.php using a browser to setup MediaWiki.

5. After setting up MediaWiki, the LocalSettings.php file will be downloaded. It should be copied to /opt/local/apache2/htdocs/wiki by using the below line in the terminal
sudo mv ~/Downloads/LocalSettings.php /opt/local/apache2/htdocs/wiki

6. After that, open http://localhost/wiki/index.php using a browser to see your newly installed MediaWiki.
Advertisements