Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 49: Line 49:
 1. Network configuration - You will ned the IP addresses of:  1. Network configuration - You will need the following niformaion:
Line 52: Line 52:
    * Gateway
    * Primary and secondary DNS servers
    * IP address of gateway
    * IP address of primary and secondary DNS servers
Line 57: Line 57:
 1. NTP Setup  1. NTP Setup -
    * Get full domain names of at least two NTP servers (called '''ntp1.domain''' and '''ntp2.domain''' below)
    * Set system time with ntpdate:
Line 60: Line 62:
    ntpdate -u ntp.softxs.ch
    cd /etc/rc.d
    ./ntpd restart
ntpdate -u ntp1.domain
    }}}
Line 64: Line 65:
    vi /etc/ntp.conf
    server ntp
    * Configure NTP servers, enable and start NTP daemon
Line 67: Line 67:
    vi /etc/rc.conf
    # Add:
    xntpd_enable="YES"
    :x
    {{{
vi /etc/ntp.conf
server ntp1.domain
server ntp2.domain
:x
Line 72: Line 73:
    /etc/rc.d/ntp start vi /etc/rc.conf
# Add:
xntpd_enable="YES"
:x
Line 74: Line 78:
    ntpq -p /etc/rc.d/ntp start
    }}}

    * Check NTP is running and has connected to servers:

    {{{
ntpq -p
    }}}


 1. Install and run CVSUP.

    * CVSUP updates the ports collections and ensures that you install the latest applications and package versions. Basically
      it updates all the make files in the directory tree /usr/ports (or other directory trees depending on the configuration).

    * Install cvsup (this can take 10-20 minutes)

    {{{
cd /usr/ports/net/cvsup-without-gui
make install
    }}}

    * Configure a '''ports supfile'''

    {{{
cd /root
mkdir cvsup
cd cvsup

vi ports-supfile
# Add the following
*default host=cvsup.ch.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix

*default compress

#src-all
#doc-all
ports-all
:x
    }}}

    * Create script to run the runs the ports file: Pot the following code
      into the file /root/cvsup/run-cvsup.sh, then set execute permissions on the
      file.

    {{{
#!/bin/sh
#
# cvsup options:
#
# -g Disables GUI
# -L 2 Log verbosity=2
#

PROD=$0
TS=`/bin/date +'%Y%m%d-%H%M'`

CVSUP=/usr/local/bin/cvsup

CVSUP_OPTS='-g -L 2'
CVSUP_SUPFILE='ports-supfile'
LOG_FILE=${CVSUP_SUPFILE}-${TS}.log

if [ ! -f ${CVSUP_SUPFILE} ]
then
  echo "${PROD}: No such file: ${CVSUP_SUPFILE}"
  exit 1
fi

echo "${PROD}: Log file: ${LOG_FILE}"
echo "${PROD}: SUP file: ${CVSUP_SUPFILE}"
echo "${PROD}: Start: `date`"

${CVSUP} ${CVSUP_OPTS} ${CVSUP_SUPFILE} > ${LOG_FILE}

echo "${PROD}: Done: `date`"

    }}}

    * Run cvsup: This could take 10-15 minutes (depending on the network connection)

    {{{
chmod +x run-cvsup.sh
./run-cvsup.sh ports-supfile
Line 81: Line 172:
 1. CVSUP

FreeBSD System Setup

Introduction

This page explains how to setup a FreeBSD system capable of acting as a DrawMGT server. FreeBSD differers from Linux systems in that the basic installation includes very few users tools or applications by default. This means that you need to install all application support tools that DrawMGT requires, like Apache, MySQL and PHP.

FreeBSD is well documented. See the FreeBSD Handbook

Installing FreeBSD applications, called ports is simple and is explained here.

The basic steps to prepare a FreeBSD server are:

  1. Install the base operating system
  2. Setup disk mirroring
  3. Install support software
  4. Install other support tools
  5. Install and test DrawMGT

These steps are described below.

Base Operating System Installation

  1. Donwload an ISO image of the latest production production release:
    • http://www.freebsd.org/where.html

    • Typically you want the ISO disk-1. E.g. for release 7.2 its:
      • 7.2-RELEASE-i386-disk1.iso
    • Alternatively download:
      • 7.2-RELEASE-i386-dvd1.iso.gz
    • Note that other the CDs are not required
  2. Put the CD (or DVD) in the system and boot
  3. Disk partitions - Setup the following partitions (assuming disk > 300 GB):

    • Partition

      Size

      Description/Contents

      /

      1 GB

      root partition

      swap

      2-4 GB

      swap parition

      /var

      10 GB

      MySQL DBs and logs

      /tmp

      10 GB

      Make big enough to store a DVD ISO

      /usr

      20 GB

      Applications and ports

      /e/vol001

      all remaining free space

      Web trees and backups

    • Note: Later you will make a symbolic link from /home --> /e/vol001/home

  4. Network configuration - You will need the following niformaion:
    • Hostname and domain for the machine
    • IP address for the machine
    • IP address of gateway
    • IP address of primary and secondary DNS servers

Post Installation Tasks

  1. NTP Setup -
    • Get full domain names of at least two NTP servers (called ntp1.domain and ntp2.domain below)

    • Set system time with ntpdate:
      ntpdate -u ntp1.domain
    • Configure NTP servers, enable and start NTP daemon
      vi /etc/ntp.conf
      server ntp1.domain
      server ntp2.domain
      :x
      
      vi /etc/rc.conf
      # Add:
      xntpd_enable="YES"
      :x
      
      /etc/rc.d/ntp start
    • Check NTP is running and has connected to servers:
      ntpq -p 
  2. Install and run CVSUP.
    • CVSUP updates the ports collections and ensures that you install the latest applications and package versions. Basically
      • it updates all the make files in the directory tree /usr/ports (or other directory trees depending on the configuration).
    • Install cvsup (this can take 10-20 minutes)
      cd /usr/ports/net/cvsup-without-gui
      make install
    • Configure a ports supfile

      cd /root
      mkdir cvsup
      cd cvsup
      
      vi ports-supfile
      # Add the following
      *default host=cvsup.ch.FreeBSD.org
      *default base=/var/db
      *default prefix=/usr
      *default release=cvs tag=.
      *default delete use-rel-suffix
      
      *default compress
      
      #src-all
      #doc-all
      ports-all
      :x
    • Create script to run the runs the ports file: Pot the following code
      • into the file /root/cvsup/run-cvsup.sh, then set execute permissions on the file.
      #
      # cvsup options:
      #
      #  -g         Disables GUI
      #  -L 2       Log verbosity=2
      #
      
      PROD=$0
      TS=`/bin/date +'%Y%m%d-%H%M'`
      
      CVSUP=/usr/local/bin/cvsup
      
      CVSUP_OPTS='-g -L 2'
      CVSUP_SUPFILE='ports-supfile'
      LOG_FILE=${CVSUP_SUPFILE}-${TS}.log
      
      if [ ! -f ${CVSUP_SUPFILE} ]
      then
        echo "${PROD}: No such file: ${CVSUP_SUPFILE}"
        exit 1
      fi
      
      echo "${PROD}: Log file: ${LOG_FILE}"
      echo "${PROD}: SUP file: ${CVSUP_SUPFILE}"
      echo "${PROD}: Start: `date`"
      
      ${CVSUP} ${CVSUP_OPTS} ${CVSUP_SUPFILE} > ${LOG_FILE}
      
      echo "${PROD}: Done:  `date`"
      
    • Run cvsup: This could take 10-15 minutes (depending on the network connection)
      chmod +x run-cvsup.sh
      ./run-cvsup.sh ports-supfile

Disk Mirroring Configuration

Software Package Management

Encrypted Filesystem Configuration

  1. To be completed

Main Applications to Install

  1. PHP5
  2. MySQL Server/Client
  3. Apache

Apache Configuration

Basic Configuration

Virtual Host Configuration

Additional Tools Required for DrawMGT

FreeBsdSystemSetup (last edited 2009-10-30 17:13:00 by 183-56-197)

Copyright 2008, SoftXS GmbH, Switzerland