Saturday, December 27, 2008

Configuration files: defaults or from scratch?

Up until recently I was a big fan of throwing away configuration files bundled with software such as apache, freeradius, etc., and write one from scratch to ensure i understood every single line.

My new approach is to leave configuration files at the defaults as much as possible. This makes it possible for other administrators to sit down and start editing the file and recognize the structure from other setups. It also makes it easier for package management systems to make diffs and indicate what has changed in new versions of the default configuration files when updating software (at least this is how Portage in Gentoo works).

A big disadvantage of this second approach is however, that it makes it difficult to get an overview of the configuration.

Which approach is best?

Friday, December 26, 2008

Netbeans and PHP projects over network shares

While trying to edit a bunch of existing PHP files in NetBeans, I had a little struggle getting the project set up correctly in NetBeans. There exists a project type called “PHP Application with Existing Sources”, and there exists a “Put NetBeans metadata into a separate directory”, but this latter feature does not work as I expected. If I try to set source directory to the Windows network share where my PHP scripts reside, and set metadata directory to a local directory to avoid filling the network share with metadata specific to this particular computer, NetBeans gives the error “Project and Source directories cannot be relativized”. It expects source and metadata directory to be on the same logical drive, or in the same network share.

To overcome this I created a symlink in my homedir on my server (a Linux box), pointing to the directory containing the PHP scripts. I could then set the source code folder to \\myserver\homes\mySymlink, and metadata folder to \\myserver\homes\tmp\netbeansjunk.
Hope this is useful to someone...