Archive for September, 2006

Converting from Gentoo to Debian

Preface

First off let me say that Gentoo is a truly fantastic distribution. It is high performance in so many ways, and it is an amazing teacher as well. The community rocks, the documentation rocks, and the concept rocks. However, inherent in the concept of "rocking" is an unstable nature. That is why, along with the social contract, our network administrator recommended switching to Debian for our production environment. See why we choose Debian?.

I was hesitant at first because my experience with Gentoo has been positive and I am comfortable with it. Jason, our network administrator, was very helpful in teaching me how to use Debian, and its been fine so far. The only difficulty I’ve found has been in custom compiling, such as kernels and PHP, which in our case require many customizations. The plus side to this is that I’ve learned how to create Debian packages so that we don’t have to compile, saving a lot of time and headaches in the process.

Thanks again to Jason for recommending the switch! Nice work.

Conversion Notes

To help others who may decide to make the switch, here’s what I’ve learned about the differences between Gentoo and Debian:

  • To compile a kernel, you need to at least install the gcc and ncurses-dev packages, probably others. This confused the hell out of me, but was easy to fix.
  • If you have many Apache virtual hosts, it should be easy to set them up in Debian. Just put them in /etc/apache2/sites-available/ (or presumably /etc/apache/sites-available/ if you are using Apache 1.x), then cd there, and run:

find ./* -exec a2ensite {} \;

I think Debian is stricter when it comes to VirtualHost directives, which is probably A Good Thing TM. They won’t let you mix up NameVirtualHosts with port directives and without port directives, so if you have *:443 for SSL, you will have to have *:80 for non-SSL vhosts.

I’ll post more as I make my way through the process.

iptables / netfilter firewall script

One thing I’d grown accustomed to on Gentoo was the iptables / netfilter firewall script setup. It was simple and straightforward, and the init script worked. IMHO, the best tutorial on setting it up on Gentoo is this:

Gentoo iptables / netfilter home router howto

I guess for awhile the setup was the same for Debian, but then the iptables init script was deprecated. I kept on finding pages on how to create your own init script, or use the deprecated one, but I wanted the up-to-date information. I finally came across a great tutorial on this at Debian Administration yesterday.

Debian iptables / netfilter gateway router howto

Have fun!

Postscript

Gentoo rocks. We will continue to use Gentoo in non-production machines, such as workstations and lab machines for testing new packages, software, and techniques. Megaprops to Daniel Robbins and the entire Gentoo team!

Energy Consumption

Understanding energy usage is becoming more and more important for consumers. Get the information you need! I user a Kill A Watt energy monitor. Plug it into an outlet, and plug in an appliance to it, and it will show you the energy usage on its LCD screen.

This has been helpful for me to setup a few uninterruptible power supplies, as well as learn about how much energy our computers use. Our computers use between 1-2 amps of power, which is a lot. I’d love to drop that down as much as possible.

How to save electricity
Informed Banking’s Tips on Saving Money: #2 - Reduce your energy consumption

Check out Green Computing Info for more about computer energy consumption.

Some PHP Notes




I’ve been working with PHP for about 8 years now, and here are my notes about php and php5.

As far as languages go, I don’t find there to be much benefit to one versus the other. However, and it a big however when used here, the user base for PHP is incredible. In addition to a great user base, PHP has a lot of other things going for it:

  • Great documentation
  • Simple syntax
  • Great server support
    • Apache
    • Lighttpd
    • Microsoft IIS

mod_rewrite seems to freak out when you use an Apache Directory directive, where it maps the %{REQUEST_URI} all the way back to the root of the filesystem. I’ve also noticed similar unexpeced behaviour in Apache when it uses the mod_vhost_alias VirtualDocumentRoot variable, the php $_SERVER[’DOCUMENT_ROOT’] variable doesn’t include the virtual host hostname. Ugh. I guess mod_rewrite and wildcard Directory directives do not work.

Docunext now has a blog.

We at Docunext have been writing articles using a php based content management system (CMS). To help in organizing our topics and facilitate the posting process, we’re starting to use the award winning Wordpress blog.