Newsflash

W32.Noddaba
Infostealer.Scrapkut
TheLastDefender
W32.Vimm
MORE INFO

 

Home arrow Blog arrow FreeBSD Basic howto
FreeBSD Basic howto PDF Print E-mail
Written by Administrator   
Wednesday, 19 December 2007
 

Very basic FreeBSD Howto

Сontents

1) System time adjustment
2) Check /etc/hosts
3) Edit /etc/make.conf
4) Update your ports tree
5) System update (get latest sources)
6) Rebuild kernel & base system

Step-by-step algorithm

  

1) System time adjustment

First, check your time zone & system time.

tzsetup ⇒ United States ⇒ Eastern time

To set ntpd  ntpdate -B <ntp server addy> 

Next step, edit your crontab:

crontab -u root -e

Add line like that:

*/10 * * * * /usr/sbin/ntpdate -B IP_address >/dev/null

Take a note to “B” parameter in in ntpdate.

 

2) Check your /etc/hosts:

127.0.0.1 localhost.localdomain localhost

_IP_Address_ your-hostname.your-domain your-hostname

As a rule, this procedure is done by DC and you don’t need to do it again. Simply check it.

3) Edit your /etc/make.conf

sample config of make.conf (FreeBSD 6.2)

# Compile options
#
CPUTYPE?=       pentium4
CFLAGS=         -O2 -pipe
COPTFLAGS=      -O2 -pipe

#
# Common options for base system rebuild
#
NO_ATM=
NO_AUTHPF=
NO_BLUETOOTH=
NO_DICT=
NO_FORTRAN=
NO_GAMES=
NO_INET6=
NO_INFO=
NO_IPFILTER=
NO_KERBEROS=
NO_NIS=
NO_PF=
DOC_LANG=               en_US.ISO8859-1
KERNCONF=               <your kern file>
WITHOUT_IPV6=           yes
WITHOUT_X11=            yes

 

Compile Options” are required only to increase system performance. Also, you must correct CPU type with yours.

After editing your /etc/make.conf, you must comment lines for nis support in /etc/nsswitch.conf. Your /etc/nsswitch.conf would look like:

group: compat

#group_compat: nis

hosts: files dns

networks: files

passwd: compat

#passwd_compat: nis

shells: files

4) Update your ports tree.

I prefer portsnap utility by Colin Persival instead of cvsup:

portsnap fetch && portsnap extract

 

5) Update your sources.

Install cvsup-without-gui using ports  (I) or package (II):

(I)

cd /usr/ports/net/cvsup-without-gui && make install clean

(II)

pkg_add -vr cvsup-without-gui

Touch /usr/local/etc/cvsup.src and edit it like that: cvsup.src

---

cvsup.src example
*default host=cvsup99.FreeBSD.org #the mirror near to you
*default base=/usr
*default prefix=/usr
*default release=cvs tag=RELENG_6_1
*default delete use-rel-suffix

src-all

---

Next step, add to /etc/make.conf lines like shown in example make.conf

 ----
make.conf for cvsup-without-gui
#
# Update
#
SUP_UPDATE=
NO_PORTSUPDATE=
NO_DOCUPDATE=
SUP=            /usr/local/bin/cvsup
SUPFLAGS=       -g -L 3
SUPFILE=        /usr/local/etc/cvsup.src
----

For sources updating, do:

cd /usr/src && make update

Add to cron jobs using crontab -u root -e:

### Update Src, Ports

12 0 * * 2 cd /usr/src && make update

22 0 * * 2 cd /usr/ports && make fetchindex

 

14) Rebuild kernel & base system

Copy GENERIC kernel config no Yourkernel:

cp /sys/i386/conf/GENERIC /sys/i386/conf/Yourkernel

 Also, you may create your kernel config using these instructions:

Edit your kernel config file.

comment  the lines your system don't need

The good kernel config to add

options         PANIC_REBOOT_WAIT_TIME=16
options         IPFIREWALL
options         IPFIREWALL_VERBOSE
options         IPFIREWALL_FORWARD
options         IPFIREWALL_DEFAULT_TO_ACCEPT
options         IPDIVERT
options         IPSTEALTH
options         DUMMYNET
options         TCP_DROP_SYNFIN
options         DEVICE_POLLING
options         SMP
device          carp

Clear your /usr/obj/* :

rm -rf /usr/obj*

Compile Yourkernel:

make buildkernel KERNCONF=Yourkernel

Compile base system:

make buildworld

Next, install kernel & world:

make installkernel KERNCONF=Yourkernel

mergemaster -p

make installworld

mergemaster

Reboot system:

shutdown -r +3

It is better give +3 minutes if somebody works on server in this time.

Last Updated ( Tuesday, 04 March 2008 )
 
< Prev   Next >
© 2010 system admins place