"Le cordonier est le plus mal chaussé" would be a great analogy of me and my web presence right now.

Thursday, September 30, 2004

Two Years

Today it's been two years since Melissa and I have been together. It's amazing how time flies. I believe that I've become a better person since knowing Mel. My life has certainly taken a turn for the better. I'm happier, more confident, and I grew up a lot as a person.

Thursday, September 23, 2004

Desktop Screenie

Screenshot

Click on the image to see the full version.

Wednesday, September 22, 2004

Arch Linux

I've been thinking about my re-entry into the GNU/Linux world recently. I've been yearning for a *nix workstation, and I've been debating whether to go for Linux or FreeBSD. It's been a year and a half since I last used Linux. In the mean time, I've grown more comfortable with FreeBSD.

I love the FreeBSD system. However, I decided to go for Linux on my workstation because:

1) FreeBSD is moving to version 5.3, and the ports tree has been frozen. That means that there is no xorg 6.8 and no Gnome 2.8 in the ports tree yet. And I've been meaning to try these. I could wait for a few weeks till this happens, but then there's also issue number 2.

2) Even though FreeBSD also has binary package management, it is really more source-based. For servers, source-based package management is great: you need a lot of flexibility and you often need to define compile time arguments. However, for a workstation, binaries are fine. And I'm sick of waiting for hours while my software compiles. For what? A 2% performance gain? Not worth the agravation.

So I decided to go with Arch Linux. I briefly considered gentoo. But like I said, I'm getting sick of waiting for my software to compile. But I still wanted to be able to install bleeding edge packages, and Arch seems flexible enough for that. Plus I've heard good things about it.

So I installed Arch today. There's not much hand-holding during the installation and initial system configuration, but it's pretty straight forward. The manual is light years behind FreeBSD's, but it gets the job done. The installation is ncurses-based, like FreeBSD's. However, it's not as polished as the latter (which isn't that polished either, with x-server configuration issues). But then you only install an OS once in a blue moon anyway. My initial encounter with pacman (the package management system) was positive. It seems to work as advertised. And it's definitely much faster to install binaries than to compile from source.

However, I've hit a snag with Gnome. There seems to be a problem with libcroco. This isn't too encouraging. Gnome is partially fubar as a result. Don't these people test packages before making them available to pacman? It seems that Arch's QA isn't up to par with FreeBSD. Very disapointing. I guess I've been spoiled by FreeBSD's stability and maturity.

My initial impression of Arch is mixed. It's austere, a bit like FreeBSD, and I like it that way. I like pacman in principle. However, I'm not convinced that updating will be painless if Arch's QA let's it down. I'll give it a few weeks, then decide whether Arch is worth my time or not. I'm keeping an open mind.

Monday, September 13, 2004

FAMP (FreeBSD, Apache, MySQL, PHP)

[Edit]I have an updated version of this article here[/Edit]


It's extremely easy to set up a PHP-aware web server in FreeBSD. Here's a quick how-to using the FreeBSD's ports system. The advantage of using the ports system is that updating the server is painless when new versions of the software come out. We'll install the latest version of Apache 1.3, the latest version of MySQL 4.0 and the latest version of PHP 5.

MySQL
Install MySQL first:

cd /usr/ports/databases/mysql40-server
make install clean


Apache
Install Apache with SSL support:

cd /usr/ports/www/apache13-modssl
make
make certificate

Follow the prompts to create the certificate. When you’re done, continue with the installation:

make install
make clean


PHP5
To install mod_php5:

cd /usr/ports/www/mod_php5
make install clean

Install PHP extensions (e.g MySQL support):

cd /usr/ports/lang/php5-extensions
make install clean

A ncurses menu will appear. Select whatever you need from the options.


Post-Installation Configuration
Edit the Apache configuration file /usr/local/etc/apache/httpd.conf and add these lines in the file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Look through the file and edit the configuration to suit your needs. Next create a php.ini configuration file from the php.ini-recommended example configuration:

cd /usr/local/etc
cp php.ini-recommended php.ini

Again, look through the configuration file and see if you want to change anything. Next, configure your MySQL server. By default, no password is set for the MySQL root user. You should set a password for that user at this point:

mysqladmin -u root password "newpassword"

Replace "newpassword" with your own. MySQL comes with two anonymous accounts set up. These accounts don't have any passwords assigned by default. It is a good idea to just delete them. At the MySQL prompt, issue the following command:

delete from mysql.user where user = '';
flush privileges;

You may want to use a tool such as MySQL Administrator from a workstation on your network. In order to connect to the MySQL server from your network, you need to give the user whom you want to connect as the required priviledges. For example:

GRANT ALL ON *.* TO root@'192.168.0.%' IDENTIFIED BY 'yourPass';

To exit from the MySQL prompt, just type "exit".

Controlling your servers
You can start, stop or restart Apache by issuing the following commands:

/usr/local/etc/rc.d/apache.sh start
/usr/local/etc/rc.d/apache.sh stop
/usr/local/etc/rc.d/apache.sh restart

You can start or stop the MySQL server by doing:

/usr/local/etc/rc.d/mysql-server.sh start
/usr/local/etc/rc.d/mysql-server.sh stop

The system will use the apache.sh and mysql-server.sh scripts to start Apache and MySQL the next time you reboot as well.


References
http://dev.mysql.com/doc/mysql/en/Default_privileges.html

Sunday, September 12, 2004

Installing FreeBSD – Some Pointers

This is an introduction to FreeBSD that I’ve posted to the discuss@linux.mu mailing list. It may be helpful to somebody, so I’ll post it here too. It’s not very structured (it can be downright random even) and is not meant to be a tutorial. It’s only meant to give the reader a general feel for FreeBSD, give some pointers for a first installation, and highlight some gotchas.

One gotcha that you should be aware of is the fact that the xfree configuration from the installer (sysinstall) may be broken - it's never worked properly for me. So, just skip xfree configuration during the install. Do it after (easier anyway). I will be a waste of time installing the xfree that comes with the CD anyway, since it is outdated by now. You may also want to install xorg rather than xfree, and xorg is not on the FreeBSD release CD.

The best way to set up FreeBSD is to do a minimal install (plus cvsup and the ports system), update the OS, then start installing applications. However, be aware that updating the OS with the latest sources involves downloading the new sources - a pain on dialup. Re-compiling the world may take a few hours on old hardware. Note the distinction here. FreeBSD is an OS, Linux is a kernel. Updating the core of your FreeBSD system involves building a new kernel plus also building all the userspace utilities from updated sources.

Once you've updated the core of the OS, you can install other applications by compiling from source or by getting the binaries. At this point you'd probably want to install bash, xorg (or xfree), a desktop environment / window manager, and whatever else you need. Be prepared to spend a lot of time downloading stuff.

Some miscellaneous points:

1) /etc/rc.conf is the main configuration file for the system.

2) /etc/inetd.conf is where you can configure some internet services such as ftp, identd etc. Just look through the file and uncomment whatever you need.

3) To get you started, you will find it useful to read up on the following: cvsup (understand the different development branches that you can track, and decide which one is best for you), the ports system, portupgrade, how to build a new kernel (easy), how to build the world (easy). Look for Dru Lavigne's articles on the ports system and portupgrade on http://www.onlamp.com/bsd/. These are very helpful and well-written.

4) Firewalling in FreeBSD 5.x is done using either: ipfilter, ipfw, ipfw2, or pf. I recommend pf. It's in very active development, and has all sorts of goodies like bandwidth shaping, failover firewalling, OS fingerprinting (who's connecting to your box) through network stack identification, etc. It's also been ported from OpenBSD to FreeBSD and NetBSD - an indication that developers hold it in high regard. If you use iptables on linux, you'll find pf pretty easy to learn. pf is not installed by default. It is easy to install it though:

Install the /usr/ports/security/pf port:

cd /usr/ports/security/pf; make install clean

Then edit rc.conf and add the lines:

pf_enable="YES"
pf_logd="YES"
pf_conf="/usr/local/etc/pf.conf"

These lines will cause the system to load the pf kernel modules when you reboot. Write your firewall rules in /usr/local/etc/pf.conf. As a rule, configuration files for software that you install will go into /usr/local/etc. Configuration files for the base system live in /etc. Startup scripts (read on a reboot) for daemons that you install will go into /usr/local/etc/rc.d. To manually start pf, do ”/usr/local/etc/rc.d/pf.sh start". You can control pf from the command line by using pfctl (man pfctl for more details). Use tcpdump if you want to monitor the log in real time. You may also be interested in pftop (/usr/ports/security/pftop).

5) Whenever you cvsup, read /usr/ports/UPDATING. From time to time there may be some issues that you need to be aware of, and these will be written in the file. Definitely read the file after the first time you update your sources with cvsup. There are some gotchas that you will want to be aware of. It will save you a lot of grief.

6) FreeBSD has a Linux binary compatibility layer that enables you to run linux binaries. It is very fast, so don't worry about performance hits. It's very helpful for things like the macromedia flash plugin. Macromedia doesn't release one for FreeBSD, but FreeBSD can use the Linux version.

7) Take your time, read the FreeBSD handbook. It's good that you will have access to your desktop system while setting up FreeBSD on the laptop. It's a good idea to subscribe to the different mailing lists. If you have any questions, you can ask the folks in the FreeBSD-questions mailing list. Please don't post questions to FreeBSD-newbies.

The big difference that you will notice between FreeBSD and mainstream Linux distros (like mandrake, fedora, suse) is the fact that with FreeBSD you usually end up installing a minimal system, updating it with the latest sources, then "growing" the system by installing an x-server and other applications. You can maintain an up to date system - latest x-server, latest desktop environment, applications very easily (portupgrade -arR). That's why gentoo users love gentoo as well.

Monday, September 06, 2004

Virtual Comminity Design Update

Mock Up

Mock Up Close

The latest design for the virtual community project that I'm doing. I've tried to make the design appeal more to the younger crowd.

Wednesday, September 01, 2004

Online Portfolio

I've whipped up a temporary online portfolio to show some of my work. It's available at http://members.iinet.net.au/~zhane