FreeBSD Installation notes

Source: Internet
Author: User

This article is reproduced: http: // 121.28.169.118/blog /? Post = 7

 

1. Install the basic system
Pay attention to the simplest installation. Select standard. After the partition is complete, do not select any options. You do not have to worry about it. Even minimal is not checked. Do not install any software (ports, SRC, linux_base-f10), you must start ssh.
Synchronization time
Ntpdate time.cn99.com
Modify/etc/crontab
Add the following line to automatically synchronize time every 30 minutes
*/30 * root ntpdate time.cn99.com
# Ee/etc/ssh/sshd_config
Set port to your favorite port, and permitrootlogin to Yes (note that this option should not be started during production to keep the default value)
/Etc/rc. d/sshd restart
Ii. System Optimization
1. Use portsnap to install and synchronize the ports System
EE/etc/portsnap. conf
Set servername = portsnap.cn.freebsd.org
Portsnap fetch Extract
2. Use csup to install and synchronize the SRC code tree
Csup-g-L 2-H cvsup.tw.freebsd.org/usr/share/examples/CVSup/standard-supfile (recommended)
Or
Pkg_add CVSup-without-Gui
Reboot
CVSup-g-L 2-H cvsup.tw.freebsd.org/usr/share/examples/CVSup/standard-supfile
Recompile the kernel
CD/usr/src/sys/i386/Conf
Mkdir/boot/Rescure
CP generic/boot/Rescure
CP generic myneo
After editing the kernel myneo file ------------ edit the kernel Reference Manual
# Add no_modules = true ---------------- to/etc/make. conf. Note that you do not need to add it.
Installing ccache will greatly shorten the Compilation Time
CD/usr/ports/devel/ccache
Make install clean
Add/etc/make. conf
. If (! Empty (. curdir: M/usr/src *) |! Empty (. curdir: M/usr/obj *))&&! Defined (noccache)
Cc =/usr/local/libexec/ccache/World-CC
Cxx =/usr/local/libexec/ccache/World-C ++
. Endif
Edit eE ~ /. Cshrc
# Ccache
# Set ccache varibles
Setenv path/usr/local/libexec/ccache: $ path
Setenv ccache_path/usr/bin:/usr/local/bin
Setenv ccache_dir/var/tmp/ccache
Setenv ccache_logfile/var/log/ccache. Log
# Set ccache temp size to 512 MB (default 1 GB)
If (-x/usr/local/bin/ccache) then
/Usr/local/bin/ccache-M 512 m>/dev/null
Endif
Compile the kernel
CD/usr/src
Make kernel kernconf = myneo
Reboot
3. Install Axel
CD/usr/ports/FTP/Axel
Make install clean
Modify/etc/make. conf
Fetch_cmd = Axel
Fetch_before_args =-N 10-
Fetch_after_args =
Disable_size = Yes
Master_site_backup? = \
Ftp://ftp.tw.freebsd.org/pub/freebsd/distfiles/##dist_subdir }/\

Ftp://ftp.cn.freebsd.org/pub/freebsd/distfiles/##dist_subdir }/\

Ftp://ftp.freebsd.org/pub/freebsd/distfiles/##dist_subdir }/

Master_site_override? =$ {Master_site_backup}
4. Install linux_base-f10
Modify/etc/rc. conf
Linux_enable = "yes"
Modify/etc/sysctl. conf
Compat. Linux. osrelease = 2.6.16
Modify/etc/make. conf
Override_linux_base_port = F10
Modify/etc/fstab
Linproc/usr/compat/Linux/proc linprocfs RW 0 0
After the modification, run the following command:
Mkdir-P/usr/compat/Linux/proc
Mount/usr/compat/Linux/proc
/Etc/rc. d/Abi start
/Etc/rc. d/sysctl start
CD/usr/ports/emulators/linux_base-f10
Make install clean
5. Modify/boot/loader. conf
Autoboot_delay = "1"
Beastie_disable = "yes"
Kern. dfldsiz = "2147483648"
Kern. Hz = "2000"
Kern. maxdsiz = "2147483648"
Kern. maxusers = "256"
Kern. IPC. maxsockets = "65535"
Kern. IPC. nmbclusters = "32768"
Kern. IPC. nmbufs = "65535"
Kern. IPC. nsfbufs = "2496"
Net. inet. tcp. tcbhashsize = "2048"
# Linprocfs_load = "yes"
# Linsysfs_load = "yes"
# Procfs_load = "yes"
# Linux_load = "yes"
6. Modify/etc/sysctl. conf and add the following content (the content is a useful parameter that should be modified after verification ):
Net. inet. tcp. sendspace = 32768
Net. inet. tcp. recvspace = 65536
Net. inet. UDP. maxdgram = 65536
Kern. IPC. maxsockbuf = 524288
Kern. maxfiles = 65536
Kern. maxfilesperproc = 32768
Net. inet. ICMP. drop_redirect = 1
Net. inet. ICMP. log_redirect = 1
Net. inet. IP. Redirect = 0
Net. inet. ICMP. icmplim = 200
Net. inet. tcp. MSL = 2500
Net. inet. tcp. blackhole = 2
Kern. IPC. somaxconn = 32768
Kern. securelevel = 2
Kern. coredump = 0
7. Modify/etc/resolv. conf
Nameserver 127.0.0.1
8. Modify/etc/crontab. This is to add portsnap to update ports at every day.
0 3 *** root portsnap-I cron Update & pkg_version-devil =
9. Modify/etc/rc. conf.
Close sendmail
Sendmail_enable = "NONE"
Sendmail_submit_enable = "no"
Sendmail_outbound_enable = "no"
Sendmail_msp_queue_enable = "no"
Disable some insecure services to optimize startup speed
Nfs_server_enable = "no"
Nfs_client_enable = "no"
Portmap_enable = "no"
Syslogd_enable = "yes"
Syslogd_flags = "-SS"
Icmp_drop_redirect = "yes"
Clear_tmp_enable = "yes"
Inetd_enable = "no"
Enable Disk Quota
Enable_quotas = "yes"
Check_quotas = "yes"
Reboot ------------ in fact, this restart is not necessary. The kernel compilation should be the last restart of the real sense. That is to say, from installing the system to completing the configuration, FreeBSD only needs to restart once.
After that, a fresh FreeBSD system is at your disposal.

Finally, I wrote this note well. I used to check the Internet when I installed the system. Now I don't need it anymore. I am still saving myself a lot of time. Haha, it's quite comfortable!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.