Create an Ubuntu 10.04 Xen Guest Image via Debootstrap

August 24, 2010 by David · Leave a Comment 

This is a lot easier than everyone makes it out to be. I’m doing this post because I was looking around at other tutorials and saw crap like having to hack scripts from Karmic and stuff like that. What the hell. Anyway, here’s a step-by-step guide to create a Lucid Lynx Xen-ready image (pvgrub-ready) using debootstrap. Debootstrap is a Debian/Ubuntu program but I believe that there is a way to install it on Fedora/Centos systems as well (at the time of writing I haven’t really looked, though).

Before we start, a quick disclaimer: while these steps will create a basic, functioning Lucid image, I’m not making any claims about it working 100% in every Xen environment. Like with any DomU template, you’ll need to test it thoroughly for your Xen environment before deploying, especially in a production environment. Now, lets begin:

Read more

Reset MySQL Root Password

June 6, 2010 by David · Leave a Comment 

Forgetting the root password for a MySQL server probably happens at least once in a sys admin’s life. It must also be really embarrassing if the sys admin is also the DB admin, heh. MySQL passwords are encrypted by default, so your only real option is to reset the root password. It’s a straight-forward process but does require you to shut down MySQL.

Read more

How To Remove the wlwmanifest.xml Link in WordPress

May 11, 2010 by David · Leave a Comment 

I happened to glance at the HTML header code for this blog and noticed the following line:

<link rel=”wlwmanifest” type=”application/wlwmanifest+xml” href=”http://www.dsj.za.net/wp-includes/wlwmanifest.xml” />

Well, I haven’t seen that line before. The file looks like it enables tagging support for Windows Live Writer. Well, as I don’t really use Windows other than for gaming, I decided to remove it.

Read more

What is a VPS

April 24, 2010 by David · Leave a Comment 

A part of my job consists of building and managing VPS’s. They’re pretty hot right now (have been for a long time), however whenever I bring them up during discussions about webhosting, people just stare at me blankly. So here is a quick, layman’s-terms guide to what a VPS is and why webmasters should be interested in them.

Read more

How To Install Denyhosts on Centos

April 8, 2010 by David · 1 Comment 

Denyhosts is a lovely python script that can help stop SSH bruteforce attacks. It scans your SSH logs and bans IPs that fail too many login attempts. While it is a staple on Debian/Ubuntu servers, it isn’t in the main Centos repositories. Fear not! Here is how to get it installed on a Centos box.

Read more

Reading Online Complaints? 7 Things to Keep in Mind

April 5, 2010 by David · Leave a Comment 

When looking for things like a web hosting company, people will often do a “X sucks”-type search in Google, ‘X’ being the name of the company. Some will often take this one step further and do a “X rocks”-style search and weigh the two together. However, while the logic behind such a move is sound, many fail to take some basic truths about online complaints/reviews into account. If you ever want to use the “X sucks” method of company research, take the following into consideration:
Read more

Setting Up Domains on Your Computer For Development Work

February 2, 2010 by David · Leave a Comment 

I, like most people who like to test out new website applications/scripts or do some personal dev work, have a webserver installed on my computer. A grumbling I’ve heard often (most recently was last night, at the time of writing) is that they always have to have the script in a subdirectory, eg localhost/blahblah. Sure, they say, you can have your own domains, but only if you set up a DNS server. Which they don’t want to maintain.

Uh…. no you don’t. Just use your hosts file. How do you think your computer knows how to resolve localhost anyway? This little file is often overlooked, which is a shame. Just slap the domains in there and you’ll be able to host multiple sites on your computer (obviously you’ll need to configure the webserver to handle the domains). On Linux, the file is usually /etc/hosts, on Windows it’s C:\windows\system32\drivers\etc\hosts and on the Mac (Mac OS 10.2 and later) it’s /private/etc/hosts. They all follow the same format ([ip address] [domain name], eg 127.0.0.1 localhost).

Once edited, the domain will start resolving immediately. Trust me, it’ll work. Yeah, DNS is more feature-full, etc, etc, however for purely internal use the humble hosts file is still the best way to do things.

How To Log Subject Lines in Postfix

December 10, 2009 by David · Leave a Comment 

By default, Postfix doesn’t log the subject lines of emails that it handles. There’s nothing wrong with this, however sometimes a user will want to know if an email came in (or was sent), and you’ll almost never have the message ID on hand to search for.

Luckily, Postfix does allow you to log warning messages for subject lines, and so we’ll use this to simply log a warning message for any subject line. It’s a bit of a ‘hack’, but works and doesn’t cause any problems (Postfix doesn’t block or alter the emails).

Firstly, edit the main.cf file and add the following line:

header_checks = regexp:/etc/postfix/header_checks

Next, create the /etc/postfix/header_checks file and add the following line:

/^subject:/ WARN

Reload/restart Postfix and send a test message. You’ll see something like the following in your logs:

Dec 10 10:57:01 localhost postfix/cleanup[22492]: 2290326720: warning: header subject: test email from localhost[127.0.0.1]; from= to= proto=SMTP helo=

Notice the “warning: header subject” bit. Now, every subject line will be logged :) It makes life a lot easier when doing email troubleshooting on a mail server.

SSH in Ubuntu OpenVZ Doesn’t Log to Auth.log File

November 1, 2009 by David · 1 Comment 

I have a couple of Ubuntu 8.04 OpenVZ VPS’s, and I use the Deny Hosts script to block hackers trying to bruteforce SSH. However, the other day I noticed two files in /var/ on one of my VPS’s: logauth.log and logmail.err. Logauth.log was sitting at 105 megabytes! Not only was the info being logged to the wrong file, but the log wouldn’t be rotated (meaning that it would eventually become so bloated that it’d take forever to read).

As quite a few of my VPS’s were affected, I guess there’s a bug with some of the OpenVZ Ubuntu 8.04 images where SSH logins (and mail errors) are logged to the wrong file. Easy enough to fix – just edit /etc/syslog.conf and change any instance of /var/logauth.log to read /var/log/auth.log. While we’re at it, change /var/logmail.err Instance to say /var/log/mail.err.

Restarting sysklogd should load up the new values, but if you want to be paranoid I suppose you could just reboot the VPS (shouldn’t be necessary, but if you do rather use the hosting company’s control panel to do it)

Setting Up Sarg Correctly in Ubuntu

October 12, 2009 by David · Leave a Comment 

The annoying thing about Ubuntu’s version of Sarg is that the cronjobs used to generate the reports are buggy – the weekly and monthly jobs only show some of the days :( Here is how I fix it. It’s not difficult at all, really, as you’re only modifying the contents of 4 files and removing a now-redundant one :)
Read more

Next Page »