FreeBSD Install

My Goal
My Goal is to make a easy to install PBX Based on Freebsd & Freeswitch & Fusionpbx. I am tired of iso's that don't work/install correctly. So I Have taken the time to walk you through a base install and include a script that uses ports that are maintained outside the bsd ports tree due to the fact they are easier to maintain and update. By Default this script installs nginx and sqlite3.

If you need Apache or another web server you will have to do this yourself. (Please take the time to Document it below if you do.) If you wish to use mysql or Postgresql then you can select them when the nginx port buildsit only installs the connector clients.

You will have to install the mysql or postgresql server either on the same box or a remote server of your choice and configure it properly.

My new install script does all the work. It setus up freeswitch / nginx / sqlite3 / fusionpbx. It will pull and install all the needed all the FreeBSD and Freeswitch dependencies and configuration files for you. I am also working on a simple update script that will help update and maintain your system. I will add them to the bottom of the page with links to them. I also have script for maintaining bsd jail pbx systems I will post.

If you need support or have ideas, or wish to report errors in the script and install & if you wish to help maintain and update the scripts and ports.

Please contact email: r.neese@gmail.com irc: efnet: rneese on #bsdports irc: freenode: rneese in #fusionpbx and #freeswitch

modules not in port
The following modules are not in the freebsd-core port on BSD with reasons why. 
 * 1) applications/mod_osp (needs further devel on bsd)
 * 2) applications/mod_redis (needs further testing)
 * 3) applications/mod_stress (dead module)
 * 4) applications/mod_snipe_hunt (joke module)
 * 5) codecs/mod_sangoma_codec (not supported on bsd)
 * 6) codecs/mod_dahdi_codec (needs further testing on bsd
 * 7) directories/mod_ldap (dead)
 * 8) endpoints/mod_alsa ( not used on bsd)
 * 9) endpoints/mod_opal (currently broken on bsd)
 * 10) endpoints/mod_skypopen (not supported on bsd)
 * 11) endpoints/mod_h323 (does not build on bsd)
 * 12) ../../libs/openzap/mod_openzap (dead renamed freetdm)
 * 13) asr_tts/mod_cepstral(not supported on bsd)
 * 14) event_handlers/mod_cdr_mongodb (make file issues)
 * 15) event_handlers/mod_radius_cdr (needs further work on bsd)
 * 16) languages/mod_yaml (dead)
 * 17) languages/mod_java requires java . looking at the opensource ver.
 * 18) timers/mod_timerfd (linux)
 * 1) Experimental Modules (don't cry if they're broken)
 * 2) ../../contrib/mod/xml_int/mod_xml_odbc (dead)

FreeBSD 8.2 iso's
Use 8.2 for a stable install Download a Freebsd 8.2 install iso and burn it to a disc. i386: ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201105/FreeBSD-8.2-STABLE-201105-i386-disc1.iso amd64: ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201105/FreeBSD-8.2-STABLE-201105-amd64-disc1.iso

FreeBSD8.2 Minimal Install
Boot the iso and when you get the install menu select Custom Install. goto partition hit enter hit A and answer yes select standard next goto label and hit a=auto q=quit goto distribution and select minimal (a) hit tabkey and enter goto media select cd/dvd then goto commit. the os will now install

FreeBSD Post Install Configuration
After the os installs it will ask if you want to configure the base system select yes. scroll down and select root password and set the password. scroll down and select timezone and set your time zone. Scroll to network and the scroll to interface and hit the spacebar and configure your network card. still in the network area select ntp and choose a ntpserver. Then select sshd and tcp extensions. scroll up to exit and hit the enter. scroll to startup and scroll down and deselect quotas. then scroll up to exit and hit enter. scroll up to exit. hit tab and select exit install. Remove the cdrom and then reboot. You now have a base/minimal install.

Freebsd + Freeswitch + FusionPbx - Installation Script
Get the script here. (Port and scripts bing updated) exec ./Freebsd-Fusionpbx and let it do its thing answering questions/prompts as needed.

When the script goes to the sounds port and pulls up the sox selection you need to deselect ffmpeg if you do not wish to bloat your system with un-needed xorg libs.

When the script prompts you for php build you will need to select the php-fpm module this replaces fastcgi.

Also when it prompts you for nginx you will need to select the http_ssl_ module allowing for https to function correctly

I will be porsting a updated script shortly to help you maintain your install when updates come out.

FreeBSD 9.x iso's For Devel and Testing
Use 9.x for beta testing and development. Download a Freebsd 9.x install iso and burn it to a disc. ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201105/FreeBSD-9.0-CURRENT-201105-i386-dvd1.iso ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201105/FreeBSD-9.0-CURRENT-201105-amd64-dvd1.iso ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/201107/FreeBSD-9.0-CURRENT-201107-ia64-release.iso

FreeBSD 9.x Minimal Install
In 9.x the installer changes.

Freebsd 9.0 New installer Basic Setup

select install select UnitedStates iso-8895-1 set hostname deselect games and docs for a minimal install select guided and full partition and then goto exit hit save. set root passwd setup network interface set up clock / ntpdate setp daemons ssh and ntpd is all thats needed at this point next add a user if you wish next go to exit and reboot

after reboot login and ee /etc/ssh/sshd_conf and rm the # from infront of PermitRootLogin and change no to yes then /etc/rc.d/sshd restart

now you can ssh into the box.

This is a quick install using the basics. I will work on a more in-depth install later. when prompter for docs and ports and src deselect all.

Freebsd + Freeswitch + FusionPbx - Developers Installation Script
'''If you wish to use the development ports. Please pull (ports and scripts being updated) ''' This script incluse a git port for freeswitch and a svn port for fusionpbx and any other ports I am currently testing to add to the freeswitch build.

When using the devel ports you need to refer to a few things to update the make files in the ports

http://files.freeswitch.org look at the sounds and music versions if they change you will have to edit thier Makefiles and change the version numbers.

http://code.google.com/p/fusionpbx/source/list to get the latest subversion number. Then edit the devel-ports/www/fusionpbx-svn/Makefile and change the SVN_REV= number to the latest.

To update the devel-ports/net/freeswitch-core-git & run make git-clean & make git & make git-version. Edit the make file and change the GITVERSION= number.

I am working on a script to dothis in the future.

Postgresql Server Setup (localhost)
\Fresh pgsql install/ cd /usr/ports/database/postgresql84-server && make install clean To set and configure PgSQL for use with FusionPBX, Follow this line for line. for a fresh pgsql install follow : su pgsql initdb -D /usr/local/pgsql/data postmaster -D /usr/local/pgsql/data >logfile 2>&1 & createuser -S -e FusionPBX createdb -O FusionPBX FusionPBX psql -d FusionPBX -U FusionPBX alter user FusionPBX with password 'pbx2010';or any passwd you want ";" required psql -f /usr/local/www/fusionpbx/includes/install/sql/pgsql.sql FusionPBX exit from su

For a existiting pgsql database install follow: su pgsql createuser -S -e FusionPBX createdb -O FusionPBX FusionPBX psql -d FusionPBX -U FusionPBX ALTER USER FusionPBX with PASSWORD 'pbx2010'; or any passwd you want, ";" required

MySql Setup (localhost)
mysql install via ports cd /usr/ports/databases/mysql55-server make install clean echo mysql_enable="yes" >> /etc/rc.conf /usr/local/etc/rc.d/mysql start

Final Step
Reboot your system and point your browser to: https://ip.of.the.pbx or https://domain.name.box

FreeBSD PBX Jail Scripts
These scripts are for setting up and maintaing PBX Jails

http://dl.dropbox.com/u/152504/scripts/jails/add-pbx http://dl.dropbox.com/u/152504/scripts/jails/rm-pbx http://dl.dropbox.com/u/152504/scripts/jails/update-base-jail http://dl.dropbox.com/u/152504/scripts/jails/update-jail http://dl.dropbox.com/u/152504/scripts/jails/update-pbx-template http://dl.dropbox.com/u/152504/scripts/jails/update-ports-jails