FreeBSD Install

Afterboot

Right after installation, you can login as root. Your default shell will be csh.

Before moving on, setup SSH so you can login as root remotely:

sed -ie 's/#PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
/etc/rc.d/sshd restart

Update the kernel and userspace, and then reboot the machine:

freebsd-update fetch
freebsd-update install

Install Ports Tree

Before installing any packages, let's bring the ports tree up to date. Depending on your install, you may already have a ports tree, but it will be outdated at this point.

Fetch the latest ports snapshot and update the tree:

portsnap fetch
portsnap extract > /dev/null

Configure Build System

Before building any ports from source, update the configuration for all builds:

echo BATCH=yes >> /etc/make.conf
echo WITHOUT_TEST=yes >> /etc/make.conf
echo WITHOUT_X11=yes >> /etc/make.conf

Base Install

Update timezone
cp /usr/share/zoneinfo/America/Denver /etc/localtime
echo ntpdate_enable=YES >> /etc/rc.conf
/etc/rc.d/ntpdate start

Utilities Install

Now that the base install is finished, let's move into the basic utilities.

Setup linprocfs for htop
echo linproc /compat/linux/proc linprocfs rw 0 0 >> /etc/fstab
mkdir -p /usr/compat/linux/proc
ln -s /usr/compat /compat
mount linproc

VMWare Guest Tools Install

Since this is probably a VMWare guest, install the tools so the server runs more smoothly.

cd /usr/ports/lang/perl5.16 && make install
cd /usr/ports/misc/compat6x && make install
cd && ftp http://beandog.org/vmware/guest-tools/vmware-freebsd-tools.tar.gz
tar -ozxf vmware-freebsd-tools.tar.gz && cd vmware-tools-distrib
perl vmware-install.pl

Disable Sendmail

  • Remove sendmail from startup

Add to /etc/rc.conf:

sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

And you can disable some sendmail specific daily maintenance routines in your /etc/periodic.conf file:

daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"

If /etc/periodic.conf does not exist please create it and add those values.