keskiviikko 25. helmikuuta 2015

How To Install MediaWiki on user directory

MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia. It is now also used by several other projects of the non-profit Wikimedia Foundation and by many other wikis, including this website, the home of MediaWiki.

Now I am going to install MediaWiki on my personal server. To install MediaWiki you will need a LAMP stack = Linux, Apache, MySQL, PHP. Possibly ssh connection.

Step 1

First head over to

Find the latest version available and copy its address. Currently the newest version is 1.24.

Copy that address and then head over to your user public_html folder. Use commands wget to download and tar to untar the file:

$ wget
$ tar xvfz mediawiki-1.24.1.tar.gz

You may need to restart your apache

$ sudo service apache2 restart

Step 2

Create MySQL table and user.

$ mysql -u root -p
$ create database my_wiki;
$ grant index, create, select, insert, update, delete, alter, lock tables on my_wiki.* to 'wikiuser'@'localhost' identified by 'password';
$ flush privileges;
$ exit;

step 3

head over to your MediaWiki site
Click install and insert all things asked. 
When your install is finished MediaWiki will automatically download LocalSettings.php file. Upload this file to the root of your MediaWiki installation.

Step 4 Enjoy your MediaWiki site

Step 5 Images / Uploads

To allow image uploads to your mediawiki site you need to edit LocalSettings.php file and give chmod 777 to images folder. 

$nano LocalSettings.php 
Set line $weEnableUploads = true;
$ chmod 777 images/


keskiviikko 4. helmikuuta 2015

Trying Bitbucket


Bitbucket is like Github. Which one should I use? Both GitHub and Bitbucket offer great Git services, but each has its own features and pricing plans.

Answer, use both. Use GitHub for open source and public repos and Bitbucket for private repos.


Bitbucket dashboard

Github dashboard
To start using Git service with Linux operating system, install Git first.

$ sudo apt-get install git

Step 1: Check for SSH keys
First, we need to check for existing SSH keys on your computer. Open up your Terminal and type:
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
Check the directory listing to see if you already have a public SSH key. The default public key file names are:
Step 2: Generate a new SSH key
To generate a new SSH key, copy and paste the text below, making sure to substitute in your email address. The default settings are preferred, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.
ssh-keygen -t rsa -C ""
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/you/.ssh/id_rsa):

Next, you'll be asked to enter a passphrase.
# Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]
Which should give you something like this:
# Your identification has been saved in /home/you/.ssh/id_rsa.
# Your public key has been saved in /home/you/.ssh/
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db
Install xclip
sudo apt-get install xclip
Copy your ssh key
xclip -sel clip < ~/.ssh/
Enter it to Bitbucket page. 

Then configure your Git repo.

Create folder 
$mkdir code 
$cd code
$git init
$git config --global "yourmail"
$git config --global "yourname"

Then add your repository
$git remote add origin

Add all files to git in your local repo. Then commit changes.
$git add .
$git commit -m "testing git"

Push files to Bitbucket
$git push -u origin master

If you somewhere encounter problem "fatal remote origin exists" set it again with command:

git remote set-url origin git://