Конфиги для freebsd

Категория: / DEV Блог / Сервер (FreeBSD)
kernel

machine         i386
cpu             I686_CPU
ident           MEGAKERNEL
maxusers        512
 
options NMBCLUSTERS=65536
 
options         CPU_L2_LATENCY=5
options         CPU_PPRO2CELERON
options         CPU_WT_ALLOC
 
options         SCHED_4BSD              # 4BSD scheduler
options         INET                    # InterNETworking
options         FFS                     # Berkeley Fast Filesystem
options         SOFTUPDATES             # Enable FFS soft updates support
options         UFS_DIRHASH             # Improve performance on big directories
options         MD_ROOT                 # MD is a potential root device
options         MSDOSFS                 # MSDOS Filesystem
options         PROCFS                  # Process filesystem (requires PSEUDOFS)
options         PSEUDOFS                # Pseudo-filesystem framework
options         GEOM_GPT                # GUID Partition Tables.
options         COMPAT_43               # Compatible with BSD 4.3 [KEEP THIS!]
options         COMPAT_FREEBSD4         # Compatible with FreeBSD4
options         KTRACE                  # ktrace(1) support
options         SYSVSHM                 # SYSV-style shared memory
options         SYSVMSG                 # SYSV-style message queues
options         SYSVSEM                 # SYSV-style semaphores
options         _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options         KBD_INSTALL_CDEV        # install a CDEV entry in /dev
options         ADAPTIVE_GIANT          # Giant mutex is adaptive.
 
device          apic            # I/O APIC
 
# Bus support.  Do not remove isa, even if you have no isa slots
device          isa
device          pci
 
# Floppy drives
# device                fdc
 
# ATA and ATAPI devices
device          ata
device          atadisk         # ATA disk drives
options         ATA_STATIC_ID   # Static device numbering
 
# atkbdc0 controls both the keyboard and the PS/2 mouse
device          atkbdc          # AT keyboard controller
device          atkbd           # AT keyboard
device          psm             # PS/2 mouse
 
device          vga             # VGA video card driver
 
device          splash          # Splash screen and screen saver support
 
# syscons is the default console driver, resembling an SCO console
device          sc
 
# Enable this for the pcvt (VT220 compatible) console driver
#device         vt
#options        XSERVER         # support for X server on a vt console
#options        FAT_CURSOR      # start with block cursor
 
device          agp             # support several AGP chipsets
 
# Floating point support - do not disable.
device          npx
 
# Power management support (see NOTES for more options)
#device         apm
# Add suspend/resume support for the i8254.
device          pmtimer
 
# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device          miibus          # MII bus support
device          re              # RealTek 8139C+/8169/8169S/8110S
device          rl              # RealTek 8129/8139
 
# Pseudo devices.
device          loop            # Network loopback
device          mem             # Memory and kernel memory devices
device          io              # I/O device
device          random          # Entropy device
device          ether           # Ethernet support
device          sl              # Kernel SLIP
device          ppp             # Kernel PPP
device          tun             # Packet tunnel.
device          pty             # Pseudo-ttys (telnet etc)
 
#
options                QUOTA
 
#
options DEVICE_POLLING
options HZ=1000
 
# packet filter
device bpf
 
# sounds
# device PCM
device sound
device snd_ich
device bktr
device iicbus
device iicbb
device smbus
#
 
options IPFIREWALL #IPFIREWALL
options IPDIVERT #divert
options IPFIREWALL_FORWARD
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options DUMMYNET
options TCP_DROP_SYNFIN
 
# pg+iservd
options SYSVSHM
options SHMMAXPGS=4096
options SHMMAX="(SHMMAXPGS*PAGE_SIZE+1)"
options SHMMIN=2
options SHMMNI=256
options SHMSEG=256
options SYSVSEM
options SEMMAP=512
options SEMMNI=512
options SEMMNS=1024
options SEMMNU=512
options SEMMSL=256
options SEMOPM=256
options SEMUME=64
 
# EOF


loader.conf

hw.ata.ata_dma="1"              # Enable DMA access for ATA devices
hw.ata.atapi_dma="1"            # Enable DMA access for ATAPI devices
 
#accf_data_load="NO" # Wait for data accept filter
accf_http_load="YES" # Wait for full HTTP request accept filter
 
#
kern.ipc.maxsockets="16424"
kern.ipc.shm_use_phys="1"


rc.conf

#font8x8="cp866u-8x8"
#font8x14="cp866u-8x14"
#font8x16="cp866u-8x16"
#scrnmap="koi8-u2cp866u"
keyrate="fast"
#keymap="ua.koi8-u.shift.alt"
 
keymap=ru.cp1251
scrnmap="win2cpp866"
font8x16=cp866-8x16
font8x14=cp866-8x14
font8x8=cp866-8x8
 
defaultrouter="172.16.0.100"
hostname="j4ckHOST"
ifconfig_rl0="inet 172.16.13.37  netmask 255.255.0.0"
#inetd_enable="YES"
sshd_enable="YES"
#usbd_enable="YES"
 
# gateway_enable="YES"
 
static_routes="net20 net19"
route_net20="-net 172.20.0.0/16 172.16.0.30"
route_net19="-net 172.19.0.0/16 172.16.0.20"
 
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
 
# tcp_extensions="NO"
tcp_drop_synfin="YES"
tcp_restrict_rst="YES" 
 
#
# Firewall
#
firewall_enable="YES"
firewall_logging="YES"
firewall_type="OPEN"   
firewall_quiet="YES"
 
#syslogd_flags="-ss -l /var/named/run/log"
 
linux_enable="YES"
 
# named_enable="YES"
# named_flags="-u bind -t /var/named -c /etc/namedb/named.conf"
 
named_enable="YES"
named_flags="-u bind -t /var/named -c /etc/namedb/named.conf"
 
 
# quotas
enable_quotas="YES"
check_quotas="YES"
 
fsck_y_enable="YES"
background_fsck="NO"



sysctl.conf

security.bsd.see_other_uids=0
security.bsd.see_other_gids=0
 
net.inet.ip.ttl=127
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
#net.inet.tcp.log_in_vain=1
#net.inet.udp.log_in_vain=1
net.link.ether.inet.log_arp_movements=1
net.link.ether.inet.max_age=600
net.inet.icmp.drop_redirect=1
 
#1
net.inet.icmp.log_redirect=0
 
net.inet.ip.redirect=0
# broadcast echo
net.inet.icmp.bmcastecho=0
 
vfs.vmiodirenable=1
kern.maxfiles=65536
net.inet.icmp.icmplim=300
kern.ipc.maxsockbuf=2097152
kern.ipc.somaxconn=8192
# kern.ipc.maxsockets=16424
net.inet.tcp.rfc1323=1
net.inet.tcp.delayed_ack=0
net.inet.tcp.sendspace=65535
net.inet.tcp.recvspace=65535
net.inet.udp.recvspace=65535
net.inet.udp.maxdgram=57344
net.local.stream.recvspace=65535
net.local.stream.sendspace=65535
 
net.inet.tcp.rfc1644=1
 
kern.ipc.nmbclusters=4096
 
kern.polling.enable=1
 
#kern.polling.user_frac=50
# -- 150 (100 Mbit, HZ=1000)
kern.polling.burst_max=150
 
#net.link.ether.ipfw=1
#net.inet.ip.fw.one_pass=0
 
security.bsd.conservative_signals=1
security.bsd.unprivileged_proc_debug=0
security.bsd.unprivileged_read_msgbuf=0
security.bsd.unprivileged_get_quota=0
security.bsd.hardlink_check_uid=1
security.bsd.hardlink_check_gid=1
kern.sync_on_panic=1
kern.coredump=0


Меняем раскраску ls в консоли
Для этого добавляем alias ls='ls -FG' в ваш shellrc (например ~/.bashrc, ~/.zshrc)

wget вместо fetch для закачки дисрибутивов при установке портов
В /etc/make.conf:
FETCH_CMD=/usr/local/bin/wget -t 3 -c
DISABLE_SIZE=yes

Сборка без X11 (make.conf)
WITHOUT_X11=yes
WITHOUT_GUI=yes

/etc/make.conf

CPUTYPE?=p4
CFLAGS= -O2 -pipe
#CFLAGS= -O -pipe
NO_BLUETOOTH=   true
NO_I4B=         true
NO_LPR=         true
NO_SENDMAIL=    true
NOGAMES=        true
NOINET6=        true
NOPROFILE=      true
MAKE_IDEA=      YES
NO_PROFILE=     true
 
BOOTWAIT=3000
DOC_LANG=       en_US.ISO8859-1 ru_RU.KOI8-R
 
X11BASE=$LOCALBASE
FETCH_CMD=/usr/local/bin/wget -t 3 -c
DISABLE_SIZE=yes
 
WITHOUT_X11=yes
WITHOUT_GUI=yes
 
PORTSDIR?=/usr/ports


Логи для periodic скриптов
В /etc/periodic.conf
daily_output=/var/log/daily.log
weekly_output=/var/log/weekly.log
monthly_output=/var/log/monthly.log