FREEBSD server installation and optimization

xiaoxiao2021-03-06  69

Of course, just like its name, the version of the -current branch is also the latest 5.0, and all freebsd errors and vulnerabilities are first introduced in the -current branch. At present, only FreeBSD 5-CURRENT (specified CVS TAG "is a fruitful result,"), this branch includes the latest developments developed by FreeBSD 5.0. FreeBSD 5 will introduce a large number of new features, including core-level threads (current webs in FreeBSD is limited to user-level threads, which in the multiprocessor environment is not good enough, of course, currently uses fork () Process thread simulation can provide a function similar to core-level thread, but not all programmers know how to use fork, complete Soft Updates (this change will provide better file system performance while providing better stability ),and many more. If you have a fast Internet connection, one or some empty machine (of course, it is not a production server), and wants to contribute to FreeBSD, or the latest development of the operating system, then -current branch is the most Good choice. In addition, because the -current branch is not good, the stability is not enough, etc. For the production of the server, the usually run should be freebsd-stable. As with its name, the purpose of FreeBSD-Stable is "stably run". The code in the -current branch is after a period of time (usually 7 to 90 days, but the security update belongs to the special case, usually in a few hours) verification, in line with version conditions (some new features can only be used for FreeBSD 5.0) The code will be absorbed by FreeBSD-Stable, which is called MFC (Merge from -Current, not Microsoft Foundation Classes: P). Since the first release of FreeBSD 5.0 ​​is still not released, there is no 5.0-stable yet. At present, FreeBSD-stable has two versions, FreeBSD 3-Stable and FreeBSD 4-Stable, which correspond to the latest stable version of the 3.x and 4.x, respectively (corresponding CVS TAGs are releng_3 and releng_4). Due to the update of the version, 3.x -stable is gradually demotting. FreeBSD-Stable will modify about 10 files average. Every time, Release Engineering Team is locked for FreeBSD-Stable's source tree. During this time (current provisions are 30 days, there are 30 days preparation), all MFC operations require approval of the issuing engineering group, so freebsd-stable will not introduce any new feature at this stage. After this period, the issuing engineering team will finally lock the Ports tree, and Build all Package, then this lock -stable may have been named Release Release, and make CDs issued. As the name suggests, -release design goals are "release". One version once release, then his function will not increase. There is only one objective of all maintenance thereafter, that is absolutely stable.

If you are synchronized with the -release branch, then Make can never pass, and it usually guarantees that your system "absolute" is stable, because it does not introduce any new features (for example, 4.6 is 4.6, if You want 4.6.2 functionality, you must specify 4.6.2). At present, FreeBSD has a lot of Release versions, and their CVS TAG is as follows. I personally recommend using the latest 4.6.2-release. For most people, -release is a relatively extreme selection. Whenever the version is upgraded, if you want to follow up, you must modify the supfile. If you choose not to follow, you may cause an exception of the ports. If updated frequently, -release can ensure the security of the operating system itself, but like other branches, if ports have a problem, then a piece of Make, which is not as good as using -stable. If you meet the following conditions, the Release branch may be more sensitive than the software you use by the -stable branch. For example, it can only run freebsd 4.5, but you don't plan to run on 4.6; Using its update version, or its author refuses to update the operating system update doesn't make any meaning, for example, you intend to use FreeBSD as a relatively fixed embedded operating system, for example, as part of the firewall update It will cause trouble to you. Most new features of the operating system can bring anything else in addition to adding troubles. - And, all of the following conditions - you look at FreeBSD every day, and the safety announcement of all software used. Your Internet connection is relatively smooth. All the host we maintain, except as the firewall, all use FreeBSD -Stable. Once synchronous end source code, you should update the entire system. If you don't look at the habit of security announcements every day, you should care about which code is updated. Nectar is currently freebsd Security Office. If you find that he updated many of the code, you immediately make World and kernel immediately Make World and Kernel. In order to update the entire system, execute the Make World and the Make Kernel Kernconf = Core configuration file name in / usr / src, can also be executed: make world kernel kernconf = kernel configuration file name If your computer runs slower, then For the basic system update (equivalent to the World ", it is possible to replace Make World in Make Most, but make world is a good idea because it guarantees a change to the C operation environment to all programs. If the correction is not a dynamically connected C function library, Make World can guarantee the consistency of the code. Make Kernel is a one that needs to restart. If your Make World modifies the key service of the system, then it is best to restart. I rarely read patients after watching Make World and Kernel, depending on the system's running speed, this requires an hour to day, and not all SSH clients can perform correctly for a long time, for example, SecureCRT Multiple versions have memory leaks.

In order to solve this problem, I use the following command to complete the update: make world kernel kernconf = kernel configuration file name clean> / var / log / world, out && reboot & this command can record the update process, if you compile? Failure, you can find the reason very quickly. For most people, due to the later &&, you can know if it is a success. It should be noted that FreeBSD's make WORLD does not always succeed. Sometimes you need to modify some environment variables to successfully complete make. To ensure the success of Make, it is recommended that you see if any Make operation is performed in / usr / src. It is recommended that you have special requirements in UpDating (this requirement is not when Freebsd Release will appear. Many times he will be in a certain Introduction in Current, then with the MFC into the -stable branch), and, before performing a large version upgrade (cross release, even the main version number), first execute the following command MergeMaster -p and execute MergeMaster -i after Make World. Running a MergeMaster script requires a certain UNIX configuration knowledge, but because there is a lot of help information in the configuration file, as long as Master.Passwd, Group does not have a big problem (if CVSUP updates Master.Passwd, then you need to stay, Because the master.passwd standard configuration is empty, you need to merge with M, instead of using i installation), MergeMaster does not introduce what new problem. The previous command is an update make configuration (/etc/default/make.conf and /etc/make.conf). For most people, unless span version upgrades, do not need to do this. The latter command is synchronized all configuration and installs the previously unsatisfactory profile, and does not prompt. The author has encountered freebsd because the system is not correct, and therefore, it is necessary to remind everyone again. If your system date is incorrect, it is best to modify it with a Date command, or simultaneously with NTPDATE or NTPD. . About how to use NTP, will be described later. We will explain the configuration of the FreeBSD kernel, and how to configure make.conf to optimize FreeBSD compilation. "Simple things are not easy to have problems." For the famous sayings! In fact, it is a very important thing to reduce the functionality that you useless in your operating system. This is not only a smaller operating system, which takes up less disk space (now there are fewer GBs, and the space of the few megabytes is the nine cattle. " - In short, you don't need to worry about the problem of module that is not installed in the operating system will affect you. In this article, we will optimize the kernel of FreeBSD-I386. This article is for FreeBSD4.7-Stable, and the configuration of FreeBSD 4.x will not have too much access to this article. If you want to optimize the kernel of FreeBSD 5 or FreeBSD 2/3, you need to carefully refer to their LINT files (later will be mentioned). [Note: FreeBSD 5.0 ​​is scheduled to be released on November 20, 2002. FreeBSD's development group attaches great importance to the quality of the release, and it is important than the release of the release version, but because of the same reason, we will often find that the version of FreeBSD is later than the scheduled plan, usually within half a month. .

FreeBSD 5.0 ​​is the most important release version of FreeBSD, it is likely to be delayed, but the author believes that we must see the final release from the end of this year. FreeBSD 5.0 ​​has made a lot of modifications to the system. This series of articles will publish the revision of 5.0 on the day of FreeBSD 5.0, and the existing version will be retained, but the maintenance phase will not be introduced into new content. ] FreeBSD source code can be synchronized from the central CVSUP server, or can be installed as part of the system installed. I have already said how to synchronize source code, and will not be described here. FreeBSD source code (usually in / usr / src) contains all code for building basic systems, and there are several directorys in / usr / src / sys, corresponding to different computer architectures (4.x only support I386 and Alpha) ). I386 is a general name that includes all machines compatible with Intel 80386, not specifically 80386. Briefly introduce the freebsd kernel file. In the 4.x system, the / kernel This file is the default kernel, which is usually started normally. /kernel.Generic This file is a strong compatibility kernel. If / kernel cannot boot the system, you have to boot by this file. /kernel.old is the kernel before this make Kernel, usually if your kernel is broken, you can also use /kernel.old to boot the system. / Modules / is the module of the kernel, and /modules.old/ is a module of the corresponding / kernel.old. These files will be replaced at the time of each replacement of Kernel. In 5.0, the kernel and kernel modules are saved in / boot / kernel. There are two profiles, generic, and lint in / usr / src / sys / i386 / conf. Where Generic is the default configuration file of make Kernel, directly make kernel generates the Generic kernel, but is named / kernel when installing. After installing a kernel.Generic, this file will not follow the system's make kernel update, so if you think this file is necessary to update, you need manual make kernel, and rename the / kernel to kernel.Generic . Of course, this usually doesn't need to do this. LINT is a file that includes almost all kernel compilation configuration details. This configuration is not used to truly build KERNEL, his main purpose is to show the user to display the available kernel compilation configuration. When modifying the kernel compilation configuration, it is best to refer to this file. To configure your own kernel, generic should be copied as an additional file. It is used to this file and the host name. For example, I named my web machine to apache.intranet.frontfree.Net, name the configuration file to apache: CD / USR / SRC / SYS / I386 / Conf CP Generic Apache then edits it with EE APACHE. We take an actual generic file to explain. In order to save space, the annotation on this file is deleted.

Machine i386 # system model for i386 CPU I386_CPU # Support 80386 CPU I486_CPU # Support 80486 CPU I586_CPU # Support Pentium CPU I686_CPU # Support Pentium Pro and Higher Ident Generic # 内 核 号 MaxUsers 0 # Automatically detect the maximum number of users allowed simultaneous allowed MakeOptions debug = -g # contains debug symbols. Usually only Current version open options math_emulate # support coprocessor simulation Options inet # support Internet Options INET6 # IPv6 communication protocol Options FFS # Berkeley fast file system Options FFS_ROOT #FFS as root device [must keep] Options softupdates # Open FFS Soft Updates Support Options ufs_dirhash # Improve large directory support Options MFS # memory file system Options md_root # md as root device Options NFS #Network FileSystem options NFS_ROOT #NFS as root device (required NFS) Options MSDOSFS #MSDOS file system Options CD9660 #iso 9660 file system (CD) Options CD9660_ROOT # CD-ROM as root device (required CD9660) Options procfs # process file system Options compat_43 # compatible 4.3BSD [must be retained] Options SCSI_DELAY = 15000 # Detects Delay (MS) Options Uconsole before SCSI device User Capture Options UserConfig #boot -c Editor Editor Options Visual_UserConfig # Menu Boot -C Editor Options Ktrace #ktrace (1) Support Options Sysvshm # Sysvmsg # Sysv- Style Message Queue semaphore options SYSVSEM # SYSV- style (semaphores) options P1003_1B #Posix P1003_1B real-time extension options _KPOSIX_PRIORITY_SCHEDULING options ICMP_BANDLIM # malicious ICMP request to be limiting in options KBD_INSTALL_CDEV # / dev CDEV a mounting apparatus in the production of the following two items # SMP (S) MP) Calmonler Requirements #options SMP # Symmetrical Multiprocessor Core #options APIC_IO # Symmetrical (APIC) I / O Device ISA Device Eisa Device PCI # Soft Drive DEVICE FDC0 AT ISA? Port IO_FD1 IRQ 6 DRQ 2 Device FD0 AT FDC0 Drive 0 Device fd1 at fdc0 drive 1 # # If you use Toshiba Libretto and his Ye Ye Data PCMCIA floppy drive # Do not use the above FDC0,

转载请注明原文地址:https://www.9cbs.com/read-110876.html

New Post(0)