Linux Server Diary

The trials and tribulations of a Linux newbie trying to setup a home server.

Thursday, September 30, 2004

New Drives Ordered

Picture of Hard Drive BoxI ordered two hard drives from Fry's Outpost, a Western Digital 80GB for the desktop machine, and a Western Digital 250GB for the server. (I know, both are bigger than necessary, but I should be set for a while.) Both were offered with decent rebates. With 2-day shipping, they should arrive on Tuesday.

I didn't have much luck locating a video graphics card. They cost more than I expected! I was hoping for something under $50, but I only saw a couple at that price, and they looked low on RAM. The old ATI card will work until I find something good that is affordable.

Meanwhile, I buttoned up the new desktop case and disconnected it. With no extra drive space, it was almost unusable.

Wednesday, September 29, 2004

Space Is Tight - Money is Tighter

I'm now down to less than 200MB free space on the old 4GB disk drive, and XP is not happy. He keeps warning me about it.

I think I've proven that the hardware works, and my next step is to go shopping for:
  • Hard Drive for the desktop - 40 to 60 GB
  • New video card. This old ATI is a little slow and jerky when watching movies
  • Hard drive for the server - 160 to 200 GB (This was the point of the whole exercise, right?)

All I have to do now is find the money!

Tuesday, September 28, 2004

More Progress

5:50 pm
LED Polarity is truly important. I now have a red HD activity light and a cool blue strip of lights indicating power
6:05 pm
Supper break
6:32 pm
The floppy drive, which I had to enable in the BIOS settings, is working now.
6:45 pm
Having DVD/CD-ROM troubles. I was able to boot from and install XP from CD, but now I can't get any CD-ROM to mount. Audio works fine. Reseating the cable connector didn't help
7:10 pm
Wait! We just got one disk to work. It seems to be erratic.
7:20 pm
Antivirus and Zone Alarm installed. I've only got about 300MB left on the hard drive.
7:23 pm
We're going to try a different DVD/CD-ROM drive
8:00 pm
NCIS Break
9:00 pm
That episode was better than usual
9:20 pm
Both front USB ports work just fine. We are rocking to the sounds of Black Eyed Peas from the MP3 player.
9:38 pm
The other DVD/CD-ROM is working much better (although I wasn't able to watch a DVD. It read the disk, but I apparently don't have a player.) Unfortunately, this drive has no eject button (it's broken off). I can either jab a small screwdriver into the hole until it opens, or use the Eject command in My Computer.
9:58 pm
Once again, I'm tired. More tomorrow

Are You Positive?

Picture of an LED


Apparently, the polarity on the LED connections IS important. This site also has hints on hooking up the floppy drive.

I'll try these out tonight.

Phase 1 Complete - What's Next

Win XP finally finished its install last night. I've just started the Windows Update process. (Reboot count: 1) I also successfully connected to the file server.

Here's a list of what's next:
  1. Install Anti-Virus software
  2. Install Zone Alarm
  3. Connect and test the floppy drive
  4. See why the lights on the front aren't working (Is polarity important?)
  5. Try out the CD Burner
  6. Test the sound
  7. Try out the front panel USB

The hard drive is filling up fast, so I don't think I'll install much else. I'm thinking harder about getting that KVM switch so that I can get to both machines. However, that money may be better spent on a new video card to replace the ATI 128. The idea of having a TV connection appeals to me, but I don't think I can justify the extra cost.

More fun tonight.

Monday, September 27, 2004

Play by Play Action

I didn't expect this project to go perfectly smooth, and I haven't been disappointed. As I format the hard drive, I'll recap the action so far:

  1. The assembly went pretty well, although I did have some trouble lining up the face plate on the back side. A little gentle persuasion, and things were in place. The drives went in easily (since I've done this part of the job many times before).
  2. It took a little while to get all of the cables in place - especially the front panel cables (lights, switches, USB). Things there are pretty small, and my eyesight isn't what it used to be.
  3. Time to connect the cables on the back, power up, and .... nothing. No lights, no fans, no nothing. I tried unplugging the floppy drive control cable. Nothing. Disconnect the hard drive and optical drive. Nothing. Remove the front panel USB cables. Nothing. Then I notice that the front panel connector for the power switch is loose. I only had one pin in the connector. Fixed that, and it came right up
  4. Except... no video. Tried reseating the video card with no luck. Switched it to a different PCI slot. No luck. Finally, I pulled the card and substituted an old ATI All-In-Wonder. And I get video! I guess the ATI 128 is dead.

So, now the hard drive (I'm using my extra 4GB disk until I get something bigger) is formatting and I'm getting ready to install XP. My dad sent the disk, and he has used it on his machine already. I don't know if Microsoft keeps track of the installs, so we'll see if they let us share a copy.

Uh, oh! This copy of XP my dad sent is the Home Edition! I wanted to get Professional. I'll use this for now, but I've got to get a copy from work. I'll have to find someone in the office to pick it up for me. The only reason I need the Professional version is for the networking features. (I'll talk about the potential Samba configuration in a later post.)

Well, this XP install is taking for ever, and I'm tired. I'm going to bed.

More tomorrow.

Let's Get Started

The case arrived as promised, as did a copy of Win XP. It's time to start assembling the new desktop machine. Here's a picture of the parts before assembly.

Picture of Computer Parts
(Click to embiggen)

Sunday, September 26, 2004

X Windows Server for Windows

Since my goal is to access the graphic tools of Mandrake from my Windows workstation, I need to find X Server software. I found these:
I still have to figure out how it all works, but I don't have an XDM server available to test with. This will come later.

It seems that one uses ssh or telnet to connect to the server, then issues commands to start graphical applications which will be displayed on the client machine. I also read somewhere that KDE and Gnome both have their own versions of XDM. My goal is to get the Gnome or KDE desktop in a window on my client.

UPDATE:

Here's a good link: Linux Questions

It's Coming!

The new case for the desktop system is due to be delivered tomorrow!

UPS Logo

Saturday, September 25, 2004

Headless

I'm currently running both of my 'servers' headless - no monitor, keyboard or mouse. I use VNC to get to the Win 98 file server, and ssh to start a tty session to the Linux IMAP server.

I'd like to run the new server the same way. (Although, I could use a KVM switch of some kind to share my desktop peripherals.) It wouldn't be tough to setup ssh on the new box, but I would like to be able to take advange of the graphical tools Mandrake is famous for.

Picture of man holding his headI found this article by Vincent Zweije describing how to setup X servers and clients, but it is way beyond my experience level. Here is another link I found:

Converting Old PCs into Standalone X11 Terminals


I also found an article about Webmin which I may want to try out someday, but it seems to build a different interface for configuration - not using the Mandrake programs (not sure - more research to do).

Now, some of the books and articles I have been reading caution against running X at all on a server. They make good points, but I think the risk is higher at a corporate site, rather than at my house. I'm pretty confident that my family members would not be able to get to the server at all (or even think about doing it). Plus, I may want to use the machine as an occaisional Linux workstation - just to try things out once in a while.

Friday, September 24, 2004

Adding a Second Hard Drive

The plan is to use the 7GB drive in the Compaq that will become my new server as the operating system drive. I'll purchase a 160GB drive where I would like all extra software and user files to live. I found a few links explaining how the 2nd drive is installed.

Adding a Linux Hard Drive
Adding an Extra New IDE Hard Drive
Adding Additional Hard Drives in Linux
Adding a New Hard Drive - Newcastle University

...and there are many others.

Next, I need to find out how to direct the /home folder and maybe others to the new drive.

David Phillips says to do it like this:

If you have a fairly large drive that you want to use I would move /usr over to it like this

I will pretend it's /dev/hdb but it could be anything

make partition we will call hdb1
format it
mke2fs /dev/hdb1
tune2fs -j /dev/hdb1
or use whatever fs you want

mkdir /tempdir
mount /dev/hdb1 /tempdir
mkdir /tempdir/usr
cp -a /usr/* /tempdir/usr

now you need to make sure everything is there before removing it from /usr
umount /dev/hdb1
rm -rf /usr/*
mount /dev/hdb1 /usr/

you should have everything in /usr and everything is good to go for boot up

add the line to mount /dev/hdb1 on boot in fstab
/dev/hdb1 /usr ext3 defaults 1 1

when you delete all files from /usr it will give the space to /
when you mount /dev/hdb1 in /usr it will have it's free space in /usr and will not use any space in /
all you need to do is have the empty folder /usr in / and mount /dev/hdb1 on it.


I'll give it a try once I'm at that point. I have to get the new client machine built first so that I can free up this Compaq.

Thursday, September 23, 2004

Fetchmail - Read the Docs, Stupid!

Fetchmail LogoI checked the man entry for fetchmail and found that there is a daemon mode for fetchmail - as I sort of remembered.
DAEMON MODE
The --daemon or -d option runs fetchmail in daemon mode. You must specify a numeric argument which is a polling interval in seconds.

In daemon mode, fetchmail puts itself in background and runs forever, querying each specified host and then sleeping for the given polling interval.

Simply invoking

fetchmail -d 900

will, therefore, poll all the hosts described in your ~/.fetchmailrc file (except those explicitly excluded with the `skip' verb) once every fifteen minutes.
However, I didn't see anything about the /etc/fetchmailrc file.

Luckily, I found a site that explains it pretty well
The fetchmail-daemon RPM allows fetchmail to be started as a system service which is configured by the file /etc/rc.d/init.d/fetchmail

This file will by default cause fetchmail to poll the ISPs POP3 servers every 180 seconds.

The configuration of fetchmail is controlled by the file /etc/fetchmailrc which is easily configured with an editor.
Here's a Suse site explaining a similar approach.

It still seems odd that the fetchmail man entry says to use the -d option, but the other two sources ask me to install fetchmail-daemon-6.2.5-3mdk to use that feature. As I've read these hints, I am starting to remember installing that package on my IMAP server.

I'm getting closer...

Wednesday, September 22, 2004

Mail Server Resources

I went searching for IMAP links tonight. Here's a few of the better ones:I'm not finding much. I guess there isn't much to configure.

IMAP Book CoverI'll have to do some research on how mail is stored in Linux, and for ways to move my existing mail to the new server once it's ready to go. I suppose that I could just use my mail client to move the folders (There are only five users setup), but that seems so pedestrian. There must be some obscure utility written in Perl that would do it after 2 days of configuration!

Wait! Here are some ideas.

I've found some articles talking about Sendmail or Postfix setup. Lucky for me, I can use the SMTP server at work, so I'm not going to mess with it.

I've been looking around for fetchmail docs, but all I've found is very basic stuff. The articles talk about having a .fetchmailrc file in the home directory. My configuration file is in /etc. Also, it seems that I ran fetchmaild to start the daemon to retrieve mail for all users. (looking around in server directories) Maybe not. I can't find a file with that name. As I sit here, I'm wondering if I ran the normal fetchmail, but since it found the config file in /etc, it started the daemon. It's tough to remember. I'll keep looking.

I do like this Mandrake Server Manual. It looks like it could be useful.

This guy has a Linux setup page that looks interesting. It's good for me to gather up these tip sheets as I find them.

Anyone have any hints or tips on mail?

Tuesday, September 21, 2004

Client Machine Parts

Super-Flower PictureOK, so I just ordered the case for my new desktop machine. It is a Super-Flower case from Directron. It has USB and audio ports on the front.

As promised earlier, here is the list of components for the new desktop machine:

Motherboard:
Gigabyte GA-7ZXE with an AMD Athlon processor, and 768MB of RAM. It includes plenty of PCI slots, an AGP slot, and onboard sound.

Video:
ATI All-In-Wonder 128 PRO with built in TV tuner and a couple of fun looking cables.

Network:
3Com 3C905B-TXNM 10/100-Base-TX

Sound:
MAD DOG Multimedia Predator 5.1 DSP. Includes 5.1 outputs.

Modem:
Modem??!! That's not going in there. How 90's can one get?

Other:
3½ Floppy drve - this may not make it in either

CDRW/DVD-ROM drive - make unknown

Hard Drive:
None
Wait a minute! Without a hard drive, we're not going to get very far. I'm ordering a 160GB for the new server, but I can't free up the 20GB drive in the old server until files are transfered. I have a 4GB sitting around doing nothing that I may use for the short term. It should hold Windows, Office, and the other basic things I need. I'll figure out what to do with the 20GB later.

Operating System:
None
Once again, I'm kind of winging it. I can get Win XP from work as part of the campus wide license. Unfortunately, I already obtained a copy, but I lost it. They won't give me a replacement, so I'll have to ask some other staff member to get a copy and give it to me.

Wish me luck!

Existing Linux Server Configuration

Here are some of the configuration files I modified when setting up the IMAP server. You can tell from some of the settings that I played with lots of stuff.

/etc/xinet.d/imap
service imap

{
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += DURATION USERID
log_on_failure += USERID
disable = no
}

/etc/rc.d/rc.firewall
#!/bin/sh


IPTABLES=/sbin/iptables

$IPTABLES -F INPUT

$IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p icmp
$IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p tcp
$IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p udp

#FTP
$IPTABLES -A INPUT -p tcp --dport 20 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 21 -j ACCEPT

#SSH
$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT

#HTTP
$IPTABLES -A INPUT -p tcp --dport 80 -j ACCEPT

#IMAP
$IPTABLES -A INPUT -p tcp --dport 143 -j ACCEPT

#DNS
$IPTABLES -A INPUT -p tcp --dport 53 -j ACCEPT

#PING
#$IPTABLES -A INPUT -p icmp -j ACCEPT

#Drop and log all other data
#$IPTABLES -A INPUT -m limit --limit 3/second --limit-burst 5 -i ! lo -j LOG
$IPTABLES -A INPUT -i ! lo -j DROP

Looks like I allowed a few more ports than I thought. DNS and FTP never worked.

/etc/fetchmailrc
set daemon 900


poll pop.dddddd.com protocol pop3 username "uuuuuuu" password "pppppp" is "uuuuuuu" here
...

I have five email accounts setup for me that go to four different mailboxes, plus there is one for my son.

/etc/ntp.conf
...

server horologe.cerias.purdue.edu
server tick.cerias.purdue.edu
server tock.cerias.purdue.edu
...

I used the time servers at Purdue.

/etc/postfix/main.cf

I won't include the whole file, but I did make a couple of changes.

myhostname = dsl.......edu

mydestination = $myhostname, localhost.$mydomainname


At least, I think this is what I changed. The problem with not documenting my changes is that I have no idea what I did to install IMAP, and that is the one service on the machine that I use and rely on. I don't even know at this point if the IMAP software came with Mandrake 9.1 or if I downloaded it from somewhere.

This situation is pushing me towards redoing the IMAP setup on the new machine. I'll have to figure out at some point how to migrate the email.

That's all of the modified configuration files I could find. I'll post more later if I find anything.

Monday, September 20, 2004

Samba Sources

I've been looking at Samba information in preparation for the new server. First stop - Borders.

Using Samba from O'Reilly looks interesting. It shows good examples for several different configurations of Samba. I like books like this that show lots of examples.

Another book I saw in the store was Samba-3 by Example. The approach here presents scenarios that a network admin may be faced with. It starts with the easy setup, and expands features as the fictional company grows. The examples aren't quite as good as the first book, but they are not bad.

On the web, I found a few sites.

Linuxpipeline has a basic article covering Samba configuration. It's low on details and bereft of examples.

The Samba Team has a good looking example manual and a how-to guide. I haven't looked through them much yet, but they look useful.

Toad-one has the Unofficial How To for Samba.

Do you know of other places I can look?

UPDATE:

Other links: Quick HOWTO: Windows, Linux And Samba
Sample configuration files

What I Hope To Accomplish

I've got a lot of plans in my head, and things will most surely change as I go. Think of this as the first draft of a plan.

I received a pile of parts to build a new client machine for myself (I'll list these later). All I need to pickup is a case and a hard drive.

I want to take my existing client machine and make it the new server. It is a Compaq with a 350Mhz Pentium processor. (I know! I know! It's probably too slow, but I already have it. You'll see this "cheapskate" theme throughout this ordeal.) It's got a 7 GB "Bigfoot" hard drive, but I plan to add a 160GB drive before I begin. I've loaded Mandrake on this before, and it runs OK.

On this new server, I plan to run Samba for file services. Other than that, I'm still thinking. It would be nice to consolidate services by migrating the IMAP stuff over. I'll have to learn how to do that. I certainly don't want to setup a webserver that is available to the outside world, but it could be fun for my son to play with. I'm not sure about having him play on my 'production' machine. I may setup the freed IMAP machine for him. I have a little time to think about things.

Since I'll need the Compaq machine to start the server project, I'll building the new client first. The Linux Server Diary will serve as the Windows Client Diary in the short term.

As always, please leave your suggestions and constructive criticism in the comments.

The Current Setup

Here's what I have at home right now:

Four windows client machines - one for each family member. Two run Win 2000, and two use Min ME. We plan to migrate one of each to Win XP (once I get the software from work).

An OLD PC (133 MHz) running Win 98 as my file server. Sure, it's slow as sin, and I have to reboot about once a week, but it was FREE! An almost full 20 GB hard drive holds the data.

An almost-as-old PC (233 MHz) running Mandrake 9.1. This is the IMAP server. I only installed Linux in character mode. I setup the IMAP software, configured the firewall, and added users. However, I'm the only person who logs in. In order to keep my email separate, I added a 'user' for each. Fetchmail gets the mail every 10 minutes. I also setup a SquirrelMail installation on the web server at work, which connects to this server. I played with Apache, FTP, and Samba a little, but the firewall currently blocks this traffic. All that is allowed is IMAP and SSH.

A Siemens router connected to the DSL modem. I've got it pretty well locked down. The only hole poked in the firewall is the IMAP port.

No wireless right now. All of the machines are in the same room ("The family that computes together - stays together") in the basement. I'll think about it when we get a laptop or want to setup a machine upstairs.

Blog Admin

Comments:

I've enabled the Blogger comments - just to try it out. Right now, I have it setup to allow registered commenters only. Anyone else had good luck with this?

Hit Counter:

What's a good counter to use? I've used SiteMeter before, but I'd like to try something new. I love seeing the referrer information.

Why a Linux Server Diary?

Hello.

I plan to setup a server for my home network, and I'm starting this diary for a couple of reasons.
  • I'd like to keep track of what I try and what works. I setup an IMAP server last year, and I went through a lot of experimentation. Unfortunately, I didn't document my steps, so I'll have to learn it all over again.
  • I'd love to get advice from the many Linux experts around the globe. Please feel free to send suggestions or constructive criticism.
Wish me luck!