Sunday, 11 October 2009

How to Compile the Linux Kernel in GNU/Debian and Ubuntu

NOTE: Tested in GNU/Debian Sid. Ubuntu versions should also work.


OBTAIN KERNEL SOURCE CODE:

Obviously the first step is obtaining the source code.

It is recommended to place and build linux kernel source code in /usr/src directory, although it is not required.

We create our "Linux_Kernel_Source" directory for this task.
$mkdir Linux_Kernel_Source
$cd Linux_Kernel_Source


Linux kernel source code is freely available in Internet:
http://www.kernel.org
specifically, version 2.6:
http://www.kernel.org/pub/linux/kernel/v2.6

We download and uncompress latest source code (2.6.31 when this article was written):
#aptitude install wget bzip2 # packages needed to get the kernel source code and uncompress it.
$wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.tar.bz2

Uncompress the source:
$tar xvjf linux-2.6.31.tar.bz2

/usr/src/linux is a symlink to linux sources or at least linux kernel headers. It is required.
#ln -s linux-2.6.31 /usr/src/linux

$cd linux-2.6.31


KERNEL CONFIGURATION:

Sunday, 4 October 2009

Installing Mediawiki using SQLite Database in GNU/Debian

NOTE: These article commands have been tested in GNU/Debian Sid. They should also work in Ubuntu flavours.

First we need to install php, apache and SQLite if they are not installed. This command will do the trick:
#apt-get install php5-sqlite

Following mediawiki recommendation we add some extensions to php for SQLite to work:
Edit /etc/php5/apache2/php.ini
Add these two lines in that file:

extension=php_pdo_sqlite.so
extension=php_pdo.so


To solve servername warning when launching apache daemon:
#echo "ServerName localhost" >> /etc/apache2/httpd.conf

We start apache web server:
#apache2ctl start


DOWNLOAD MEDIAWIKI SOURCE CODE


#cd /var/www

We get latest mediawiki source code tarball (current one when writting this article is 1.15.1):
#wget http://download.wikimedia.org/mediawiki/1.15/mediawiki-1.15.1.tar.gz

Uncompress it:
#tar xvfz mediawiki-1.15.1.tar.gz
#cd mediawiki-1.15.1
#ln -s mediawiki-1.15.1 mediawiki

We set writting permissions to config directory so we will be able to configure our wiki:
#chmod a+w config


CONFIGURING THE WIKI