Mek Srunyu Stittri’s weblog.

Archive for October, 2007


Installing FreeBSD as a LAMP server; a beginner’s perspective

Monday, October 22nd, 2007

After months of using Fedora 6 for this site, I have finally decided to migrate to FreeBSD. It began when I was trying to install e-Accelerator; a php accelerator that helps speed up server response time. Surprisingly, the newest Fedora that e-Accellerator provided support for is Fedora 3. Then two more days later, apache was turning back on me. I had server timeouts and inactive page loads which were very very frustrating. Bad bad bad fedora. Finally, I decided that its time to ditch out the Redhat wannabe system and find something more solid and reliable. With suggestions from Thaya, I turned to FreeBSD.

Now I didn’t went out of the blue and explored everything on my own ( who does that nowadays ?? lol ). I refered to Thaya’s FreeBSD Walkthrough and this very nice and detailed FreeBSD Installation Guide from Openaddict ( with screenshots yes!!! ).

Okay, the first step is to acquire the installation cd image from FreeBSD.org. Get yours here. I went with 6.2 stable at the time. As I have been suggested for installing servers, its always good to go with the minimum install and add stuff back on later. By doing we are sure that the system is streamlined and lean without any junk. :D Once you are in as root, then we can start adding up the packages. The following add packages for bash shell, cvsup and vim.

# pkg_add -r bash
# pkg_add -r cvsup-without-gui
# pkg_add -r vim6

Note: pkg_add -r vim doesn’t work any more. I guess they re-organized the packages so use vim6 instead.

Next we set bash as our shell and copy the two sup-files to be used in setting up cvsup connections to root.

# chsh -s bash; bash
# cp /usr/share/examples/cvsup/standard-supfile /root
# cp /usr/share/examples/cvsup/ports-supfile /root

Now in these two files, we have to configure the mirror servers in which cvsup will update the source of FreeBSD and the snapshot of the ports tree. So fire up that good old vi and edit these lines.

* default host=CHANGE_THIS.FreeBSD.org

CHANGE_THIS will have to be replaced with the cvsup server. I use cvsup6 so mine is :

* default host=cvsup6.FreeBSD.org

If you are not sure what to use, look up the mirrors list here. Make the change to both files and save. Now we will download the source from the mirrors. Lets see whether the mirror that you chose is working or not lol.
Note: -g means without gui and -L 2 tells cvsup to print all the details of the files and process.

# cvsup -g -L 2 /root/standard-supfile

It will take a while. Once done, pull down the snapshot of the ports tree by doing this :

# cvsup -g -L 2 /root/ports-supfile

I skipped the recompiling the kernel part. So i went straight to add wget and ncfpt.

# pkg_add -r ncftp
# pkg_add -r wget

Then add up the users with :

# adduser [username]

That’s it!! You have finished installing FreeBSD. Easy right ??? who said FreeBSD is hard to install. :)

Oh and one last thing, you should copy the vimrc file to vim’s configuration folder too. If you don’t have one, the vim package offers a default one. If you are having problems with vim’s keyboard mapping then you should use it for the time. Do this.

# cp /usr/local/share/vim/vim64/vimrc_sample.vim ../vimrc

So basically we are copying the vimrc sample file up one level and renaming it to vimrc. This way it affects all the user of the system. If you want the change to happen only to your account, change the destination to your home directory and rename the file .vimrc. Now you are all set, next will be installing the AMP part, which is Apache MySQL and PHP.



When I was still a Bassist

Tuesday, October 2nd, 2007

My old band performing at FMR3 ‘Full Metal Romance’
The guy in the middle is me :)

“Minerva” / “In August” is or was
Kang: Vocal
Guide: Guitar
Mark: Guitar
Mek: Bass
Pang: Drums

Thursday - a hole in the world, cover by In August.

Thursday - Wind up, cover by In August.