vnStat on FreeBSD 7 with PHP GUI (howto)

This tutorial exlains how to set up vnStat on FreeBSD 7. vnStat is a console-based network traffic monitor that keeps a log of hourly, daily and monthly network traffic for the selected interface(s).

vnStat itself is a console mode only, but this howto explains how to set it up with vnStat PHP frontend.

Link to howto (howtoforge.com)

Add greylisting to a FreeBSD Postfix Mail Server (howto)

Greylisting is an important tool in the war against spam.  Servers who connect to a mail server with an active greylisting are given a 450 recipent address rejected error the first time they try to connect and will not be allowed to successfully connect for a predefined time frame (normally a couple of minutes). A 450 SMTP error is not a permanent error and an RFC compliant mail server will try and resend the email again a bit later on. On the other hand the tools spammers tend to use do not adhere to standards and will not bother to retry sending the message again.

More…

Setting up LAMP on FreeBSD (howto)

Referring to “LAMP” with regards to FreeBSD doesn’t make sense, but anyway, that’s how the author titled this howto “Setting up LAMP on FreeBSD“.

I’m not complaining, it’s always nice to see FreeBSD related article on Linux.com ;-)

Setting up a LAMP server is a common task for systems administrators, and FreeBSD is one of the most reliable and stable operating systems available. You can swap out the L in LAMP with F for FreeBSD to build a fast and reliable Web server.

In this article I assume FreeBSD is already installed. If not, make sure you download the latest stable production version of FreeBSD and run the installer. I recommend choosing the MINIMUM option at the installer screen to quickly install only the most basic and necessary things.

To install applications on FreeBSD, use the ports files. Ports are plain text files that know where to download source code, so that the software will be compiled on your computer. This way you can change settings (including or excluding specific modules) as you want, and the software will fit perfectly to the specifications of your computer. First, you have to make sure that the latest ports files are installed. If you’ve never installed the ports, issue portsnap fetch extract in the shell; otherwise, issue portsnap fetch update. This will download the latest ports files. After a bunch of messages that show you what files have been downloaded, you’re ready to go.

more…

Source: Linux.com (31/07/2008)

FreeBSD News – quick links (week 16)

Howto’s

Interesting pages

MySQL 6.0 installed on FreeBSD

The other day I came across some neat instructions on how to set up FreeBSD with MySQL 6.0. It’s pretty straight forward:

  • Download MySQL 6.0 here

  • Extract the files to /usr/local/mysql

  • Add MySQL group "groupadd mysql"

  • Add MySQL user "useradd -g mysql mysql"

  • Change the permissions with "chown mysql -R /usr/local/mysql" from /usr/local/mysql run "scripts/mysql_install_db --user=mysql"

  • Change the permissions again "chown -R root ." and "chown -R mysql data"

  • Now run the server "bin/mysqld_safe --user=mysql &"

Source: FreeBSD World

Creating and Managing A Jailed Virtual Host in FreeBSD

It is possible to spawn a completely jailed second (or many!) operating system within a modern FreeBSD install. Doing so can be tricky, but here I will document the method that I have found works for me. The first most important resource about jails, is the man page, and many of the examples that you will see are basically straight following of the man page. Once you are done, each jail will operate as if its a complete independant operating system.

Scope Of This Document

This Howto article is intended to be a practical example, and I will start my host system with FreeBSD 6.2-RELEASE. The Install will be of the “minimal” variety, and for the first part of this document, we will not update the system with buildworld. After a jail is created, we will then update the host, and then update the jail. This will demonstrate a practical example of how to build, and then maintain a jail thru critical security releases.

Further instructions

Using daemontools (supervise) on FreeBSD

What is daemontools?

From the daemontools website:

daemontools is a collection of tools for managing UNIX services.

supervise monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all supervise needs is a directory with a run script that runs the service.

At first when I was introduced to this tool at work, I thought “What a typical Linux-admin. FreeBSD’s rc. system is superior.” Despite my personal preferences, whatever software is used at work is what I have to use and learn to use, too. After getting a little more familiar with supervise, and installing it on a FreeBSD server, I was finally convinced that this may also have a place on FreeBSD machines.

Have you ever needed to know that a process is 100% sure to be running no matter what? Well, some of our applications need that extra little safety net, and you might too. Just right of the bat I can mention things like httpd, sshd, denyhosts, and syslog(-ng). While the theoretical risk of these applications crashing randomly and still being able to run again without any direct editing of some configuration file seems to be very low, in a production environment where loads are extremely high and all processes are pushed into a stage where their theoretical load-handling capacity is on the edge with what has practically been tested, this may happen to you – and you can’t afford the service being down until you figure out a way to fix it permanently.

Either way, if some application crashes in a recoverable manner, it’s most likely that either 1) supervise is still running and will try to revive the process or 2) your box is so broken, it doesn’t even matter that supervise is still running. It’s all about that extra little factor of reliability.

Convinced? Here’s the walkthrough