test.davidpierron.com .: installing freebsd body { background : #c0b080; font : 11pt arial, sans-serif; } td { font : 11pt arial, sans-serif; } a {color:navy; text-decoration:none; } a:hover { color:#ffffff; } h1 { margin: 0%; }
Document by: David Pierron © 2005
With FreeBSD Servers, I have setup a standalone firewall that protects my entire network. DNS Servers that name serve all the domains I host. A total of six DNS Servers running on two FreeBSD machines. Primary and Secondary for me, Primary and Secondary for resellers as well as Primary and Secondary caching servers for my local name resolution. A standalone mail server that is one of the most robust mail servers on the Internet. The mail server utilizes Qmail and handles SPAM and Viruses, Web Mail. At the time of this writing, 1,063,918 emails have gone through the mail server. I have a FreeBSD IRC Server. I have a FreeBSD Stats Server which collects statistics from all the machines on the network via SNMP. I have a FreeBSD MySQL Server where all databases are stored for the network's use. Then there are many FreeBSD Web Servers that run the Apache Web Server and FTP Servers for getting the files there.
So you see, I think I have just about exhausted all the possibilities that can be had running the FreeBSD operating system. I have found much satisfaction not to mention saving a ton of money when it comes to the proprietary alternatives. What started primarily as a Microsoft Windows Web Hosting shop has evolved into a much more efficient FreeBSD based shop with about two remaining Windows 2000 Servers still online. (This document is being composed in a text editor running in KDE on a FreeBSD 5.3 machine). The Windows machines remain due to the proprietary ASP and ASP.NET scripting languages. Other than that, they're useless for Internet use.
PLEASE! Don't think by those statements that I'm just another one of those Redmond bashers. Everything I have done started on Windows. Windows had first shot on all the Internet technologies that I describe as FreeBSD handling now. As the network grew, and I needed solutions, FreeBSD had the most economical, reliable and sensible solution. The Windows machines proved unstable for my uses. Much of what was needed to accomplish had a very squiggly roadmap on Windows. You can't be "user friendly" when it comes to the Internet. With FreeBSD, there was a straight line. I think this is because FreeBSD is what the Internet was originally built upon. While Micorosft may be the best solution for some, for me FreeBSD proves to be the perfect choice in an Internet based environment.
So the reason I have composed this document is to try to get those that want to pursue the same goals be able to get it done faster without any roadblocks in the inability or unfamiliararity of the FreeBSD Operating System or its Install method. This document gets any PC into a starting position for any solution running the FreeBSD operating system.
NOTE: As I write this introduction (Objective) to this document, I have an idea. I provide a method to get to a starting point, and then I take those starting points and show how I arrived at each of my solutions. Enabling the reader to get to a DNS Server, a MySQL Server, a Mail Server, etc ... Hmmm ... that might be neat ...
The PC should be able to boot from the CDrom drive. If this is not possible, there are programs available on the Internet to get around this. btmgr.sourceforge.net is one of them. If you must boot from a floppy, you may have to refer to The FreeBSD Handbook for an alternate installation method.
I usually download the current CD ISO image from the FreeBSD web site and burn my own copy. You will need to know how to use an FTP program to download the CD image file and a CD Burning program in order to create the bootable CD. You don't just burn the *.iso file onto the disc, you must burn the "image" on the disc that the ISO represents. This document doesn't go into such detail.
But I will tell you, Windows XP has the ability to burn an ISO right from its operating system. Refer to this document. If you master that, another great utility to have is MEMtest86. It is a bootable CD that will simply and extensively test your memory.
Run the install from the bootable CD.

On a new install, the kernel configuration will come up:

Select full screen mode

Use the DEL key to inactivate drivers and the ENTER key to activate them. TAB will switch between active and inactive drivers. I
disable all drivers that I'm not going to use at this point. Usually just leaving the IDE drivers, adding the NE2000 compatible
network card driver and whatever other bare essentials that are needed. Press Q when you're done.

Select a STANDARD Install

Your empty drive will show up when you need to allocate space to the FreeBSD installation. I use the entire disk.

Select to use the entire disk for the installation by selecting "a" and then "q" for quit.

Since FreeBSD is the only system on this machine, I use the Standard option, no boot manager
The following screen will come up. A drive with no partitions defined.

If you know what sizes you want your partitions, you can use this screen to define them. If you're unsure,
just use the defaults by pressing "a" and the next screen will show.

FreeBSD creates partitions based on the size of your drive utilizing the whole disk. Press "q" to save these settings.

FreeBSD will then ask what you want to install. I pick the Minimal install since I want to specify each thing that goes on my machine.
In my opinion this is the best way.
Press SPACE to select MINIMAL then TAB to select OK

FreeBSD then asks where you're installing from. You can install from any of these locations, but since you have the CD in the drive,
it's easiest just to select the CD. With the Minimal install, all new applications will use the latest sources.

FreeBSD now prompts you that it's going to initialize the drive and put on the options you've selected. It's your last chance to
change your mind.

You will see the partitions being formatted

You will see bin being copied

You will see crypto being copied

Once everything is copied, FreeBSD congratulates you on your installation. Then you will customize the following:

The first thing FreeBSD wants to do is get access to the world. We are going to grant this wish with a YES here.
Try IPV6: NO
Use DHCP: NO
Then you will be presented with the following screen to set your machine's network configuration:

Set the options that are appropriate for your network. Then select OK
Bring it up now: YES
Network Gateway: NO
Configure inetd: NO
Anonymous FTP: NO
NFS Server: NO
NFS Client: NO

Select NO for security since this machine will be an Internet server.
Customize console: NO

Select NO for clock to use local time in bios clock
Set time zone: YES
North America -> United States -> Eastern -> EST? -> YES
Linux binary compatibility: NO
Non-USB mouse: NO

Select NO - we will be installing our packages over the Internet.
Additional user accounts: YES

You want a user that you can login to the machine to do general work. It is suggested that you don't login as root.
Make sure you add this user to the "wheel" member group so that you will have access to the "su" command to temporarily assign root privileges.


Set root's password: don't forget it!

NO, nothing else to do.

TAB to Exit Install

Select YES and immediately remove the CD from the drive. FreeBSD will now boot from the hard drive.

Your first boot will initialize some necessary files and you will finally be presented with the login screen.

You login as root (cause we're going to do some setting up) and you will be presented with the Welcome screen and the # prompt.


pkg_add -r mc

rehash
This will install cvsup and midnight commander ...
I use midnight commander to hop around the drive fast (through directories) and can view and edit files quickly using this interface.
You need to have cvsup available to download the latest ports when you're installing for the first time or upgrading.
Type mc at the prompt.

You will be in your root directory. Edit (F4) .cshrc and add the following:
alias ls ls -G
Alter the set prompt command to look like:
set prompt="[`whoami`@`hostname -s` `pwd`]# "
and then add the very next line:
alias cd 'cd \!* ;set prompt="[`whoami`@`hostname -s` `pwd`]# "'

Once you save (F2) the file, exit mc (F10, Yes), logout by typing: exit
Log back in.
These settings will show in your prompt your current username and host along with the current directory.
The cd alias will keep the directory updated ... the ls alias will show directory listings in color.

To configure all system mail to go to a certain address, edit /etc/aliases
Uncomment the root: line and alter the address that you want all system email forwarded to.
save file and run: newaliases
Navigate to /usr/share/examples/cvsup
Copy ports-supfile to /usr/local/etc

edit ports-supfile to a valid mirror and make sure ports-all is the option selected

Run: cvsup -g -L 2 /usr/local/etc/ports-supfile
This will download all the current ports availabale for FreeBSD.

Skip this gray area:
|
Decide what version of apache you're going to run. For this installation I want the latest and greatest. I am going to pick Apache2 and PHP5. cd /usr/ports/www/apache21 make install clean This will install the latest available apache2 and everything else that is necessary for it to run.
cd /usr/ports/lang/php5
Edit /usr/local/etc/apache2/httpd.conf
cd /usr/ports/lang/php5-extensions
|
To install PHP4 with Apache2:
cd /usr/ports/lang/php4
make install clean
You will be prompted to select Apache2 and you can disable IPV6 support. Do not select DEBUG is you're going to install Zend's Optimizer.
Edit /usr/local/etc/apache2/httpd.conf
navigate to the DirectoryIndex section
Insert the file: /usr/ports/lang/php4/pkg-message.mod
Remove lines that do not apply
You now have a working installation of Apache2 and PHP4, but we need the extensions
cd /usr/ports/lang/php4-extensions
make install clean
You're prompted for the extensions you want installed.
To have Apache load whenever the system is started:
edit /etc/rc.conf and add: apache2_enable="YES"
cd /usr/ports/ftp/proftpd
make install clean
Edit /usr/local/etc/proftpd.conf and insert:
ScoreboardFile /var/run/proftpd.scoreboard
This will install proftpd so you can transfer files to your new installation
Download appropriate Zend Optimizer from http://www.zend.com
Upload to machine using newly installed proftpd or use fetch from command line.
untar and ./install Zend Optimizer
If you're going to monitor machine performance via SNMP:
cd /usr/ports/net-mgmt/net-snmp
make install clean
You will want the most recent version of Perl installed
NOTE: On FreeBSD 5.x, installing PHP4/Apache2 will also install latest Perl
cd /usr/ports/lang/perl5.8
make install clean
use.perl port
To be continued...

This work is licensed under a Creative Commons License.