Installing FreeBSD 9.1 x64

January 31, 2013

+++Objectives+++

Install FreeBSD 9.1 x64
Install Gnome and XFCE (like to have a second option)
Setup Jails

+++ Hardware +++

motherboard: ASRock 970DE3/U3S3
cpu: AMD FX 6100 Six-Core
video card: Nvidia GeForce 8400GS
network cards:
-Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
-Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
-Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
-Intel Corporation 82541PI Gigabit Ethernet Controller
storage:  (1) 128GB SSD SATA III drive and (1) 1TB Hitachi 7200rpm SATA II drive

+++Partition Setup+++

I put my /boot and / directory on my SSD using UFS.  Then I put my /usr and /home directory on my SATA HDD using UFS.
I’ve used ZFS and I’m not that impressed with it at the moment, still a little buggy and the main feature is utilizing SSD drives better and snap shots.  Personally, UFS worked better on my SSD than ZFS did, even fine tuned ZFS.
***if you are new to FreeBSD or PC-BSD, keep the defaults and choose guided partition table and let the system setup.

+++The Install+++

Several ways of installing.  I went old fashion with downloading the DVD .iso and installing from a DVD disc
Follow the install instructions here in the handbook  CLICK HERE

The handbook is your friend!  Use it!

NOTE:  during the install, when you get into putting the name for your computer, make sure you use a full dns name.  For example,  mycomputer.mydomain.com.   I used computername.local    If you do not do this, you’ll get a timeout during the initial boot of your system and it will hang trying to resolve the full hostname.

During the setup it will prompt you to install Docs, SSD trim, and a few other things.  I only did the Docs and 32-bit libraries.

+++The Setup+++

So you’ve rebooted, removed the DVD and are now booted into your live environment.

Login as root

Run the following commands…

# freebsd-update fetch
# freebsd-update install

Reboot

Now lets get the ports directory filled so we can install software…

# portsnap fetch
# portsnap extract

NOTE: If you ever go to update your ports collection use…   (update your ports at least once a month)

# portsnap update

Now lets install your kernel sources, you’ll need them for gnome…but first we need to install subversion.  Its used to pull down the sources from the repo’s…

# cd /usr/ports/devel/subversion
# make -DBATCH install clean
# rehash

Now run the subversion command…

# svn checkout https://svn0.us-west.freebsd.org/base/releng/9.1/ /usr/src

Now lets install X11…

# cd /usr/ports/x11/xorg
# make -DBATCH install clean

Now lets install Gnome…

# cd /usr/ports/x11/gnome2
# make -DBATCH install clean

Now lets install XFCE

#cd /usr/ports/x11-wm/xfce4
# make -DBATCH install clean

IMPORTANT:  You will get an error message that xfce-notifyd conflicts with package notifications-0.7 whatever.  These packages are basically the same, the notifications package is used by Gnome but they can use one or the other but not both.  So we use “portmaster” command to fix this.

Install portmaster

# cd /usr/ports/ports-mgmt/portmaster
# make -DBATCH install clean

# portmaster -o deskutils/xfce4-notifyd notification-daemon

Continue building XFCE…

# cd /usr/ports/x11-wm/xfce4
# make -DBATCH install clean

After that is complete run portmaster command below to check for any dependency issues but you should be good…

# portmaster –check-depends

Now we configure the X server…

- follow the xorg guide on FreeBSD website HERE
Also, you can install two nvidia tools…. nvidia-xconfig and nvidia-settings found HERE  see down at bottom of page.  nvidia will auto configure your settings.

Now we setup GDM…follow instructions HERE

After you configure, reboot and you should be at GUI login in prompt and login to your new Gnome environment.

Install all desktop related tool and programs that you need from the ports as described in the handbook.
Now for jails.  FreeBSD 9 changed the way you can do jails a bit.  You can use the old way by building your jails and putting your configurations in /etc/rc.conf or you an do the new way and use the “jail” command and /etc/jail.conf file.   I will work with the newer method.  Also, you can use ezjail but do a google search on that as I will not be using that way.  There is also PC-BSD which has a GUI interface to manipulate jails and simplify jails.

*** Jails ****

Follow the instructions in the Jail man page HERE   Scroll down to about half way, the instructions start there.

Once thats completed, you’ll need to create a /etc/jail.conf file.  Below is mine…

ssh {
path = /usr/jails/ssh;
mount.devfs;
host.hostname = ssh;
ip4.addr = 192.168.1.18;
interface = re1;
allow.raw_sockets = true;
exec.start = “/bin/sh /etc/rc”;
exec.stop = “/bin/sh /etc/rc.shutdown”;
}

You need to change your “interface” to your network cards interface, change your IP address to your network, and if you want your jails name.

After you have done this…you can easily start and stop your jail from outside the jail with the command…
jail -c ssh start
jail -r ssh  stop
jail -cr ssh  restart

Remember to add a /etc/resolv.conf into your jail so it can find a nameserver.

So, that is the new way of making a jail.  Not to bad.  But this will not let your jail start automatically at boot time.  You still have to do it the old way with putting info into the /etc/rc.conf file. Example of my file is below…

# Jails
jail_enable=”YES”
jail_list=”ssh”
jail_ssh_rootdir=”/usr/jails/ssh”
jail_ssh_hostname=”ssh.local”
jail_ssh_ip=”192.168.1.18″
jail_ssh_devfs_enable=”YES”
jail_ssh_exec_start=”/bin/sh /etc/rc”

ifconfig_re1_alias0=”inet 192.168.1.18 netmask 255.255.255.255″

You have to create an alias for your network card with the IP address of the jail…see above…again change the name of the interface per your network card.  You have to start with alias “zero”.

Do you want your jail to ping from inside?  add this into your /etc/sysctl.conf

security.jail.allow_raw_sockets=1

Restart your computer, jails should fire up.  You should be good to go.

FYI:  jail command looks at the “jail.conf” file…the jail info in rc.conf is used at boot.  You can use the command “jls” to view what jails are running.  you can also use “jexec” to get into the jail shell.  Example…jexec 1 sh    the 1 is from the jls, meaning jail #1 in the list.

 

 

ECS Geforce6100 motherboard and GeForce 8400GS video card

October 31, 2012

On this motherboard the PCI-Express is a 1.0.  The video card is a PCI-Express 2.0 but 2.0 will work with 1.0, it just downgrades to 1.0.   In the BIOS for this board you only have the options to change “Init display” which is PCI, onboard or PCIx.   Long story short, nothing worked when installing this video card.  I could not get a picture.

I researched the issue and found that another person had the same issue but his motherboard was a version3, mine is a v2.  He tried updating the BIOS and trying different cables and interfaces.  (this card is equipped with VGA, HDMI, and DVI.   Nothing worked for this guy.

Well I got a wild hair up my but and for some odd reason decided to remove the VGA port off this card.  (its modular in case you want to convert to a low profile bracket).   After I removed the VGA port, I popped the card in and it works!!!!  Thankfully I had a DVI to VGA adapter but it works.

So I’m not sure why the card will not with the VGA adapter, some sort of conflict with the onboard one?  Idk, I dont care.  It works.

FreeBSD 9.1 RC2

October 17, 2012

 

Check it…

http://lists.freebsd.org/pipermail/freebsd-stable/2012-October/069998.html

FreeBSD 8.3 on ALIX router board

October 16, 2012

I’ve used PF Sense on my router board for a while.  Great firewall, great features.  Thing is, I dont need all those features.  I had FreeBSD on an old machine and did some testing with using PF on it with no other services running.  The performance was wicked better.  So I wiped off PF Sense and put FreeBSD on my ALIX board running PF Firewall.  My throughput is much better and its a more fun experience learning about the PF firewall and customizing it to my liking.

*side note – I used 8.3, I could have gone with 9.0 but 8.3 is going to be supported a lot longer.

Below are the instructions.  I found someone who already had done this but there are a few changes you’ll have to make compared to how they did since there was a significant time gap in release setup.

Follow this link to get started…

http://www.freebsdonline.com/content/view/589/506/

change to make are as follows…

1.  on the line where you change ttyd0 from ‘off’ to ‘on’,  you’ll need to look for ttyu0.  FreeBSD changed this in 8.3.

That’s it!  Setup your ALIX board as needed.

IBM T61 laptop – PC-BSD, Suse, Fedora

April 13, 2012

Okay so I needed to update my Ubuntu (dual’d with Win7) on my laptop.  Had some issues with Ubuntu 10/11 with updating and crap not working after updates, got exhausting.

So I decided to try PC-BSD 9, OpenSuse 11, and Fedora 16…and in that order here was my results…

PC-BSD – everything worked well except sound wasnt very high and suspend/resume and a few feature issues that werent a big deal to me such as the backup feature they have.  Couldnt find a fix for the suspend/resume, biggest annoyance.

OpenSuse – everything worked well except there was a bit of slowness here or there.  had some issues with screensaver, nothing to big.

Fedora 16 – everything worked.  Period.

I have left Fedora 16 on.  My only problem with Fedora is their release cycles are too close together.  Not long enough support.  Mainly due to their super bleeding edge approach.

But Fedora has came along way since I last used it which was probably version 6 or 7.  I’m a strong FreeBSD fan.  Was hoping to rock PC-BSD but its my laptop and I just want my OS and features to just work.  If it was a server or desktop, definitely would have gone with FreeBSD.

 

FreeBSD 9 – Firefox & flash plugin

February 2, 2012

follow the normal instructions in the FreeBSD handbook on the website but before you start installing linux_base-f10, you need to load the following linux module into your kernel…

# kldload linux

If you dont, you will get an error saying to load linuxulator which is does not exist, its in the linux module.

Exchange 2010 – EMC : initialization error

October 6, 2011

I was at a client site, went to go open EMC, and it would just hang after I clicked the little plus sign next to the server.

I got the following error…

So I restarted the Exchange services…all of them…didnt work.

Then I opened the Exchange PowerShell console…when I opened that, it asked me to specify the server I was connecting to, then it gave me an error saying that WS-management services quota was beyond quota.

I read up on the WS-management service, found that it works with IIS indirectly.  So, I restarted IIS.  Issue resolved.

CentOS 5.6 NTFS mounting issue

October 6, 2011

In order to mount NTFS in 5.6 you have to install the proper packages…below is where and how.

Download fuse & ntfs-3g…. get the latest packages…2010

first do… yum -y install fuse*
ntfs-3g: get it from http://dag.wieers.com/rpm/packages/fuse-ntfs-3g/

After the fuse and ntfs-3g are installed, do your mount…

mount -t ntfs-3g /dev /mnt

IPv4 subnetting…keep it simple

July 15, 2011

If you dont use it, you lose it.  Besides, they have subnetting calculators everywhere now.  Why bother remember?!?  well its still good to remember just in case.

Example:    We will use a class B address but with a Class C mask.  The octet we are interested in would be the 3rd one in this case.  If the mask were a class B, we’d be interested in the second octet.  Anything not ending in a  zero or 255.

Address:  130.4.102.1

Mask:         255.255.252.0

Subnet #:  130.4. 100. 0     How did we find 100?   256 – 252 = 4        whats 4 x ? to make it less or equal to 102?
4  x  25 = 100    100 works!

First Addresss:  130.4.100.1           first address, you just add 1 to the right

Broadcast:     130.4.103.255             100 + 4 -1 = 103   then add 255 to the right, in the forth octect

Last address:  130.4.103.254             just subtract 1 from the end of the fourth octet in the broadcast

Thats all there is to it!

If you want to know how many subnets there can be…just take 256 – 252 (the mask octet) = 4
so the subnets are in increments of 4.

Another example….

address:  200.1.1.130

mask:  255.255.255.224

subnet: 200.1.1.128           256 – 224 = 32    32 x 4 = 128  (128 is less or equal to 130)

first address: 200.1.1.129     add 1 to the subnet

broadcast: 200.1.1.159       128 + 32 = 160 – 1 = 159

last addrss: 200.1.1.158       minus 1 to the subnet of broadcast

CentOS -> Asterisk -> FreePBX

July 2, 2011

I setup Asterisk 1.8 on a CentOS 5.6 (32bit) with FreePBX 2.9*. Install CentOS and do a yum update and reboot. Get that out of the way. I turn off SELinux and iptables initially at install then I customize it later. Your choice.

(*) – we will need to install FreePBX 2.8 first, then upgrade to 2.9 thru the Module Admin in FreePBX Admin page. FreePBX make some major changes to certain config files being used and the MySQL table entries. Supposedly they fixed it but I still had issues going straight to 2.9 and was locked out of my FreePBX Admin page and had to do a crazy backdoor work around.

You will need five different passwords.

PASSWORD1 – Your root password.
PASSWORD2 – Used for the asterisk database user.
PASSWORD3 – Used for the FreePBX administrator.
PASSWORD4 – Used for Flash Operator Panel.
PASSWORD5 – Used for the Asterisk Recording Interface.

Install needed services:

yum groupinstall “DNS Name Server”
yum groupinstall “Web Server”
yum groupinstall “Mail Server”
yum groupinstall “MySQL Database”
yum groupinstall “Development Tools”

 - yum install -y e2fsprogs-devel keyutils-libs-devel krb5-devel libogg libselinux-devel libsepol-devel libxml2-devel libtiff-devel
 - yum install -y gmp php-pear php-pear-DB php-gd php-mysql php-pdo kernel-devel ncurses-devel audiofile-devel libogg-devel
 - yum install -y openssl-devel mysql-devel zlib-devel perl-DateManip sendmail-cf sox

Configure named (dns):

echo “options {” >> /var/named/chroot//etc/named.conf
echo ” directory \”/var/named\”;” >> /var/named/chroot//etc/named.conf
echo ” dump-file \”/var/named/data/cache_dump.db\”;” >> /var/named/chroot//etc/named.conf
echo ” statistics-file \”/var/named/data/named_stats.txt\”;” >> /var/named/chroot//etc/named.conf
echo “};” >> /var/named/chroot//etc/named.conf
echo “include \”/etc/rndc.key\”;” >> /var/named/chroot//etc/named.conf
cd /var/named/chroot//etc/
chmod 640 named.conf
chgrp named named.conf
ln -s /var/named/chroot//etc/named.conf /etc/named.conf

Turn off SELinux and allow firewall rules (if you didnt earlier):

echo “SELINUX=disabled” > /etc/selinux/config
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
/etc/init.d/iptables save

Asterisk uses LAME for audio processing:

cd /usr/src
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz?ts=1292626574&use_mirror=cdnetworks-us-1
tar zxvf lame-3.98.4.tar.gz
cd lame-3.98.4
./configure
make
make install

Install Asterisk 1.8:

cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8-current.tar.gz
tar xvfz asterisk-1.8-current.tar.gz
cd asterisk-1.8.0
contrib/scripts/get_mp3_source.sh
./configure
make menuconfig

The last command will launch the source configuration manager. The only portions you will want to install are app_mysql, app_saycountpl, cdr_mysql, format_mp3, res_config_mysql and EXTRAS-SOUNDS-EN-GSM (which can be found in the Extra Sound Packages sub-menu). Save your selections and exit. Now compile the source and install.

make
make install

Install FreePBX 2.8:

cd /usr/src
wget http://mirror.freepbx.org/freepbx-2.8.0.tar.gz
tar xvfz freepbx-2.8.0.tar.gz
cd freepbx-2.8.0

Database setup:

chkconfig mysqld start
chkconfig mysqld on
mysqladmin create asterisk
mysqladmin create asteriskcdrdb
mysql asterisk < SQL/newinstall.sql
mysql asteriskcdrdb < SQL/cdr_mysql_table.sql

Start MySQL & configure user:

 mysql
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY ‘PASSWORD2′;

GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY ‘PASSWORD2′;

flush privileges;

\q

Change root MySQL password:

mysqladmin -u root password 'PASSWORD1'

Create Asterisk user and permissions: (its okay if user already exist)

useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
chown -R asterisk:asterisk /var/lib/php/session/
chown -R asterisk:asterisk /var/lib/asterisk
 
Update Apache config file:
 
vi /etc/httpd/conf/httpd.conf
- change User and Group from apache to asterisk. 
- change AllowOverride None to All
- set ServerName to FQDN
 
Start Apache and Sendmail:  ( you dont have to configure sendmail if you have a SMTP email server upstream from your ISP.)
service httpd start
service sendmail start
chkconfig httpd on
chkconfig sendmail on
 
Start Asterisk:
 
./start_asterisk start
 
Configure FreePBX:
./install_amp --username=asteriskuser --password=PASSWORD2
 
The next series of prompts will give you default values within square brackets which you can accept by hitting enter. If you wish to change a value, simply type it and hit enter after.
 
* Use the same value except for the following….
  •  FreePBX admin password (default amp111)
  • IP address (default xx.xx.xx.xx)  change to public IP or Internal IP
  • FOP (flash operator panel) password (default passw0rd) change this. 

Change the Asterisk Recording Interface (ARI) password:

vi /etc/amportal.conf

find...
ARI_admin_password=PASSWORD5

and change the AUTHTYPE:

AUTHTYPE=database

Save and Exit.

Add FreePBX to the boot process:

echo "/usr/local/sbin/amportal start" >> /etc/rc.local

Finished with 2.8 install!!! Congrats!

Now go to http://ipaddress and click on FreePBX admin link.  Enter the username and password you specified "asteriskuser".  Go into the Administrators page, click Admin link and update your password, click submit.  Reload your server.  Done!

Now we will upgrade to 2.9...

Check for updates under the Module Admin.  Download all your updates, process them and reload your server again.  Repeat this until no more updates are available. 

Now in the module admin you should see 2.9 upgrade tool.  upgrade it, process it, and reload. 

You should see a link on the left hand side under module admin that says "FreePBX 2.9 upgrade"  click it, go in there and follow the instructions. 

IMPORTANT!!!  Once you have upgraded to 2.9 DO NOT close out your browser!  Go back to the Administrator page, click admin, then update password again, click submit and reload. 

Go to another browswer or computer and access the PBX again...see if you can login. if you can, you are good.  :)  


Follow

Get every new post delivered to your Inbox.