Web www.freebsdmadeeasy.com
Main Menu

FreeBSD Basics

When first starting out with FreeBSD it can be frustrating when you are unable to find where the config files went on a port you just installed, or how to stop a service from starting up on boot. In this tutorial the important directories in FreeBSD, and what is found in them will be explained inorder to give you a basic understanding of how to get around the directory structure.

/etc/rc.conf

The rc.conf file normally looks something like this

hostname="host.mydomain.com"
ifconfig_xl0="DHCP"
linux_enable="YES"
moused_enable="YES"
nfs_client_enable="YES"
sshd_enable="YES"
usbd_enable="YES"

It is used during start up and is responsible defining the network card and the ip address or if it uses DHCP. This file also contains the _enable variables for many packages on the system. With inetd now disabled by default in FreeBSD many packages have start up scripts that only allow the program to start if it is specifically enabled in the rc.conf file. A few of these programs are: bind, mysql, and apache.

For the network setup it is okay to have several different lines for the same network card, only the last one is actually used.

/etc/make.conf

make.conf is a good place to store variables that the ports use so that you do not have to define them in the command line everytime you install a port that uses one.

PERL_VER=5.8.7
PERL_VERSION=5.8.7
WITHOUT_X11=yes
KERNCONF=PLATO

/usr/local/etc

The majority of config files for installed packages appear here.

/usr/local/etc/rc.d

Scripts ending in sh are run at start up if they are in this directory. To manually start or stop a program you can go here to do so

# sh mysql-server.sh stop
# sh mysql-server.sh start

/usr/ports

The ports collection is a directory of makefiles for a large number of common programs.