Category Archives: Ubuntu

nginx config file which works great with Codeigniter 2.0

This config file works great on Ubuntu 10.04 LTS server with nginx 0.7.65. Other software includes php 5.3.2, Code Igniter 2.0. Performance-wise I was able to squeeze 12,000 requests per second on static files and ~250 req/s on dynamic PHP pages.

This is a copy-paste from Chris Gaunt’s github page with a change in server name.

server {
    listen 8080;
    access_log /home/metak/;
    error_log /home/metak/;
    root   /home/metak/;

    # If file is an asset, set expires and break
    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
        expires max;

	# Serve the directory/file if it exists, else pass to CodeIgniter front controller
	location / {
		try_files $uri @codeigniter;

	# Do not allow direct access to the CodeIgniter front controller
	location ~* ^/index.php {
		rewrite ^/index.php/?(.*)$ /$1 permanent;

	# CodeIgniter Front Controller
	location @codeigniter {
		root /home/metak/;
		fastcgi_index index.php;
		include fastcgi_config;
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME /home/metak/;

	# If directly accessing a PHP file in the public dir other than index.php
	location ~* \.php$ {
		root /home/metak/;
		try_files $uri @codeigniter;
		fastcgi_index index.php;
		include fastcgi_config;
		include fastcgi_params;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


Posted by on October 2, 2010 in Linux, nginx, Ubuntu


Installing Ruby 1.8.5 on Ubuntu

Great how-to is located at Here’s the copy of it:

* Bring up the terminal, login as system root, and create temporary directory to store downloaded files.
[~/] su
[~/] mkdir local
[~/] cd local

* Download official source distribution. This will create a file named ruby-1.8.5.tar.gz in your local directory.
[~/local] wget

* Extract all the files from downloaded archive. This will create local/ruby-1.8.5 subdirectory that stores extracted files.
[~/local] tar xvfz ruby-1.8.5.tar.gz

* Install GNU C++ compiler you’ll need to build Ruby from source.
[~/local] apt-get install build-essential

* Run configure utility to determine your system configuration.
[~/local] cd ruby-1.8.5
[~/local/ruby-1.8.5] ./configure

* Run make command to compile and build Ruby.
[~/local/ruby-1.8.5] make

* Test newly built Ruby executable by running regression test suite. Upon successfull completion you’ll see a message like: “Finished in 44.904424 seconds. 1440 tests, 13585 assertions, 0 failures, 0 errors.”
[~/local/ruby-1.8.5] make test-all

* Install Ruby onto your system. This will move Ruby executable and utilities to /usr/local/bin and standard Ruby libraries to /usr/local/lib/ruby.
[~/local/ruby-1.8.5] make install

* Install Ruby documentation. This will compile Ruby documentation in format required for ri command.
[~/local/ruby-1.8.5] make install-doc

At this point the installation of Ruby 1.8.5 is complete. If you had previous version of Ruby installed in /usr/local/bin, you should take two extra steps:

* Make sure /usr/local/bin comes before /usr/bin in your $PATH:
[~/local/ruby-1.8.5] echo $PATH

* Logout from your current terminal session and login again to reload hashed value of ruby:
[~/local/ruby-1.8.5] which ruby
[~/local/ruby-1.8.5] ruby -v
ruby 1.8.5 (2006-08-25) [i686-linux]

Mike Dvorkin, Ruby Wizards Admin

Leave a comment

Posted by on February 10, 2007 in Linux, Ruby/Rails, Ubuntu


NetworkManager on Ubunty Edgy 6.10

I recently installed a Ubuntu 6.10 on USB stick.

Wireless worked like a charm. Network manager took some searching to do. So here it is


Posted by on January 5, 2007 in Linux, Ubuntu


Apache's ProxyPass on Ubuntu

  1. Install apache2. On Ubuntu type:
     # apt-get install apache2
  2. Activate mod_proxy:
     # a2enmod proxy
  3. Create a new file in /etc/apache2/sites-available, named metak (or whatever):
    NameVirtualHost *
    <Virtualhost *>
      DocumentRoot "/var/www/metak"
      ServerName localhost
      DirectoryIndex index.html index.phpProxyRequests On
      ProxyPreserveHost On
      ProxyVia full
        Order deny,allow
        Allow from all
      ProxyPass        /
      ProxyPassReverse /
  4. Enable the new site and restart apache2:
    # a2ensite metak
    # /etc/init.d/apache2 reload

Posted by on October 20, 2006 in Linux, Ubuntu


VMWare on Ubuntu 6.06

Great howto is located here:

It worked as described right out of the “box”.

Leave a comment

Posted by on July 17, 2006 in Ubuntu


Logitech MX-500 on Ubuntu 6.06

  1. Open your /etc/X11/xorg.conf
  2. Comment out the “InputDevice” part for the mouse. Add these lines:
    Section "InputDevice"
    Identifier "Logitech MX500"
    Driver "mouse"
    Option "InputFashion" "Mouse"
    Option "Protocol" "ExplorerPS/2"
    Option "Buttons" "10"
    Option "ZAxisMapping" "4 5"
    Option "Device" "/dev/input/mice"
    Option "Resolution" "800"
    Option "CorePointer"
    Option "ButtonMapping" "1 2 3 6 7"
  3. In the “ServerLayout” section change the mouse line to
    InputDevice "Logitech MX500"
  4. Optionally, comment out “stylus”, “cursor” and “eraser”, as they refer to the tablet.
  5. Save the file. Press CTRL+ALT+Backspace to restart GNOME.

Posted by on July 17, 2006 in Linux, Ubuntu

%d bloggers like this: