Documents >> FreeBSD >> FreeBSD 7.0 Install

FreeBSD 7.0 Overview

Man Install

Being able to SU (change to root) 

Howto install the Ports tree 

Bash Install 

Midtnight Commander install 

Proftpd install 

Apache22 install  

Php5 install 

MySQL 5.0 install

PhpMyAdmin install

Subversion (SVN) install     

Roundcube Webmail install     

GD Libraries install       

Cacti install     

PHP Tokenizer install      

ImageMagick install      

Screen Install       

Awstats Install       

Portupgrade Install 

Rdiff-Backup Install  

WGET install   

FreeBSD 7.0 Install

Install using just the boot-cd, since I then just downloads the packages from the net. 

During the installation I select the "Minimal Install" since it is to be used as a server and I want it as minimal as possible.

  1. Select minimal install
  2. Partition the disk (I just use the whole disk in one partition)
  3. Assign disk labels, The easiest is just to let it do it automatically and this is also a good solution, if you do not have any special requirements.
  4. More or less all the questions asked by the installation is sefl explaining.

Howto install the man pages

Log in a root and type:


Here you do the following:

Configure > Distributions > Select Man and Info by press space bar > Ok

When prompted for to choose Installation media select either CD or FTP/HTTP.

Now you can just exit the sysinstall tool.


To be able change your user to root, when logged in through SSH, you have to be in the "wheel" group.

ee /etc/group


Howto install the Ports tree

Just type the following command, which will dowload the Ports tree and extract it.

portsnap fetch extract

To make the ports tree "update" I add the following command to /etc/crontab

ee /etc/crontab
0       5       *       *       *       root    portsnap -I cron update && pkg_version -vIL=

This command makes the system fetch updates to the ports tree every night at 5.
When the updates are downloaded, it will check if there are updates to any of the installed packages and send a mail to root containing this information. Therefore remember to read root mail, or redirect it to another email adress. This is done by editing /etc/aliases and comment in root with a mail adress:

ee /etc/aliases

Run the following command to rebuild the aliases database.


This ports update, wont extract the ports into the ports tree (because of the -I parameter), it can be extracted with the following command:

portsnap update

Now it is time to begin installing packages. A neet tool to find these is "whereis" like the following example:

whereis bash
bash: /usr/ports/shells/bash

Bash Install

Since Bash is my favorite console, I start by installing bash:

cd /usr/ports/shells/bash
make install

When Bash is installed you change your default console the bash. Change the shell line to the following:

Shell: /usr/local/bin/bash

Mc install

Well Midtnight Commander is a need tool, even though I know some thinks it is a bit "to easy" and like the command way..... I still think it comes handy somtimes.

cd /usr/ports/misc/mc
make install

Proftpd install 

Install the proftpd ftp server by:

cd /usr/ports/ftp/proftpd
make install

select Quota -> OK

Quota does not have to be installed, but I do it to have the possibility to make quota on users uploads.

To configure Proftpd start by adding it to /etc/rc.conf, then edit the configuration file:

echo 'proftpd_enable="YES"' >> /etc/rc.conf
ee /usr/local/etc/proftpd.conf

Apache22 install

Install the Apache22 webserver by:

make install

Then enable Apache22 by adding it to /etc/rc.conf

echo 'apache22_enable="YES"' >> /etc/rc.conf
echo 'apache22_http_accept_enable="YES"' >> /etc/rc.conf

Php5 Install

Install Php5 (Php4 is about to die) 

cd /usr/ports/lang/php5
make install

Enable the Build Apache module

When the install is done, remember to add the typehandler to the apache configuration:

ee /usr/local/etc/apache22/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex index.html index.php

MySQL 5.0 Install

Install the MySQL 5.0 database by:

cd /usr/ports/databases/mysql50-server
make install

Configuration of MySQL 5.0 server

echo 'mysql_enable="YES"' >> /etc/rc.conf
mysqladmin -u root password <the password>

PhpMyAdmin Install

Now install PhpMyAdmin, a tool to manage the MySQL database.

cd /usr/ports/databases/phpmyadmin
make install

Check MYSQLI    Improved MySQL support

MySQLI is the MySQL database connection support of Php5

Apache22 Configuration of PhpMyAdmin

    Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

    <Directory "/usr/local/www/phpMyAdmin/">
        Options none
        AllowOverride Limit

        Order Deny,Allow
        Deny from all
        Allow from
Please edit to suit your needs.
$i = 0;
$cfg['ForceSSL'] = true; (Then you need to setup SSL)
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['user'] = '';

Subversion Install

Subversion is a version control software. In this case, I am to use it to check out the newest version of the webmail client Roundcube:

cd /usr/ports/devel/subversion
make install WITHOUT_BDB=yes

Roundcube Install

As a webmail client I use Roundcube. It looks nice and performs acceptable. To get the newest version I download it from their repository using svn:

svn checkout

Read the documentation to know how to configure the Roundcube mail client.

Add the following to the Apache22 httpd.conf:

Alias /mail/ "/usr/local/www/roundcube/"
<Directory "/usr/local/www/roundcube/">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all

GD Install

The graphic libraries used by many web projects:

cd /usr/ports/graphics/gd
make install

Cacti install

The SNMP monitor tool cacti:

cd /usr/ports/net-mgmt/cacti
make install

Cacti configuration: Do as you are told by the installer and add the database tables, thereafter you can add the following line to crontab and add it to Apache22 httpd.conf:

*/5 * * * * cacti /usr/local/bin/php /usr/local/share/cacti/poller.php > /dev/null 2>&1
ee /usr/local/etc/apache22/httpd.conf

Alias /cacti "/usr/local/share/cacti/"
<Directory "/usr/local/share/cacti/">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

Php Tokenizer install

Since I use som applications:

make install

ImageMagick install

The ImageMagick graphics tools, also used by manu web applications:

cd /usr/ports/graphics/ImageMagick
make install 

Screen Install

UUPPPPPSSSS... I allmost forgot to install Screen, (I where to leave with my laptop, and a friend asked.... You did compile in screen??? And I said..... I knew i where missing something.....):

cd  /usr/ports/sysutils/screen
make install

AWStats Install

The Web statistic tool:

cd /usr/ports/www/awstats
make install

Apache22 configuration of httpd.conf:

Alias /awstatsclasses "/usr/local/www/awstats/classes/"
Alias /awstatscss "/usr/local/www/awstats/css/"
Alias /awstatsicons "/usr/local/www/awstats/icons/"
ScriptAlias /awstats/ "/usr/local/www/awstats/cgi-bin/"

<Directory "/usr/local/www/awstats/">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all

Add the following line to /etc/crontab:

21      *       *       *       *       root   /usr/local/www/awstats/tools/ now -awstatsprog=/usr/local/www/awstats/cgi-bin/ -configdir=/etc/awstats > /var/log/awstatslatest.log

Portupgrade Install

On FreeBSD Portupgrade is a tool you cannot be without. This tool is (as its name suggest) used to upgrade installed ports to new versions. This tools is installed like this:

cd /usr/ports/ports-mgmt/portupgrade
make install

And used like this:

portupgrade -ra 

This command will upgrade all ports and their dependencies,

Rdiff-Backup Install

Well a backup is always nice to have (yeah I know a real master cries instead of making backups).

cd /usr/ports/sysutils/rdiff-backup
make install

WGET install

Noooo I almost forgot the most important tool on a console managed server.... WGET...

cd /usr/ports/ftp/wget
make install

Sorry about that :)


^ Top | Copyright © 2007| css | xhtml