Wednesday, November 19, 2008

apache2 and php on xubuntu

11/19/08

Install Apache and PHP
$ apt-get update
$ apt-get install apache2
$ nano /etc/apache2/sites-available/default

replace /var/www/ with /home/documents/website/ in two locations

$ apt-get install php5 php-pear

tomorrow...
Squirrelmail
Dokuwiki
webmin
power management (stop spinning hard drives)
fan speed control
netatalk
http://www.lm-sensors.org/browser/lm-sensors/trunk/QUICKSTART

Tuesday, November 18, 2008

3DM2 Raid Utility FAIL on Xubuntu

11/16/08

3DM2 Raid Utility on Xubuntu

This did not work. I tried both the 32 bit and 64 bit version. The 32
bit version didn't like my hardware and the 64 bit version didn't like
my OS. I tried to install ia32libs but that is really for a 64 bit OS
on a 64 bit machine trying to run a 32 bit program, so that package was
logically not suitable for me. This is a big deal as I have already had
one hard drive failure that 3DM2 told me about right away.

I guess I will keep going to learn more for the upcoming Debian install.

tomorrow...
Apache
PHP
Squirrelmail
Dokuwiki
power management (stop spinning hard drives)
fan speed control
netatalk
http://www.lm-sensors.org/browser/lm-sensors/trunk/QUICKSTART

Saturday, November 15, 2008

dnsmasq on xubuntu

11/15/08
install dnsmasq
$ sudo apt-get update
$ sudo apt-get install dnsmasq

DNS and DHCP are configured using the following files
/etc/hosts
/etc/dnsmasq.conf
/etc/resolv.conf
/etc/hostname

Edit /etc/hosts.

$ sudo cp /etc/hosts /etc/hosts_backup
$ sudo nano /etc/hosts

Add a line for each networked component or computer.
127.0.0.1 localhost
127.0.1.1 server
192.168.15.1 router
192.168.15.2 brett
192.168.15.3 tivo
192.168.15.4 wap
192.168.15.5 printer
192.168.15.6 server
#192.168.15.7 apple
#192.168.15.8 apple
192.168.15.9 entertainment
192.168.15.10 ddwrt
192.168.15.11 maxtor1
192.168.15.12 maxtor2
192.168.15.13 video

Edit /etc/dnsmasq.conf.

$ sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf_backup
$ sudo nano /etc/dnsmasq.conf

Uncomment and edit the following lines

expand-hosts
domain=mydomain.lan
dhcp-range=192.168.1.100,192.168.1.150,168h
dhcp-option=3,192.168.1.1

expand-hosts will automatically add .mydomain.lan to hostnames in /etc/hosts

dhcp-host=breeett,192.168.15.14

will always assign IP address 192.168.15.14 to the computer named breeett

/etc/resolve.conf on the dns/dhcp server should only contain the
external name servers. On my machine these are:
nameserver 66.75.160.63
nameserver 66.75.160.64

/etc/hostname should contain the hostname and domain. On my machine this is:
server.mydomain.lan

to verify the hostname is what you think it is, type
$ hostname
this will return the hostname without the domain. On my machine this is:
server

On the command line restart dnsmasq
$ sudo /etc/init.d/dnsmasq restart

tomorrow...
3dm2
Apache
PHP
Squirrelmail
Dokuwiki
power management (stop spinning hard drives)
fan speed control
netatalk

Thursday, November 13, 2008

Samba on Xubuntu

11/13/08
Installed Samba
$ sudo apt-get update
$ sudo apt-get install samba
edit /etc/samba/smb.conf
$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
$ sudo nano /etc/samba/smb.conf

if you are on a closed network (behind a nat router with no open ports) then
authentication = user
and comment out all the encryption stuff
add shares at the end

[share]
comment = share
read only = no
path = /home/share

tomorrow...
dnsmasq

Wednesday, November 12, 2008

Installing services in Xubuntu

11/12/08
Installed ssh
$ sudo apt-get install openssh-server

Installed nfs
$ sudo apt-get install nfs-kernel-server
edit /etc/exports
$ sudo nano /etc/exports
see man exports for details
/home/documents 192.168.15.0/24(rw,async)

Install Dovecot
$ sudo apt-get install dovecot-imapd
$ sudo cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf_backup
$ sudo nano /etc/dovecot/dovecot.conf

protocols = imap #imaps
disable_plaintext_auth = no
mail_location = maildir:/home/user/Maildir

tomorrow...
Samba
Apache
PHP
Squirrelmail
Dokuwiki
dnsmasq

Tuesday, November 11, 2008

Tired of waiting for Debian

My frustration with openSUSE not remembering which services I want to
start at boot finally got the better of me. Since Debian Lenny is not
out yet, I went searching for other distos that would scratch my itch.

So I gave Ubuntu server edition a chance, but it gave me some trouble
with things that I thought should be straight forward so I gave it the
boot. One big problem was that it alternately mounted my RAID array as
sdb1 and sda1 which made mounting via fstab fairly difficult.

Now I am installing Ubuntu 8.10 Desktop 64 bit as a server. I
downloaded and burned the install disc. The next things to do are:

1. install samba and setup files, music and photo shares. create users
for me and my wife.
2. install nfs server and share files
3. install the raid 3dm2 utility

I didn't like Ubuntu desktop as a server. Basically because you have to
use the gui configuration stuff and I like to edit the config files for
a server. The network didn't work every time I rebooted. I tried to
edit the /etc/network/interfaces, but when I rebooted, it was blank again.

The next thing to do is install Fedora. I have downloaded the 64 bit
version of Fedora Core 9. That sucked. I don't even know what to say.
I could not connect to the internet. I went through the GUI, I checked
the manual configuration, nothing worked. I scrapped it and loaded a 32
bit version of xubuntu 8.04 I had laying around.

Xubuntu 8.04 32 bit installed fine. One problem I had was with the grub
installation. When I rebooted, it stayed with the openSUSE grub screen,
which did not have an option for xubuntu. To get to the latest grub
menu.lst options, I needed to boot into a live CD (I use puppy linux),
open a command prompt and type:

# grub
> root (hd0.2)
> setup (hd0)
> quit

I already knew that my xubuntu installation was on hd0,2. Next I had to
edit menu.lst in xubuntu because it put hd1 everywhere it should have
put hd0. When I booted into xubuntu, I could not get past the grub
screen because it was trying to boot hd1,2. I had to hit e for edit and
change the 1 to 0, then I could boot into xubuntu. Then:

$ sudo nano /boot/grub/menu.lst

change all the hd1 entries to hd0.
cntrl+o
cntrl+x
reboot and everything worked.

Now mount the RAID array.

$ sudo nano /etc/fstab

add the line

/dev/sda1 /home ext3 defaults 1 2

cntrl+o
cntrl+x

$ sudo mount -a (to test)

reboot and verify everything works.

Tomorrow...Install NFS and setup getmail
Then...Install dovecot
install samba server
install ?

Friday, November 7, 2008

ubuntuserver part 1

Installed ubuntu server 8.04 for AMD64. There is no option for a gui,
so you need to be comfortable on the command line or make sure you have
alternate internet access to look stuff up.

The grub menu was messed up and I had to reinstall grub.
From a live CD (I use Puppy Linux 4.1),
# grub
> root (hd0,2)
> setup (hd0)
> quit

Make sure the partition is flagged as bootable. Use g-parted or
systemrescuecd.

Then had to edit /boot/grub/menu.lst to change all the references of hd1
to hd0.

After that it booted properly.

Get the latest stuff...
$ sudo apt-get update
$sudo apt-get upgrade

SSH
SSH was not installed by default on my disto. To install, type...

#sudo apt-get install ssh

At this point I stop using the KVM switch and just access the server box
through SSH.

Monday, November 3, 2008

Remote Shutdown and Reboot

To restart the computer from a remote shell (ssh) use...
# shutdown -r now

To shutdown the computer from a remote shell (ssh) use...
# shutdown -h now
Remember that you won't be able to turn in back on...

Sunday, November 2, 2008

bash file command summary

create an empty file (touch)
create a file and open it for editing (nano fibar.txt)
delete files (rm)
make directory (mkdir)
delete a directory (rmdir)
move or rename files or directories (mv)

MD5 Sums

MD5 Sums are used to verify the integrity of a file you have downloaded from the internet. Most commonly with ISO images for linux distributions. The site you download from will also publish the MD5 sum of the ISO image. After you download it you can find the MD5 sum using the command...

$md5sum filename

The output will look something like...

bbd21ded02c06b41c59485266833937a

compare this to the published number. If they match, your file is intact. If not, it is corrupted in some way. Try downloading it again. This is especially important to do if you use bit torrent downloads.

move/rename files (mv)

move files or folders with the mv command
mv source destination

to move a file called bar.txt from a folder called /home/documents to a
folder called /home/documents/foo, type
$ mv /home/documents/bar.txt /home/documents/foo/

if you are in the directory /home/documents simply type
$ mv bar.txt foo

to move /home/documents/foo/bar.txt back to /home/documents type if you
are in the /home/documents/foo directory
$ mv bar.txt ..

to rename bar.txt to help.txt
$ mv bar.txt help.txt

note that if the name you want to rename to matches exactly an existing
directory, you cannot rename it. you cannot have a file and a folder
with the same name.

These example work exactly the same for moving and renaming directories

testing

testing. This is a message from Jessica to her Dad. I love you dad.

Mount NFS drive fstab entry

This is my fstab entry to mount the documents directory on my server to
the Documents folder on my client machine. Even though I have the
server set up with a name it always failed, so I use the IP address
instead.

#mount nfs file system on server to Documents directory
192.168.15.6:/home/documents /home/brett/Documents nfs defaults 0 0

Saturday, November 1, 2008

Grub

sudo grub

> root (hd0,0)

> setup (hd0)

> exit