电脑技术学习

FREEBSD升级及优化全攻略

dn001

1 2 3 4 5 6 7 8 下一页

  make clean

  make deinstall

  make install

  make clean 即可

  升级系统源码树及ports

更新/usr/share/examples/cvsup目录下stand-cvsup和ports-cvsup文件,并执行cvsup –g –L2 standard-supfile和cvsup –g –L2 ports-cvsup两个文件,升级ports树﹔

  CPUTYPE=i686

  CFLAGS= -O3 -pipe

  COPTFLAGS= -O3 -pipe

  升级操作系统

进入/usr/src

  执行make world

  整个过程很久,需要2小时左右。

  #disable ctrl+alt+delete

  options SC_DISABLE_REBOOT

  #quota limit

  options QUOTA

  #ipfw support

  options IPFIREWALL

  options DUMMYNET

  options HZ=3000

  options IPDIVERT

  options IPFIREWALL_VERBOSE

  options IPFIREWALL_VERBOSE_LIMIT=100

  options IPSTEALTH

  options TCP_DROP_SYNFIN

  options IPFIREWALL_DEFAULT_TO_ACCEPT

  options ICMP_BANDLIM

  options ACCEPT_FILTER_DATA

  options ACCEPT_FILTER_HTTP

  #ipfilter support

  #options IPFILTER

  #options IPFILTER_LOG

  #options IPFILTER_DEFAULT_BLOCK

  再执行:

  /usr/sbin/config onlinecq

  cd ../../compile/onlinecq

  make depend

  make

  make install

  #enable_quotas="YES"

  #check_quotas="YES"

  firewall_enable="YES"

  firewall_script="/etc/rc.firewall"

  firewall_type="/etc/ipfw.rules" #create it!

  firewall_quIEt="NO"

  firewall_logging_enable="YES"

  log_in_vain="NO"

  tcp_drop_synfin="NO"

  tcp_restrict_rst="YES"

  icmp_drop_redirect="YES"

  优化内核参数

修改系统内核参数,实现微调:vi /etc/sysctl.conf

  kern.ipc.somaxconn=8192

  kern.ipc.maxsockbuf=2097152

  kern.maxfilesperproc=32768

  kern.maxfiles=65536

  kern.securelevel=-1

  net.inet.tcp.sendspace=65536

  net.inet.tcp.recvspace=32768

  net.inet.udp.maxdgram=57344

  net.inet.icmp.drop_redirect=1

  net.inet.icmp.log_redirect=0

标签: