Monday, May 12, 2008

Gimp

Gimp is a great open source replacement for photoshop. It has allot of features but not as many as photoshop. You can fix red eye do layer transparency, it is a great product for being free and it is very light weight also. Another simple program to install you browse to the port folder.
#cd /usr/ports/graphics/gimp
#make install clean
You can't tell me you, you aren't liking how simple FreeBSD is.

Libraries

Well I've read about people having this problem in forums. They can't get stuff like firefox mplayer gio-fam-backend to compile through ports. This is pretty easy to fix, it's because FreeBSD 7.0 installs an old version of glib. It's relatively simple to correct just browse over to the glib20 folder
#cd /usr/ports/devel/glib20
#make deinstall
Now the old version is uninstalled and now all you have to do is install the new version.
#make install clean
Now you can compile till your little heart is content, now wasn't that easy?

Installing FreeBSD

Realistically this should have been my first post, but I started with a preconfigured box. The first time I installed FreeBSD a couple years ago it took me two days to learn how to configure everything the way I wanted. Since the FreeBSD has becoming allot easier to me anyways. My roommate tried installing FBSD and failed miserably and I had it up and running in 10min. For this example I will be using FreeBSD 7.0 release version. When you boot of the disc it will ask you what country you are in. If you don't know the answer to this then you probably shouldn't be installing FreeBSD. Once you choose you country you will be prompted with the main menu.

I start off by choosing standard, once you choose it you will be prompted by an fdisk message. Press enter to continue. Now at the fdisk partition editor (I'm going to assume you have a blank drive.) Press A to use Entire disk for the editor looks something like this.Press Q to exit the fdisk manager. For the Boot manager I select "Install the FreeBSD Boot Manager" and press ok. Now you will need to create BSD partitions inside of the fdisk partition. Press OK. Press A to auto partition it and it will look something like thisPress Q to exit the partioner and move on to Distributions.
I choose X-User to make life simple it the easiest time now to install Xorg. So once you choose what you want scroll up and hit exit. You will now be prompted for Instillation media, I always use FTP I find it quicker. Once you choose your instillation media click yes on the User Confirmation Request to start the install.When its done installing you will be prompted with a Congratulations Box, click OK.
Now you will get a couple boxes asking questions, I say no to all of them except SSH login, time zone and linux binary.
“Do you want this machine to function as a network gateway?”
“Do you want to configure inetd and the network services that it provides?”
“Would you like to enable ssh login?”
“Do you want to have anonymous FTP access to this machine?”
“Do you want to configure this machine as an NFS server?”
“Do you want to configure this machine as an NFS client?”
“Would you like to customize your system console settings?”
“Would u like to set this machines time zone now?”
“Would you like enable linux binary compatability?”
“Does this system, have a PS/2, serial, or bus mouse?”
Now you will be prompted if you want to install any ports select yes.
Feel free to install any ports you want, I only install KDE for I have a good gui to go on. So you would scroll down to kde and press enter. I just install bare kde-3 I scroll down and select kde-3.5.8 and it will automatically check all the dependencies that are required as well. So you just check OK and you will go back to the previous menu and select Install.When FreeBSD is done installing it will ask you if you want to seyup a user account select yes and name it what you want. Be sure to put the user account in the wheel group this is what will allow your user account to perform su requests which are veryhelpful especially if you are installing somehting through ssh, by default root account can not log on to an ssh session.

After your user account is settup press OK and you will be prompted to make a root password, after that is done you will get a prompt asking if you want to Visit the general configuration menu for a chance to set any last options. I click no then Exit and reboot. Now you have a FreeBSD box that runs KDE and ssh. Good luck!






Thursday, May 8, 2008

Mounting

Well It seems I've over looked the simple things I don't think twice about such as mounting usb device and hard drives. A good thing about FreeBSD 7 is it has built in support for FAT and NTFS right out of the box you don't need to compile your own kernel. Lets start with something simple an USB flash drive. If you use them for school or work they are probably going to be formated with FAT file system. So when you plug it into your computer and do a dmesg you will get some out put like this.
da0 at umass-sim0 bus 0 target 0 lun 0da0: Removable Direct Access SCSI-0 deviceda0: 40.000MB/s transfersda0: 3935MB (8058880 512 byte sectors: 255H 63S/T 501C)
You can mount it anywhere you wan't I choose to do it neatley and make a usb directory in mnt folder
#mkdir /mnt/usb
Now to mount it
#mount -t msdos /dev/da0s1 /mnt/usb
Now the device is mounted in /mnt/use and you can browse to that folder and see the contents.

It's pretty similar for ntfs drive. Here is the output for my ntfs drive.
da1 at umass-sim1 bus 1 target 0 lun 0da1: Fixed Direct Access SCSI-4 deviceda1: 40.000MB/s transfersda1: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)
Make the directory where you want to mount it.
#mkdir /mnt/500
Now we mount it
#mount -t ntfs /dev/da1s1 /mnt/500
Relativley simple

Mounting an IDE or SATA is a little harder but still easy. Ok so lets say you installed a hard drive Im going to use NTFS for example here. dmesg is going to show it but good luck finding it on the list, since it's detected at boot. So the easier way is to view the dev directory.
#cd /dev
#ls
(Im going to trunkate the output to sata drives)
ad14
ad14s1
ad14s1a
ad14s1b
ad14s1c
ad14s1d
ad14s1e
ad14s1f
ad15
ad15s1
From this list we see the ad14 drive had 7 partitions, we can assume this is a unix partition (unless you are partition happy on all your drives) A diffrent partition is made for /, /sys, /home etc...
ad15 has one partition so its safe to assume this is the NTFS drive (unless you make funky partitions which in that case I would assume you would know which drive is yours lol)
Once again make the dir where you want to mount it.
#mkdir /mnt/drive
And mount it
#mount -t ntfs /dev/ad15s1 /mnt/drive
Now you are free to browse you drives.
If you want to know how to mount cd and iso please look at the source tree post they are both covered in there.

Wednesday, May 7, 2008

Apache

I will be showing you how to setup an apache web server. It is alot easier to setup an Apache server on a Fedora box then it is on FreeBSD. They both work fine once they are setup but I have to say I noticed FreeBSD is faster when using the same bandwidth. Apache on FreeBSD is very picky about the FQDN (fully qualified domain name) Which can be a pain in the ass. So first we change to the apache port directory
#cd /usr/ports/www/apache22
#make install clean
I enable MYSQL support encase later on I ever want to throw on a forum it will make life a lot easier.
When it's done compiling you can try to start to see the FQDN error
#httpd
httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.2.107 for ServerName
[Wed May 07 09:34:15 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
To get apache to work we have to edit the httpd.conf file
#nano /usr/local/etc/apache22/httpd.conf
Then you 'Where Is' Servername you change the example host.domain.com:80 to your domain or If you don't own a host name you will put in the computer IP address not the internet IP address to make it read like
ServerName 192.168.2.107:80
80 represents what port you want it to listen on http is normally 80 but you can make it whatever you want as long as it dosn't conflict with another program. For all of you who aren't programers take out the # at the begining of the line. # tells the script to skip over that line. So now you save the config file and run it.
#httpd
If you browse to your IP address you should get a webpage that says
"It works!"
Now you have an Apache server. The home directory for your html files is /usr/local/www/apache22/data Now you can start building your website, Goodluck!

Monday, May 5, 2008

VNC

Today Ill be showing you how to install VNC, its pretty simple VNC allows you to connect to your computer through a Java applet which is pretty handy, you don't need any third party client software. i use tightvnc so to install tightvnc we do the following.
#cd /usr/ports/net/tightvnc
#make install clean
When its done compiling you start tightvnc
#vncserver
You'll get out put like this
You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n
So enter the password and if you would like a view only password.

Friday, May 2, 2008

Kernel Source Tree

In the process of Installing ports you might come across an error missing kernel source tree. I'm going to show you how to install the source tree via CD and ISO.
To install source via cd you are going to be in the / directory
1st mounts the cd-rom
#mount /cdrom
Next make this sys directory which some programs look for
#mkdir -p /usr/src/sys
link it with the actual sys directory some programs will look in /sys and other in /usr/src/sys
#ln -s /usr/src/sys /sys
Next copy ssys files from cd-rom
#cat /cdrom/src/ssys.[a-d]* | tar -xzvf -
Copy sbase files from cd
#cat /cdrom/src/sbase.[a-d]* | tar -xzvf -
Now you have all your kernel source on your hard drive.
If your like me and don't have a cdrom you can do it from and iso image as well
Make sure you are in the / directory
make the location where you are going to mount the iso
#mkdir /iso
mount the iso mine is in /root direcotry
#mdconfig -a -t vnode -f /root/7.0-RELEASE-i386-disc1.iso -u 0
#mount -t cd9660 /dev/md0 /iso
Next make this sys directory which some programs look for
#mkdir -p /usr/src/sys
link it with the actual sys directory some programs will look in /sys and other in /usr/src/sys
#ln -s /usr/src/sys /sys
Next copy ssys files from iso
#cat /iso/src/ssys.[a-d]* | tar -xzvf -
Copy sbase files from iso
#cat /iso/src/sbase.[a-d]* | tar -xzvf -
Now you have all your kernel source on your hard drive.

Audio

One of the main problems I hear about from New FreeBSD users is the lack of audio. This isn't linux it's unix so of course it can't be ease lol :) but there is a relativley easy way to get audio to work.
We will let the kernel try to detect.
#kldload snd_driver
You will see the device pop up as the kernel goes through all supported audio, Next you have to find out what audio driver you will need.
#cat /dev/sndstat
You will get output like this
FreeBSD Audio Driver (newpcm: 64bit 2007061600/amd64)
Installed devices:
pcm0: at memory 0xb0000000 irq 22 kld snd_hda {20071129_0050} (1p:1v/1r:1v channels duples default)
So now we unload all the sound drivers
#kldunload snd_driver
We just load the one we need now
#kldload snd_hda
Now we have sound but I'm pretty sure you'll want the sound loaded at startup so we will have to edit the loader.conf (I use nano by default vi is installed)
#nano /boot/loader.conf
now we have to add two lines
sound_load="YES"
snd_hda_load="YES"
Save and exit and when you start your computer you will have audio

CVSUP

When I install FreeBSD I only install my bare minimums such as X-User and KDE. I install my system off of FTP which is quicker in my mind. Downloading only what you need compared to downloading 3 cd's, which can suck if you have a slow connection. Once my system is up I do several things to get it where I like it. The 1st is CVSUP which is a great application to build your port list.
To install cvsup we will do it from a package
#pkg_add -r cvsup
Next we will build our supfile from the example, the supfile tells our system where on the internet to get the ports and which ones to get, and to download them
#csup -L 2 -h cvsup.FreeBSD.org /usr/share/examples/cvsup/ports-supfile

Ports are great you can install pretty much and application you want using ports, all you do to install one if browse to the port folder.
#cd /usr/ports/security/example
Then you install the port
#make install clean

Favorite Apps

Theres some applications I can't live with out and I'll show you how to install them.
1st Firefox for web browser
#pkg_add -r firefox
2nd mplayer which supports mpeg, divx, mp3 and all the good formats
#pkg_add -r mplayer
3rd I get bored so I need good old nmap.
#cd /usr/ports/security/nmap
#make install clean

I do the 1st two from packages because they are constantly updated with new builds and I do nmap from ports because Its not updated as often. If you install firefox through ports you can enable smb support which is a good feature, but I use konquer for smb.