News for hackers. Stuff that matters.

Ask HN: Managing my own server.

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 man and apropos. What's the most efficient way for me to learn to manage my own server?
( 54 comments | 61 points | on HN )
Re:Ask HN: Managing my own server. by logic on Friday July 02, 2010 @05:23PM (#1482416)
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.)

Re:Ask HN: Managing my own server. by ngsayjoe on Saturday July 03, 2010 @07:23AM (#1483675)
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.

Re:Ask HN: Managing my own server. by saurabh on Saturday July 03, 2010 @02:30AM (#1483403)
Oh Yeah. I installed LFS once. Then I installed Gentoo. Then Arch. Learn't a lot of things along the way. Definitely recommended.
Re:Ask HN: Managing my own server. by calvinf on Friday July 02, 2010 @04:45PM (#1482297)
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.

Re:Ask HN: Managing my own server. by danskil on Friday July 02, 2010 @04:52PM (#1482320)
Read on slicehost, ask questions on server fault -> repeat
Re:Ask HN: Managing my own server. by stanleydrew on Friday July 02, 2010 @04:49PM (#1482313)
nginx documentation is also really good actually: http://wiki.nginx.org/NginxModules
Re:Ask HN: Managing my own server. by fbnt on Thursday August 12, 2010 @12:01PM (#1598410)
I got my first VPS with them too, and the articles there have been really useful and straight-forward. Once you've completed all the steps you're pretty much able to build up a functional webserver. Their chatroom is really useful too, if you have any question there's always somebody to help you out. Generally speaking, this is my favourite approch, Do lots of stuff, and learn to do only what you need to do.
Re:Ask HN: Managing my own server. by dragonquest on Friday July 02, 2010 @06:45PM (#1482627)
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.

Re:Ask HN: Managing my own server. by bediger on Friday July 02, 2010 @04:28PM (#1482244)
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".

Re:Ask HN: Managing my own server. by techiferous on Friday July 02, 2010 @05:02PM (#1482349)
The Linode Library is great: http://library.linode.com/
Re:Ask HN: Managing my own server. by cparedes on Friday July 02, 2010 @05:17PM (#1482400)
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.

Re:Ask HN: Managing my own server. by ax0n on Friday July 02, 2010 @05:07PM (#1482369)
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.

Re:Ask HN: Managing my own server. by chaosmachine on Friday July 02, 2010 @05:26PM (#1482426)
First, learn how to reduce your attack surface. This article is a pretty good introduction:

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

Re:Ask HN: Managing my own server. by sandGorgon on Saturday July 03, 2010 @07:08AM (#1483663)
Re:Ask HN: Managing my own server. by silentbicycle on Friday July 02, 2010 @10:50PM (#1483097)
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.

Re:Ask HN: Managing my own server. by hundredwatt on Friday July 02, 2010 @04:38PM (#1482274)
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

Re:Ask HN: Managing my own server. by davidw on Friday July 02, 2010 @05:00PM (#1482343)
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.
Re:Ask HN: Managing my own server. by joubert on Friday July 02, 2010 @05:03PM (#1482354)
I'd suggest playing around in a VM instead; you don't want to hose your laptop.
Re:Ask HN: Managing my own server. by cullenking on Friday July 02, 2010 @06:49PM (#1482641)
I'd disagree, but that's because it's way too easy to walk away from the VM when you need to do something and don't want to futz around.

Jump feet first and use Linux as your main OS. If you are doing development work, it can easily surpass Windows, and is comparable (or superior) to OSX as well. Of course, this doesn't apply if you are doing graphic design stuff, however, Windows can live inside a VM for that sort of stuff. If you are doing web dev, you'll need a VM for Vista/Win7 and for XP anyways.

Re:Ask HN: Managing my own server. by joubert on Friday July 02, 2010 @07:58PM (#1482794)
Even if Linux is your main OS, I would still use a VM, because you can reproduce a server environment more closely, isolates that work from your "personal stuff", allows powerful features such as snapshotting, and enables you to simulate multiple servers and/or clients (virtualization) on a single box, when for example playing with a distributed date store.
Re:Ask HN: Managing my own server. by pavs on Friday July 02, 2010 @05:08PM (#1482374)
Or just Wubi to make an Ubuntu install you don't have to hose anything.
Re:Ask HN: Managing my own server. by TrevorBurnham on Friday July 02, 2010 @05:05PM (#1482361)
Which VM software would you suggest? Let's say I'm on a Mac.
Re:Ask HN: Managing my own server. by mitjak on Friday July 02, 2010 @05:19PM (#1482402)
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.

Re:Ask HN: Managing my own server. by Goosey on Friday July 02, 2010 @05:48PM (#1482485)
I second this! I wrote a post ( http://goosey.posterous.com/the-good-news-is-you-dont-have-t... ) recently about this development strategy. It has many advantages beyond the "you don't have to worry about hosing your laptop" one, for sure!
Re:Ask HN: Managing my own server. by joubert on Friday July 02, 2010 @05:19PM (#1482406)
I've been using (Oracle) VirtualBox and am happy with it. I'm on Snow Leopard and have 4GB RAM.
Re:Ask HN: Managing my own server. by SkyMarshal on Saturday July 03, 2010 @12:20AM (#1483253)
/Second VBox. I'm using it on Ubuntu to play around with Arch, Nexenta, OpenSolaris, and WinXP. It just works.
Re:Ask HN: Managing my own server. by codesink on Friday July 02, 2010 @05:09PM (#1482379)
I'm pretty happy with VMware Fusion.

http://www.vmware.com/products/fusion/

Re:Ask HN: Managing my own server. by nfriedly on Saturday July 03, 2010 @02:59AM (#1483435)
I like VMware fusion provided you use the isolated mode. Trying to "fuse" windows 7 into OS X is the only thing thats crashed my macbook so far.
Re:Ask HN: Managing my own server. by evilduck on Saturday July 03, 2010 @11:47AM (#1483929)
Just an FYI, VirtualBox images are not easily transferred to VMware, and vice versa.

If you're only ever on a Mac, I vote VMware Fusion, but if you're going to change vm host environments, I'd suggest VirtualBox.

Re:Ask HN: Managing my own server. by cullenking on Friday July 02, 2010 @06:48PM (#1482638)
I replied with the same advice before noticing you already suggested it - definitely the best way to get comfortable fast!
Re:Ask HN: Managing my own server. by cullenking on Friday July 02, 2010 @06:47PM (#1482635)
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!

Re:Ask HN: Managing my own server. by terryjsmith on Friday July 02, 2010 @06:02PM (#1482511)
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.
Re:Ask HN: Managing my own server. by jmatt on Friday July 02, 2010 @05:07PM (#1482365)
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 :)

Re:Ask HN: Managing my own server. by kbob on Friday July 02, 2010 @10:12PM (#1483030)
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

Re:Ask HN: Managing my own server. by LeBlanc on Friday July 02, 2010 @04:35PM (#1482268)
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?

Re:Ask HN: Managing my own server. by weaksauce on Friday July 02, 2010 @04:53PM (#1482325)
Linode is my favorite having used both slicehost and linode. They recently doubled the ram offered compared to the same price point of slicehost. Though the admin interface of slicehost is better.
Re:Ask HN: Managing my own server. by calvinf on Friday July 02, 2010 @04:48PM (#1482310)
Blue Box Group, EC2, Linode, Rackspace Cloud, Slicehost, ... there are a lot of options out there depending on the features you require and the level of support.
Re:Ask HN: Managing my own server. by mrj on Friday July 02, 2010 @04:44PM (#1482295)
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.

Re:Ask HN: Managing my own server. by logic on Friday July 02, 2010 @05:59PM (#1482504)
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.

Re:Ask HN: Managing my own server. by mrj on Tuesday July 13, 2010 @02:48PM (#1512329)
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...

Re:Ask HN: Managing my own server. by lsc on Monday July 12, 2010 @01:43AM (#1506957)
yeah... generally when you buy a box for VPS hosting, you fill it to capacity with ram... of late, the price/density of ram hasn't changed much, so usually you'll throw out the box and replace it when it's time for an upgrade.

None the less, new servers with lots of ram aren't that expensive. Registered ecc ddr3 is about $130 for each 4GiB stick, give or take, and that comprises about half the cost of a server with 8 cores and 32giB ram. (on the G34 platform, that's a single socket server)

Re:Ask HN: Managing my own server. by calvinf on Friday July 02, 2010 @04:52PM (#1482319)
For development, 256 works pretty well. If you host more than one site or have a lot of dynamically generated content, you can quickly surpass the 256MB limit and need 512MB.

This depends a lot on the stack you're using and what software your site depends on.

Re:Ask HN: Managing my own server. by gursikh on Friday July 02, 2010 @04:48PM (#1482309)
prgmr.com is often out of space. check every day or so, they're bound to offer more VPSs pretty soon.
Re:Ask HN: Managing my own server. by whimsy on Friday July 02, 2010 @08:27PM (#1482843)
prgmr.com should have a new server up within the next couple days.
Re:Ask HN: Managing my own server. by rortian on Friday July 02, 2010 @08:22PM (#1482838)
To start out free, google app engine is a good way to go. It is a little quirky and different from most solutions, but it's great to start paying nothing.
Re:Ask HN: Managing my own server. by mkramlich on Friday July 02, 2010 @05:19PM (#1482404)
Here we go. 2nd one in 24 hours. please let's not let HN turn into Stack Overflow. :)
Re:Ask HN: Managing my own server. by mattmillr on Friday July 02, 2010 @05:24PM (#1482421)
This would be flagged off-topic on Stack Overflow and migrated to Server Fault ;)
Re:Ask HN: Managing my own server. by epochwolf on Friday July 02, 2010 @07:22PM (#1482718)
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)
Re:Ask HN: Managing my own server. by mahmud on Friday July 02, 2010 @05:34PM (#1482442)
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.

Re:Ask HN: Managing my own server. by pan69 on Friday July 02, 2010 @07:03PM (#1482677)
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.
Re:Ask HN: Managing my own server. by mgkimsal on Friday July 02, 2010 @05:01PM (#1482344)
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.
Re:Ask HN: Managing my own server. by mitjak on Friday July 02, 2010 @05:23PM (#1482417)
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.
Re:Ask HN: Managing my own server. by mgkimsal on Friday July 02, 2010 @05:46PM (#1482479)
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.

Re:Ask HN: Managing my own server. by spooneybarger on Friday July 02, 2010 @04:31PM (#1482252)
I second this... http://news.ycombinator.com/item?id=1482244

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