Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Is there a server admin guide for noobs?
22 points by dawilster on June 4, 2012 | hide | past | favorite | 36 comments
Hi HN,

I was building this app the other day and because I'm a complete cloud server noob I deploy all my apps onto phpfog.com but there really lacking some features essential to my web app so I was really hoping to take the time to learn linux servers.

I've used rackspace in the past but nothing more than copying and pasting commands from a tutorial so when it comes to anything beyond the scope of what's in it I become stumped so I really need to learn how to fish in this case.

I want to become more acquainted with servers like Centos so does anybody know where I should get started?

Thanks a lot



While there are several books to teach you basics of Linux, the best way to learn is to do hands on.

- Install Virtual box ( or any other free VM hosts).

- Download CentOS.

- Set yourself a goal on what you need to achieve - e.g I need to run php version x with apache configured to do x y z tasks.

- Install CentOS as a VM ( you could skip these steps and run a cheap VPS as others have suggested) .

- Understand the various steps in the installation - Disk partition, Software selection etc. Don't just blindly select anything unless you understand what you are doing.

- Figure out what software you need to install to achieve your goal and install it one by one.

- Ever time you get struck, if you find some command to fix the issue, don't blindly copy paste it - understand what the issue is and figure out what the command you are trying to run is doing to fix the issue.

Once you have everything up and running, destroy the machine and start over with a slightly different goal.

Google is your friend! Good luck.


>Don't just blindly select anything unless you understand what you are doing.

That's important advice: anytime you run up against a selection option and you don't know what you should choose or why the default is what is it, search for more information to understand what is going on. I believe you can teach yourself anything just by setting a goal and learning as you go (with plenty of time and acceptance for mistakes).


Very good advise.

Also, keep a text file open and document each step with notes, urls and all the terminal commands you've used.


http://vagrantup.com is a good way to get started on your local machine (without paying a VPS provider). You can install a minimal operating system and build up your stack from there. Because it is completely free, you can recreate your server and really experiment with different operating systems until you feel comfortable to go live.

Once you get the hang of running on a virtual machine, use Puppet or Chef to learn how to automatically configure your servers when starting a new VM. This will save you a lot of time setting up your public VPS later.

An important difference between your local virtual machine and a VPS is that you will have to take some steps to secure a publically accessible server. Points to take into consideration here are: key vs password based SSH authentication, iptables firewall.

I've found the Linode library to be a good source of introductory documentation about setting up a VPS: http://library.linode.com


Thanks for this!

Running from a local machine is going to be really helpful.


The Linode Library has a ton of great tutorials that are mostly not Linode-specific, and don't require you to have an account there. They even have LAMP setup guides for both CentOS 5 and 6: http://library.linode.com/


I don't know what kind of answers are you hoping to get here, but from the way you address the issue, I would say that there is no easy way to this.

If you want to learn linux server administration, IMHO the easiest (or at least the one which will make you learn) way is to try and use linux as a desktop for several months.

And don't go for something "easy" like ubuntu. Try Slackware, Arch Linux or Gentoo. This will force you to see what kind of knowledge you need, what kind of problems are common. Things like kernel tweaking, dependency resolving, filesystems, shells, etc.

Of course, you can continue to copy/paste from tutorials. It will probably work... to some degree... until things go wrong...


I'm in a similar boat to the OP. But when I read "kernel tweaking"... it terrifies me.

Do Linux server admins actually... change anything related to the Linux kernel?

I mean, I pretty much gave up on trying to understand Linux when the "certified" tech support at Rackspace couldn't figure out how to upgrade the version of PHP on my servers, apparently something to do with incompatibilities between the way the Red Hat PHP distribution was set up, and the official PHP one. And these are guys who have taken courses of years+ on configuring Linux, and that's still inadequate to achieve what would appear to me to be a trivial uninstall / reinstall.

Am I missing something here, or is Linux really this insanely hard to configure, to the point where I shoudn't even bother trying, and just leave it to the experts?


Nowadays, you will most likely never need to recompile your kernel. At least not if you are doing "normal" stuff.

Let me give you an example of what kind of stuff you will come head to head with:

Recently I was installing and configuring a Riak cluster. I wanted to configure it to use multi backend with a large partition ring. What these are is not essential to our discussion here. What is essential is that I hit the riak user's limit for simultaneously open files. This is a thing controlled by the kernel, but configurable in userspace. If you are interested, you can find how to raise the limit by using Google.

This is the kind of "kernel tweaking" one usually needs to do. 1. How to make it work 2. how to make it persistent after server restart 3. WTF?! it's not the same in debian/ubuntu and Red Hat (half of the solutions I found don't work)

But the harder part is not finding the solution. The harder part is finding out what is the problem. In order to do so, you need to have experience. Know where are the logs, know which logs to look at. Know how different systems behave under such conditions (in my case, Erlang VM). Be proficient with shell tools for diagnostics. Be able to use emacs or vi(m) on the spot (you have no graphical environment) etc.

And there is no easy way in obtaining this skills. The only way is to get your hands dirty. Very dirty. Build systems, break systems, fix systems. You can't be good by just following tutorials, nor by using a sandboxed environment like a VPS.


>Do Linux server admins actually... change anything related to the Linux kernel?

Yes.

The Linux admins where I work have looked at TCP buffer settings, memory overcommit settings, and some other kernel level configurations. Last week, I was trying to determine for a user if the PF_SWAPOFF flag was being set on their process, and if memory was being harvested by the Out Of Memory Killer.

Linux is not really this hard to configure. What I'm describing is hyper-optimization and OS level troubleshooting. Most of my developer friends have a passing familiarity with Linux administration if they host their own web servers. One of them even runs Gentoo on some of his VPS's. However, once he gets past the level of "blog post to tell you how to fix this" he generally calls me. He gets paid to develop applications, not fiddle around with the VPS.


I would advise against going with a linux desktop to start with.

Buy yourself a cheap 'Low End Box' -> lowendbox.com and get a feel for linux. Once you feel you can happily control a server, then install it as your desktop so you don't by accident nuke your computer.

I find that being in a similar environment to your servers all day helps a lot. Try it :)


Nuking your computer is a part of the learning curve. It will happen one day. And if that happens on a production server, it hurts quite a lot more, than on your own desktop machine.

"Server Administration" is not only "having the feel". Server administration is experience. If you haven't been in hell, you can't prepare for going there.

Of course, this is only true if one really wants to learn "system administration". If one wants to be able to fix problems when the whole office is standing on his head (systems not working). If one wants to just be able to deploy their "hobby project", then fine, go with the copy/paste way. You don't need anything more than that.


Why not just create a VM?


Because by using a VM on a "baby-sitted environment" like Linode, you will most likely never have any real issues. Unless you create them yourself (which is quite likely).


Not a Linode. Just on your own machine. You can run your own VM with something like VirtualBox. Just download the install iso for the Linux you want, register it as a CD/DVD in VirtualBox, turn on the VM, and away you go. It's dead simple. Even I managed to do it.


So don't put it in a managed environment. VirtualBox and VMware Player are free. Put it on your own machine and do it yourself.

Honestly, I am becoming amazed how the attitude of I'll do it myself, especially in a learning environment is slowly seeping away.


don't completely agree. OP wants to get to grips with server administration, not with linux. ubuntu, or any other easy distro/debian derivative will do just fine. I would further recommend the installation of nginx, which is fairly easy, just make sure you take the slightly more difficult path by compiling it yourself (will give you a little insight into makefiles). configuring your nginx.conf and default sites will provide further insight into server administration. the documentation for nginx is top notch, plus you got a fast server running, which will fit most of your use cases.


I disagree. I will ask you several questions. You probably know their answers. And the OP probably doesn't (at least not all).

* What is a network interface?

* What is localhost?

* What is a reverse proxy? Why the hell does one need that? Apache didn't require to become one in order to run my PHP programs?

* What is a Makefile? What is a compiler?

* What is a SSH tunnel?

Now tell me, do you think it's a good idea for someone who doesn't understand these topics like the palm of their hand, to run their own server?


yes, I do think it's a good idea. we're talking about a novice here, who won't run a site that requires 99.9999% uptime and with your selection of topics you're probably already digging too deep into marginally relevant technicals. they are in my opinion not required for successfully running a server (except maybe for the reverse proxy), however I believe you failed to mention a few things I would find very important: focus much more on the security side when you're running your own webstack. things like:

* restricting .htaccess and other folders

* escaping mysql requests from user input

* sanitizing user input

* handle DDoS attacks, spam prevention

* correctly setting exipration dates for caching

* DNS configuration (round robin, etc.)

* correct amount of worker process

Calomel.org has got an excellent guide for setting up your nginx server https://calomel.org/nginx.html


The Slicehost articles are quite good - http://articles.slicehost.com/

Linode also has a library - http://library.linode.com/


Solving a problem is the easiest to learn and retain that knowledge. Get an account in development EC2 which I think is free, or something cheap in the cloud like prgmr.com and build a linux server and learn. Deploy your application manually and solve all the issues you face. Linux is so wide spread these days, there are very little that you can't an answer on the web.

I say CentOS or Ubuntu (w/out UI) is a good way to start. Those 2 distributions have many step by step solutions scattered on the web such as stackoveflow and forums posts. Slackware, Arch Linux or Gentoo are great for their target audience. IMHO they provides very little out of box for a noob and it's very easy to get lost in what you can set, break and/or fix. There is nothing more demoralizing that spending 2 days digging around the web for a problem that has numerous answers and you've no idea what everyone is on about.

Books are very useful guidelines, but getting your hands dirty is how you'll really learn.


I'd suggest avoiding prgmr (who I think are awesome by the way) and opting for somewhere like Linode, just because it makes it so easy to wipe your VPS with a clean image and start again. (I'm talking specific to this thread, not as advice for everyone.)


For me that is a very helpful feature. I've done installation many times and I've done them to a cheap machine at home so I'm quite familiar with the process. It's the ins and outs of the linux that I was not able to get for a long time. Being able to wipe a VPS with a clean image allows me to quickly start over when I have mess things up so bad.


Hi! I teach Linux server administration basics in college, on Centos. I've been thinking about writing an ebook or some sort of guide for other developers to get started with Linux/Centos. Would you care to share what kind of things you'd like to learn? Are you talking about real linux basics, maintaining software, setting up Apache, ... ?


I've watched someone slowly learning sysadmin recently, and I think what would be really helpful is an easy way to understand what is needed, and why, for a basic LAMP server, with FTP and SSH for access, and iptables security basics. He started with installing a LAMP package and I see that it's scary for someone to start using the command line, modifying apache confs etc, when you have no idea what you are going to break where.


Hi,

Essentially getting apache up and running and actually understanding the commands I'm using, other things are ssh, setting up FTP and another thing that daunts me incredibly is setting up the virtual host, I find it so easy to break things when I don't know what I'm doing.

There are probably a couple things I missed out on but a noob to ninja type ebook would be great.

Thanks a lot


Sounds exactly like the basics I'm teaching my students. It isn't all that difficult to get started with linux once you know how to approach things. Thanks for the feedback, I'll think I might get started on an ebook that clearly builds things up.


Well, the thing is, he doesn't know what of all these he needs to learn. And there is no "book" or "tutorial" that can cover this.

Only way is the old and tested one... force yourself to use it, till you "get it". I don't know anyone who learned it some other way. And I know lots of sysadmins (and I have all the skills, though I'm a "DevOp")


I think that an ebook covering the process, start to finish, of configuring and securing a web server would be helpful.


I'm in a similar boat as the original poster; I'd love to learn the full LAMP setup process, how to use SSH correctly, how to set up domains/etc.


HOWTOs. http://www.tldp.org/HOWTO/HOWTO-INDEX/index.html http://www.tldp.org/guides.html

This treasure trove of quick-start guides for newbies enables you to learn a wide variety of software and ways to use the Linux operating system. There are several docs on using Linux, common command line tools, server/network administration, Bash programming guides, set up instructions for server software, and tons more. You will become a Linux ninja by reading and following through with these HOWTOs.


Start with the shell/command line and study its infinite capability. A good place to start would be Zed's site. http://cli.learncodethehardway.org

After that follow the advice of kcvv - take notes, rebuild VM's again and again building on your new knowledge.


10 years old now (and that's the 3rd edition), but still a good tome: Essential System Administration from ORA http://shop.oreilly.com/product/9780596003432.do


I'd love a modern guide on how to secure a modern webstack.

What do I really need to do to secure an EC2 image, or an AppEngine application or a Heroku application?


It would probably be easier for us to give advice if you told us which specific features essential to your web app you need.


Make backups. Take backups often. Ensure the backups work.

Remember these and most other things are just window dressing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: