

Ask HN: Managing my own server. - gursikh

Recently got my own VPS from prgmr.com which offers a do-it-yourself sort of support package (great for a beginner who wants to learn more). I've gotten pretty far by using <i>man</i> and <i>apropos</i>. What's the most efficient way for me to learn to manage my own server?
======
logic
Make backups (for whatever definition of "backup" you need in your context)
religiously, and store them somewhere that isn't your primary provider. Test
your ability to construct a new running system (preferably on another VPS
provider) from your backup. Do this regularly, not just once.

Now you have a safety net, and you can go nuts with whatever hare-brained
schemes you happen to find in a how-to. :) Both Slicehost and Linode have
excellent libraries of articles for setting up typical services, although
neither one give ongoing maintenance (backups, patching, monitoring, log
reviews, etc) nearly enough attention.

If you really want a learning experience, find an old machine, and spend some
time with "Linux From Scratch": <http://www.linuxfromscratch.org/> . You'll
learn an enormous amount about how the whole system fits together by going
through that exercise. (I did that with a few machines back in the day before
there was something like LFS to point people to; having a roadmap like that
would have sped the learning process up significantly.)

~~~
ngsayjoe
Make should you have a notebook (Notepad will do) ready before you login the
first time. Record down every single step as you setup your box.

Review back the steps, optimized them if necessary. You will find them
extremely handy the next time you setup a new box.

------
calvinf
When I got my first VPS, I read through the articles at Slicehost:
<http://articles.slicehost.com/>

The walkthroughs cover a variety of distros including Ubuntu, Debian, and
CentOS and can be quite useful regardless of where your VPS is hosted. The
articles emphasize good security practices as well which can be helpful for a
beginner to understand.

The other thing to do is dig into the docs for anything specific you plan to
work on. I tend to look for tools with good documentation before getting
started. I've always been impressed with Apache HTTP Server's documentation
(<http://httpd.apache.org/>) and have learned a lot by referencing it when
I've had issues.

Whenever you have questions, ask friendly geeks for help. I always do best
with real-life assistance, but IRC is a good way to go as well.

~~~
danskil
Read on slicehost, ask questions on server fault -> repeat

------
dragonquest
Here's a short checklist sorta thing in no particular order.

1\. Go get Nemeth's Linux Sysadmin Handbook. Read it and learn the tricks of
the trade.

2\. I cannot stress this enough, get a desktop with the exact Linux distro you
put up. You never know what you'll learn just working in it day by day.

3\. Pick up Sobell's book on the Linux shells. Running a VPS means learning
the in's and out's of the shell.

4\. Learn about the Apache server if you are using it (or another web server),
everything you can get your hands on. Get to know how and at what access level
is it running. What its config files are, what tweak goes in it. If you're an
avid reader, go get the Apache Cookbook.

5\. Make, make, make backups along checkpoints.

6\. Don't fear the IRC. Sometimes even just listening in on some channels like
where Slicehost is discussed, you'll pick up a lot.

7\. Use 'info' where available. And read up on bugtraq if you have the time.

8\. Tweak/tune one thing at a time. Starting with the things you know best.
Take a backup at each step.

------
bediger
Sounds to me like you're already doing it.

The other thing you'll want to do is understand why things work, not just be a
"configuration file programmer".

------
techiferous
The Linode Library is great: <http://library.linode.com/>

------
cparedes
Break stuff often. Be aware that prgmr's out of band management console is
very spartan: if you break your system, using prgmr's console is analogous to
loading a Live CD in a computer and attempting to recover the installation
manually, so be aware of that.

This sounds borderline zealous, but I recommend installing Gentoo or Arch
Linux as your first VPS system if you're just starting out on Linux; either
that, or start off with NetBSD if you're willing to go down that route as
well. The default install options for each of those distros/OS's are very
minimal, and so you're forced to think about exactly what you need to install
in order to get a working system.

I second bediger: be sure to investigate _why_ things work, and not _how_ to
get it to work. The latter is very important for getting things done, but the
former is what trains you in diagnosing obscure system issues.

------
ax0n
It helps to use one of the more flexible and less user-friendly Linux distros
on an old desktop or in a VM. I kind of like ArchLinux.

The problem with Linux, though, is that there are several main families, and
even distros in the same family don't really adhere to any specific standard.
Some might use syslog, others syslog-ng. Some sendmail, others postfix. It's
kind of a mess.

Familiarizing yourself with a few flavors (and maybe FreeBSD or OpenBSD for
good measure) on a machine you force yourself to use on occasion, you will
find your comfort level for basic UNIX power-user and sysadmin stuff will
grow.

------
chaosmachine
First, learn how to reduce your attack surface. This article is a pretty good
introduction:

<http://www.freesoftwaremagazine.com/articles/hardening_linux>

~~~
sandGorgon
Also, TCP/IP stack hardening [http://www.cromwell-intl.com/security/security-
stack-hardeni...](http://www.cromwell-intl.com/security/security-stack-
hardening.html)

------
silentbicycle
Get cheap hardware and set up a Unix distro on it. Poke around and see how it
works. You'll be better off with a distro that tries to use a relatively
straightforward text-file-based configuration rather than a GUI/menu system.
And when I say cheap hardware - the dusty, yellowing box in your
friend/relative's closet with 200 mhz, 32 mb RAM, no video card, and a broken
hard drive is very much an option. Unix was designed for far less, and flaky
hardware will teach you about how to do real backups. :)

I really like OpenBSD (and the minimalism and _excellent_ documentation are
real advantages for learning systems administration), but since you're using
prgmr.com, you would probably be better off using a distro they provide* -
Debian, perhaps. While there are probably faster ways to learn sysadmin
skills, I learned what I know by just dealing with all the issues that have
come up over a decade. (And sooner or later, knowing ed _will_ pay off.)

* Though I've found experience with BSD to transfer better to Unix-in-general than Linux. This is probably an even mix of cultural factors and history - BSD is pretty old-school.

------
hundredwatt
I first learned to manage a server using a Slicehost VPS. They have a good
collection of tutorials at <http://articles.slicehost.com/>

A lot of it depends on what you are trying to 'serve' :)

EDIT: Make sure you spend some time reading about security issues (iptables
and such). It's easy to miss, but certainly as important as any other sys-
admin task

------
davidw
Make sure you're also running Linux as your desktop machine. You'll be able to
run almost exactly the same environment as your server, and it's a good way to
be able to play around with all the different things available to you in that
environment.

~~~
joubert
I'd suggest playing around in a VM instead; you don't want to hose your
laptop.

~~~
TrevorBurnham
Which VM software would you suggest? Let's say I'm on a Mac.

~~~
mitjak
<http://virtualbox.org>

I wouldn't have recommend it about a year ago but nowadays it's caught up with
others quite nicely feature wise, is very fast, supports snapshots and USB,
and is completely free.

~~~
Goosey
I second this! I wrote a post ( [http://goosey.posterous.com/the-good-news-is-
you-dont-have-t...](http://goosey.posterous.com/the-good-news-is-you-dont-
have-to-choose) ) recently about this development strategy. It has many
advantages beyond the "you don't have to worry about hosing your laptop" one,
for sure!

------
cullenking
Above and beyond, install the same distro you are using on the server as your
primary operating system at home. There is no better way to learn something
than to surround yourself by it and work at it repeatedly. Linux on the
desktop will get you comfortable enough on your server in a very quick way.

Oh, and above and beyond, don't even think about trying to mess with things
that will require a reboot quite yet. Wait until you are much more capable.
I've been using Linux for 15 years and OpenBSD for 8, and I still get cold
palms when working remotely on my server if it requires a reboot!

------
terryjsmith
If you're a programmer I recommend you (try to) create your own console like
Webmin. I learned everything I've ever needed to know about various mail
servers, web servers, databases, various configuration files and system level
stuff. You don't have to use it or go very far with the actual project in
terms of polishing, but it makes for an excellent educational project.

------
jmatt
Get in there and do something with your VPS. You can always reset/reinstall.
The process of following through and doing it - until it works as you
originally envisioned is the best way to learn and improve. During the process
understanding how things work and why is more important than finding that
perfect configuration (see bediger's comment).

Now as soon as you have users or a business, etc... things change quickly.
Your goal will change from learning to maintaining or stability. That's why
multiple environments are so common. Most people in IT are not learning they
are optimizing, maintaining and protecting. So you have to understand when
viewing most comments and information on the internet that you have a
different goal (learning) than most of the IT industry.

Almost all the most useful ideas that I learned about managing a server, I
learned due to an experience. Opposed to just reading about it on serverfault
or superuser :)

------
kbob
The Ubuntu Server Guide is an awesome resource if you happen to be running
Ubuntu on your server. It's got exactly the right recipes ready for cut 'n'
paste.

<https://help.ubuntu.com/10.04/serverguide/C/index.html>

------
LeBlanc
I am also very interested in this. I need a JRuby hosting solution and there
are not very many out there. Plus I would like to learn how to run my own
server.

prgmr.com is out of space though. Does anyone know of anything else like this
out there?

~~~
mrj
Getting a VPS is your best bet. Oddly, even though RAM is cheap these days,
they are still stingy with it.

For learning, I'd start with the 256 or lowest RAM setup and plan to upgrade
later if you get traffic.

Some of the most popular VPS hosts are linode and slicehost but there are
many.

~~~
logic
RAM being cheap is a relative thing.

It's cheap and easy to upgrade your laptop from 2GB to 4GB.

It can be expensive to upgrade your laptop from 4GB to 8GB, no matter how
cheap the RAM itself is, because you might have to buy a new laptop to
accomodate.

It's a much more expensive (and logistically difficult) task to roll out that
kind of upgrade across a large hosting environment with hardware purchased
over multiple deployments.

~~~
mrj
No doubt it's expensive, but it has been several years. A natural hardware
refresh should have helped. Check out these guys getting it right:

[http://blog.linode.com/2010/06/16/linode-turns-7-big-ram-
inc...](http://blog.linode.com/2010/06/16/linode-turns-7-big-ram-increase/)

------
mkramlich
Here we go. 2nd one in 24 hours. please let's not let HN turn into Stack
Overflow. :)

~~~
mattmillr
This would be flagged off-topic on Stack Overflow and migrated to Server Fault
;)

------
epochwolf
I don't have any specific advice for learning but if you're having some
trouble researching a specific topic or you have a difficult question drop by
#slicehost on irc.freenode.net and ask your question. Someone should be along
within an hour, usually faster. (IRC can take some time to get answers, I drop
by a few hours a day to read what's happened while I was busy with real life)

------
mahmud
Get some books on Unix admin. Nemeth et al's "Unix System Administration
Handbook", and its Linux version are usually a good start. The most recent
edition is coming out in 17 days: <http://amzn.com/0131480057>

You will also need a bunch of O'Reilly books.

------
pan69
I run my servers on Linode. I've set up test servers on my desktop with
virtualbox. I have a wiki in which I keep track over everything I do and how
install/remove software. Read lot's of books and articles on the net. Get a
ServerFault account to ask questions.

------
mgkimsal
Depends on what you want to do with it. It might be useful to install webmin
or virtualmin. Both can help you do the things you already know more
conveniently, and both can expose you to some configuration options you didn't
know existed.

~~~
mitjak
I've used virtualmin in the past, and while it might provide a certain level
of convenience, resolving server related problems becomes, well, a problem. It
pays to learn to do things the hard way when the inevitable server issues
arise.

~~~
mgkimsal
One of the things I like about virtualmin and usermin is that they do very
little in terms of non-standard config file manipulation (relative to, say,
plesk). Agreed that resolving problems from usermin can sometimes be
problematic, it is convenient for a lot of things too.

Being able to use the proper tool (control panel or straight command line) is
best. I'd found that using a tool to do X would let me then go look at the
config files before and after X to see what/how the tool was doing - that was
a great learning exercise for me. Might not be for others though.

------
spooneybarger
I second this... <http://news.ycombinator.com/item?id=1482244>

also, google is your friend for knowing what but often not why.

