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.
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.
- Install MacPort
- Install MySQL
- Install PHP and Apache
- Install MediaWiki
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.
sudo port install mysql5-server
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
PHP and Apache are web software where makes a place for MediaWiki. These can be installed using MacPort.
sudo port install php54 php54-apache2handler php54-mysql
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
DirectoryIndex index.php index.html
sudo cp /opt/local/etc/php54/php.ini-production /opt/local/etc/php54/php.ini
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
1. Download MediaWiki at this site. http://www.mediawiki.org/wiki/Download
sudo tar -zxvf ~/Downloads/mediawiki-1.20.2.tar -C /opt/local/apache2/htdocs
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.