Skip to main content

Posts

Showing posts from 2009

Setting up xen with nat and dhcp in debian lenny (5.0)

Information on setting xen with NAT in debian lenny is scattered over the internet. One resource mention about patching some files. This guide is for people who want to do the setup with the most minimal change to debian default setup. 1. In /etc/xen/xen-config.sxp, comment (put # in front of) the "(network-script network-dummy)" and "(vif-script vif-bridge)". Comment out (erase # in front of) the "(network-script network-nat)" and "(vif-script vif-nat)". 2. Put "brctl addbr $2" after the line saying "echo $*". Then put "ifconfig $2 xxx.xxx.xxx.xxx" at the end of the file, where xxx.xxx.xxx.xxx is a local static IP address. 3. Set up your dhcp server accordingly by have it listen to the interface, the default is xenbr0. The ip of xenbr0 will be automatically set to xxx.xxx.xxx.xxx from step 2 above. Restart your dhcp server if necessary. 4. Run your xen image. 5. Then restart ipmasq by running /etc/init.d/ipmasq...

Ruby on Rails with Postgresql on Debian/Ubuntu

Based on the information scattered here and there, if you want to use postgresql with Ruby on Rails on Debian/Ubuntu, you can use 2 approaches: The first approach based on various places and experiment is 1. Set adapter of database.yml to postgresql. 2. Install postgresql-server-dev-?.? (?.? = 8.3 in Debian Lenny). 3. Install the pg gem with "gem install pg" The above approach has been tested. Another approach based on http://www.williamchu.com/blog/?p=9 1. Set adapter of database.yml to jdbcpostgresql 2. Install the activerecord-jdbcpostgresql-adapter with "gem install activerecord-jdbcpostgresql-adapter jdbc-postgres " I don't bother to test this approach since it's using jdbc, which means another layer of complexity. But this might be useful if you use JRuby. In addition, this approach should work on other linux distro.

Installing ruby 1.9 from source on debian/ubuntu, the rubygem/zlib/ssl problem

Since I noticed some people experienced the same problem, and the solution to this is scattered into multiple posts/comments, I'll just integrate it here. Basically if you install ruby 1.9 (or probably other versions) from source in Debian based distribution (like Ubuntu), the zlib part of Ruby won't be installed. This problem will reveal itself when you want to install Rubygems, for example Rails for Ruby on Rails. The solution is: 1. Clean up all that failed compiled files in the directory where you run "make". Just to be on the safe side. 2. Install zlib headers (zlib1g-dev in Debian Lenny) using your distro package manager. 2a. While you're at it, also install ssl headers (libssl-dev in Debian Lenny) using your distro package manager. 3. Run "./configure", "make", "make install". 4. Run "./configure", "make", "make install" again. It should work then. In my understanding, the problem is caused by Ruby...