WWWsmith: Installation and Configuration of FreeBSD

Here's how to set up a web server using another freely available operating system, FreeBSD, a high performance, mature, UNIX-like system.
Installation Media Choices

Figure 6. Media Choice Screen

The next choice is what kind of media to use for the install. (See Figure 6.) I chose to use the CD-ROM method, as it is faster, easier and more convenient than the others. However, you can also install via NFS and FTP (and passive FTP—this is required if you are behind a firewall that has been configured by a paranoid administrator). For FTP installs, it uses the account name chosen in the “Options” section mentioned previously. Last, you can also install via an existing file system (e.g., an MS-DOS file system), floppy or tape. To use tape, you must have one of the tape drives supported by FreeBSD—mostly SCSI tapes, but also Wangtek and a couple of others.

If you choose to do an FTP install, you have to select the site to grab the files from—the default is the “Primary Site”, which is ftp://ftp.freebsd.org (aka http://wcarchive.cdrom.com/). There are also mirrors around the world.

When doing an FTP or NFS install, you also need to configure the networking interface. You're presented with all of the networking interfaces that the system found—any networking cards it recognized, as well as SLIP, PPP and the parallel-port IP interface (PLIP). Help is available at the “Network interface information required” menu by pressing f1. One quick note: the SLIP and PLIP options assume that the connection will be a hard-wired connection—if you need to connect using a modem, PPP is the only possible method.

After selecting the network interface (e.g., ed0), you will need to tell the install program the host name and domain name, default router (aka the “gateway”), name server, IP address and any extra options. Note that the gateway and name server fields need to be IP addresses, not host names. You will need to enter this information again, when doing post-install configuration.

If you selected the PPP interface, you will be asked to configure it. This requires knowing what baud rate to use (it defaults to 115200) and the IP address of the remote side. By default, it uses the gateway address, if you supplied it; you can also tell it to use “0”, which will allow it to be negotiated as part of the PPP connection setup. After you've done all this, you are then told to switch to VTY3 (the third virtual console screen), where the PPP program has been started. From there, you need to connect to the PPP server you are using (e.g., dialing the modem, entering account and password information, etc.).

After that, all that was necessary was to wait while the system installed. On my slow 486DX-33, with an IDE drive and a double-speed SCSI CD-ROM drive, it took 16 minutes to install all of the packages.

System Configuration

The install program then asks if you'd like to configure the network devices and, if so, which ones. This is identical to what was done if a network installation of any sort was done. In the case of the install I did, there was only one interface to configure: ed0. FreeBSD prompts for host and domain names, network gateway, name server and IP address. The netmask defaulted correctly, although you can change it if necessary. There is also a box for “Extra options”—some cards may require link-level options to choose which interface pair, e.g., BNC or Twisted, to use.

The next questions asked are about, Samba, IP forwarding, anonymous FTP, and NFS configuration. Of these, the only one I chose to configure was anonymous FTP, as this is sometimes useful for a web server. If my network had more (or, for that matter, any) Windows systems, Samba would allow file and printer sharing. If the machine were going to be my router, I would have enabled IP forwarding.

The last three system configuration questions are system console configuration (e.g., screen saver, font, keyboard map, etc.), time zone and mouse. This particular machine does not have a mouse; if it did, it would be possible to enable text cutting and pasting.

Installing the Web Server

The last thing to do is install any desired packages. FreeBSD has quite a considerable set of packages and ports; this is, in fact, one of the most attractive attributes of FreeBSD, in addition to its high performance.

Ports vs. Packages

Ports and packages are very similar; the only difference is in what is included in the file. A package is a gzipped tar file containing all of the files needed, along with some description and checksum files. A port, on the other hand, consists of patches, and a pointer to the location on the Internet of the main files. Many ports are built on the local system after applying source patches. Some, however, are “ports” because they are commercial programs and cannot be distributed via CD-ROM or Walnut Creek's FTP site.

The only package I chose to install was the Apache package in the WWW category. This took only a few seconds to install from CD-ROM, and it then went on to finish system configuration: additional accounts, setting the root password and registering. (Registering sends e-mail to the FreeBSD project and is not necessary. It does help the project, though.)

Once all that is done, the installation process is complete, and you can exit to reboot. When your machine comes back up, your FreeBSD system should now be on the network.


Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
On Demand
Moderated by Linux Journal Contributor Mike Diehl

Sign up and watch now

Sponsored by Skybot