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.
http://www.mediawiki.org/

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
http://releases.wikimedia.org/mediawiki/

Find the latest version available and copy its address. Currently the newest version is 1.24. http://releases.wikimedia.org/mediawiki//1.24/mediawiki-1.24.1.tar.gz

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 http://releases.wikimedia.org/mediawiki//1.24/mediawiki-1.24.1.tar.gz
$ 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 www.yoursite.com/~username/mediawiki-1.24.1
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

Introduction

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.

Interface

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:
  • id_dsa.pub
  • id_ecdsa.pub
  • id_ed25519.pub
  • id_rsa.pub
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 "your_email@example.com"
# 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/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
Install xclip
sudo apt-get install xclip
Copy your ssh key
xclip -sel clip < ~/.ssh/id_rsa.pub
Enter it to Bitbucket page. 


Then configure your Git repo.

Create folder 
$mkdir code 
$cd code
$git init
$git config --global user.email "yourmail"
$git config --global user.name "yourname"

Then add your repository
$git remote add origin git@bitbucket.org:yourname/repo.git

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://new.url.here