Posts Tagged ‘server admin’

Configuring SSH

Tuesday, February 17th, 2009

In the last while I have been having to connect to various servers using different accounts with different types of credential requirements. This has lead to some interesting ssh commands such as

ssh -l some_user -i ~/.ssh/other_key.pub example.com

After having a few servers and starting to lose the commands in my history, I figured there must be a better way to keep track of this. Turns out there is (surprise surprise). Inside your home directory, there’s a .ssh folder where you can drop a config file. So, to recreate the above example you would add the following section:

Host example.com
    User some_user
    IdentityFile ~/.sh/other_key.pub

and now I can connect with

ssh example.com

There is a whack of documentation about how this can make your life easier. Check out the man pages

man ssh_config

RAM – who knew it could take out a computer?

Tuesday, January 20th, 2009

At one point or another I’m sure most of you have run across bad hardware. This past week I built a computer and was running into an odd situation. After about 2 minutes of running (or less) the system would completely lock up. Rebooting would sometimes make it to the login screen while other times it would just die part way through. Other times, the system wouldn’t event make it past the POST or show the BIOS loading screen.

Fearing a faulty motherboard, or inproper CPU installation, I decided to watch what was happening to the temperature in the BIOS. The temp was staying quite low ( < 30 C for both the CPU and motherboard) but, the system would still lock up… even in the BIOS screen. At this point I had detached everything except for the video card, 1 stick of RAM, and the hard drive and was still getting the same problem.

As a last ditch attempt, I swapped out the final stick of RAM for one of the other ones in the pile of components sitting beside the case. And what do you know, it worked!

Now, the only conclusion I can come to is that the RAM was overheating after about 2 minutes or so of use, and then completely ceasing to function. The bad memory addresses must have been quite close the beginning since even in the BIOS screen (where I’m assuming it doesn’t do all that much with RAM) would lock up.

Has any one else ever experienced something like this? For the record it was a Corsair 2GB stick.

Stress Testing Apache Using ab

Sunday, November 30th, 2008

If you’ve ever written a web-app you’ve probably wondered how well it will hold up once the world discovers your awesome service. Will it work if you get dugg? What happens if 200 people all try to access your site at once? This is where benchmarking can provide some useful numbers to give you an idea as to how your server will hold up.

(more…)

Save Your State with Rsnapshot

Saturday, November 15th, 2008

We all know backups are an essential part of running a server. Being able to restore in the worst case scenario of complete drive corruption (let’s say that your RAID setup failed somehow as well) as quickly as possible is key. Another situation could be one of your clients deleted their incredibly important file 3 days ago, but decided to call you about it now.

Rsnapshot is a series of scripts and commands which can automate the process of backing up your files to a remote location, as well as keeping a incremental copy of any changes. I have it set to keep 7 daily copies, 4 weekly copies (on Saturdays) and 6 monthly copies. Now this may sound like it will use up a great deal of disk space, but rsnapshot makes clever use of hard links, which means it only needs to store copies of files that have changed since the last backup as well as aslight overhead. In my case, this means that for every 100 megs that is backed up, on average only 1 extra meg is stored per copy. So, if I had 1GB of data and 17 old versions (7 days + 4 weeks + 6 months) it would require approximately 1.2GB of physical disk space.

(more…)

Virtual Server Setup

Saturday, June 28th, 2008

Recently, I needed a clean environment to do some development for a project at work. The OS (ubuntu) I have installed on my development computer wasn’t the same as what the application was originally developed and deployed in (red hat) and this was causing a few issues. I debated bringing up a slicehost slice solely for coding and testing, but this seemed like a hassle, as well as an extra expense.

Enter virtualization. There are a number of options to create a virtual computer on your host system. The most popular hypervisors are VMware and Xen. What these programs will let you do is create a completely separate installation of an operating system inside your current one. This let me create the clean environment I needed for this project.

(more…)