Creating a FreeBSD Server
We have chosen FreeBSD as the operating system as it is free, is relativity secure, and can be loaded directly from the Internet.
We also find that a bare FreeBSD server has less processes and requires less resources than any modern version of Windows or standard distribution of Linux.
It is also well documented and has many ports that increase the functionality.
The article is written for FreeBSD 10.1-RELEASE amd64.
If time allows I will update the page at a later date.
I am using Virtual Box on a Windows 7 computer as a host.
This document will walk through a network set up from the Internet.
I will end the set up at the point that you can decide to use the install as an image.
For the most part this setup can be done by simply clicking on through the set up process, please select options that fit your needs.
We start out by downloading FreeBSD from the website.
Of course you will need to download the iso for the current version that is correct for your machine's architecture
For this document I have downloaded the "FreeBSD-10.1-RELEASE-amd64-bootonly" iso.
We will be booting from the image in Virtual Box, you may need to burn the image to a DVD.
When the image is loaded boot the computer.
These are the steps with documenting images:
- Keyboard
- Name the Computer
- Select Options
- Network
- Partition the Hard Drive
- Wait
- Set the time zone
- Services
- Users
- Completing Install
- Where Next
This is normally just a matter of selecting the default.
You will want to select an appropriate name for the computer.
If this is going to be an image, you will want to give it a name that will not necessarily be used in production.
You will be able to change the name later by editing the /etc/rc.conf file.
This can be done by changing the existing hostname directive or adding the new hostname directive at the end of the file.
FreeBSD applies the last entry in the rc.conf file.
I am not planning on using the server to play games, read documentation or for development purposes so we will make certain that these are de-selected.
I also de-select the ports option as I will download the ports if necessary later assuring me that the ports will be up to date.
This being a 64-bit installation, I will select the 32 bit compatibility options.
The image does not contain the files required for loading, we need to setup the network at this time.
The options that are selected at this time will be written to the /etc/rc.conf file and can be reconfigured by editing the file.
The nameserver option can be changed by editing the /etc/resolv.conf file as needed later.
If this will be an image, you will probably want to select DHCP, so the new image will be certain to get a different IP address when started.
I will only configure IPv4.
When completed, you will need to select the location of the installation files, I will use the FreeBSD site.
Unless there is some need, selecting the Auto UFS or ZFS should work.
For this project I will use the UFS.
-
After you commit the partition change, the set up program should go out and get the image of freeBSD requested.
In my case it only needs to down load the kernel, base and the 32bit libraries.
This normally takes around 15 minutes on a moderately fast Internet connection.
-
When the images have been fetched, the setup program expands the requested files the newly partitioned hard drive.
Depending on the speed of your computer, this could take a few minutes
-
When setup has completed the expansion, you will need to change the root password.
Select the correct time zone for the computer.
We do not want any extra services; however, we want to make certain the NTPD and SSHD are both running.
You can leave dumpdev running if you would like
You can add users to the system at this time, it is recommended that you have a non-root user.
For this project, I am not adding additional users at this time.
After completing setting up users, you will get the option to make changes to networking, hostname, root password and other changes.
At this time we are selecting Exit.
Before exiting you can edit configuration files to suit your needs.
There is at least one file that you will want to edit even if this is going to be an image file.
We will want to uncomment all entries in the porsnap.conf file to prevent loading unwanted language ports.
This can easily be completed with the sed command at the prompt.
sed -i '' "s/\# REFUSE/REFUSE/g" /etc/portsnap.conf
Don't forget to remove the CD (or ISO)