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 email@example.com.
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
- Django Models and Migrations
- Hacking a Safe with Bash
- Secure Server Deployments in Hostile Territory, Part II
- Huge Package Overhaul for Debian and Ubuntu
- Home Automation with Raspberry Pi
- The Controversy Behind Canonical's Intellectual Property Policy
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- KDE Reveals Plasma Mobile
- diff -u: What's New in Kernel Development