CentOS As A SOHO File Server (With A CF Hard Drive)

The Situation:

At my work (Scripture Memory Fellowship), the need for a file server has become more… pressing. We are also working to implement a VPN, which would be totally awesome for both non-office employees and off-site conventions, and would make having an always-on file server even more helpful.

Now we don’t have a VPN yet (or a file server, for that matter), but I looked around for something that would serve our needs well, and I found CentOS, which is essentially RHEL (Red Hat Enterprise Linux) without the large service support contracts that RHEL requires. So I started thinking…

The Guinea Pig:

Frankenstein has been lingering for nearly a month without an OS because the BIOS doesn’t support USB booting, and I took the optical drive out of it back in September 2009 when I made Limited Edition. However, Frankenstein would be a perfect testbed for both configuring a SOHO file server and for seeing how well a CF card works as a hard drive!

[Note: The CF card in Frankenstein is from ~2007, and CF read/write speed has since progressed significantly, especially in high-capacity cards. There were higher-speed cards available then, but I wanted one as a replacement hard drive for my old 30GB iPod Video 5.5G, so speed was not at all my primary concern in choosing a card 😛 .]

The Install:

Whipping out my trusty screwdriver, I re-transplanted my DVD drive to Frankenstein and popped in the CentOS install DVD. CentOS booted up fine, and the Anaconda installer worked beautifully all the way through. I installed both the Server and Server GUI options, and in total the install took about two hours due to the super-slow write speeds of this particular CF card 🙄 .

It takes about two minutes to boot to the desktop, which is okay — better than what I was expecting, anyway.

CentOS 5.5 on Frankenstein

CentOS 5.5 on Frankenstein

The Configuration:

[Disclaimer: This is not a setup for optimal security! I focused on getting things to work as proof-of-concept, not on making a template for a real-world server setup.]

First, I ran updates, which took pretty much half a day. Undoubtedly this would be much, much faster on a conventional hard drive, but I have time to spare 😉 . Then I installed Firefox (which for some reason was left out of the install, but still listed as the default web browser).

I set SELinux on permissive during installation, and went to System > Administration > Server Settings > Samba to set up a Samba share for the Public folder on my home folder. Basically, you just hit “Add Share”, browse to the directory you want to share, and set the options you want. In the end, you should end up with something like this:

Samba Server Configuration on Frankenstein

Samba Server Configuration on Frankenstein

Next thing is to go to Preferences > Server Settings in the Samba Server Configuration program. In the “Basic” tab, change the workgroup name to whatever workgroup you want your Samba shares to be a part of. Then in the “Security” tab make authentication mode “Share”, so you don’t have to enter a password to access your Samba share in Windows.

Now when you do try to access a file on a /home-based Samba share (in my case, /home/bgbraithwaite/Public), SELinux will yell at you, so do some CLI magic to allow this behavior (not necessary for SELinux in permissive mode, but it keeps you from drowning in error messages):

setsebool -P samba_enable_home_dirs=1

And you should be ready to start sharing right away!

The Testing:

Well, you see the pictures? I uploaded them from the Samba share 😉 .

The Verdict:

CentOS certainly works well as a simple Samba file server. In the future, I hope to test CentOS’s capabilities in other areas (like using it as a web server for OpenAtrium, or possibly as a mail server), but getting a working Samba file server was the priority in this test.

The uber-slow installation, updates, program launching, etc. could have been greatly speeded up if I would have chosen ext2 as the filesystem with the noatime attribute set (why I didn’t do that the first time, I don’t know). I will probably use ext2 exclusively on Frankenstein now, because the constant disk access on a slow CF card is painful to behold. I’m not really worried about wear, I just don’t want to sit so long waiting for nothing to happen.

As for security, I doubtless need more stringent settings, but I’ll figure that out later. SELinux seems to be a powerful tool for configuring and maintaining a secure box, and I will no doubt learn the ins and outs of it when I set up the real thing.

So, is CentOS really the best distro for a SOHO file server? The answer is probably no, with qualifications. CentOS’s focus on enterprise use means that it could certainly scale with a business as it grows, but it also means a certain amount of technical know-how is necessary to set it up properly, and for many smaller businesses with no homegrown techies, CentOS may be too difficult to set up. This is not to say that CentOS is difficult to set up — because it certainly wasn’t — but most people seem to have an irrational fear of all things tech, and lose all higher cognitive function when they interact with it. An unfortunate fact of life, that.

For our purposes, though, CentOS seems very crisp and professional. The whole experience was quite pleasant and easy to understand (at least for me, a professional end-user), and no doubt the child of RHEL will be on our server… whenever we get around to building one 🙄 .

UPDATE: Name our new server!

Advertisements

2 thoughts on “CentOS As A SOHO File Server (With A CF Hard Drive)

  1. Pingback: Piggybacker Lives! Or, The Virtues Of A CF Card Put To Unconventional Use « Becoming A Glider

  2. Pingback: 2010 In Review « Becoming A Glider

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s