WWWsmith: Installation and Configuration of FreeBSD
As mentioned above, I always configure my kernels to trim away any unneeded devices. This is similar to what was done during the visual configuration process but is done by compiling the kernel, it results in a smaller kernel, requiring less memory.
The FreeBSD Handbook describes this process in detail. The Handbook is available on the FreeBSD web page, at http://www.freebsd.org/ and is also installed in /usr/share/doc/, in HTML. In simplest terms, you do the following commands:
cd /sys/i386/conf cp GENERIC <machine name> vi <machine name> #edit the file and exit vi config <machine name> cd ../../compile/<machine name> make depend all cp kernel /kernel reboot
The complicated part is in the editing of the configuration file. After dealing with the visual configuration utility, the configuration file should not be all that complicated. (It is documented in the Handbook.) You can use the dmesg command to see which devices were found and which were not. By default, the installation leaves a copy of the generic kernel in /kernel.GENERIC; you can boot this, or any other kernel, by typing the name of the kernel at the Boot: prompt.
In addition to removing or configuring devices, system parameters can also be configured this way. One such parameter, maxusers, controls how much memory the kernel allocates to certain resources—the maximum number of processes, open files, and time events are all calculated based on maxusers. Another parameter that may need to be changed is MAXMEM—due to BIOS limitations, FreeBSD only recognizes up to 64MB of RAM by default (or 16MB on some very old systems), and MAXMEM (specified in KB) tells it to use more.
For example, on a machine with 256MB of RAM, which is expected to have a heavy load, the following lines in the configuration file might be used:
maxusers 100 options MAXMEM="(256*1024)" # 256MB
Once again, after editing the appropriate configuration file, run config and then make.
The Apache package installs the configuration files into /usr/local/etc/apache, and the default configuration files have a document root of /usr/local/www/data. By creating an index.html file in that directory, the web server is now up.
For me, the machine was completely installed, configured and acting as a web server on my LAN in about two hours. Most of that time was spent waiting for the kernel to recompile; it took 90 minutes on this machine (it takes about six and a half minutes on my 133MHz Pentium)—and the system was working as a web server during that period.
I have installed FreeBSD several times. The process is fairly painless, largely intuitive and very quick when done from a CD-ROM. My main objection is that it lacks a help option for many of the dialog boxes or menus; this can make it difficult to know what to do if you are new to Unix. However, ignoring that, the install went smoothly and required no knowledge of Apache configuration or installation on my part. If I hadn't chosen to reconfigure the kernel, I would have had a fully-functioning web server within about 30 minutes of beginning installation.
Sean Fagan has been a BSD contributor for many years. He lives in San Jose with a psychotic cat who insisted on being mentioned in this article. He can be reached at firstname.lastname@example.org.
Practical books for the most technical people on the planet. Newly available books include:
- Agile Product Development by Ted Schmidt
- Improve Business Processes with an Enterprise Job Scheduler by Mike Diehl
- Finding Your Way: Mapping Your Network to Improve Manageability by Bill Childers
- DIY Commerce Site by Reven Lerner
Plus many more.
- diff -u: What's New in Kernel Development
- Giving Silos Their Due
- What's New in 3D Printing, Part III: the Software
- Server Hardening
- February 2016 Issue of Linux Journal
- 22 Years of Linux Journal on One DVD - Now Available
- Controversy at the Linux Foundation
- Don't Burn Your Android Yet
- Firefox OS