When first starting out with FreeBSD it can be frustrating when you are unable to find where the config files, where we can configure some things, or how to stop a service from starting up on boot.
In this article we will discuss some important directories and files in FreeBSD, and what is found in them. I assume at least you have understanding the basic of FHS (Filesystem Hierarchical Scheme) to get around the directory structure.
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 for configuring system every boot time such as defining the network card, the IP address whether use static IP or use DHCP, defining what daemon should be started, etc.
The variable contain _enable string is used to invoke the script for running some services or enabling some features. 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.
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 PER_VERSION=5.8.7 WITHOUT_X11=yes KERNCONF=MYKERNEL
The majority of config files for installed packages appear here.
Scripts for running installed service / application are stored here. To manually start or stop a program you can go here to do so
/usr/local/etc/rc.d/apache22 start /usr/local/etc/rc.d/apache22 stop
If you enabling some package on /etc/rc.conf, FreeBSD will search and execute appropriate script from here.