Tuesday, July 30, 2013

Warning: Database file needs update - warning: /etc/aliases, line 2: record is in "key: value" format; is this an alias file?

I was investigating an error that I commonly receive in Logwatch every morning.

        2   *Warning: Database file needs update ----------------------------------------------------
        2      /etc/aliases

So I did what any normal person would do and GREPed the logs and ended up with this error:

/var/log/syslog:Jul 30 07:49:41 mx postfix/postmap[11224]: warning: /etc/aliases, line 2: record is in "key: value" format; is this an alias file?

So I did what any admin would do and ran newaliases, however that produced this error:

/var/log/syslog.1:Jul 29 17:03:48 mx postfix/smtpd[4062]: warning: database /etc/aliases.db is older than source file /etc/aliases

So after doing several Google searches I ended up finding a forum that gave me running this as a solution:

postalias /etc/aliases

That seemed to fix the problem. I could run newaliases after than without any error.

Saturday, July 27, 2013

AutoMysqlBackup adds another layer of assurance

Nothing causes me loss of sleep more than the though of loosing data. To add another layer of assurance, AutoMysqlBackup helps me sleep better at night.

Just run:
apt-get install automysqlbackup

This utility automatically schedules a back of all your databases on a daily, weekly and monthly basis.

So you can always rollback(considering that you have matching nightly backup for your WWW files) if a disaster occurs.

Friday, July 26, 2013

New server is UP, BBU, cache and learning about IPMI

The new 2U server is on-line with the drives from the old T300 server (which are only 2 months old).

I'm constantly rsyncing my files from the rented server to the 2U server so that when I'm ready to switch over there will be less to sync.  The thing that takes me the longest, is actually migrating the databases.

I discovered that there is a Battery Backup Unit(BBU) for my 3ware 9550SX raid controller that is optional. This is necessary to keep the writes in cache alive in memory, in case of a power failure. Those writes get written to the disks once the power is restored. Enabling the cache will also increase the performance. I found a new BBU on Ebay for $120 bucks and ordered it. No it's just waiting for it to arrive.

I discovered that to get the KVM operating on the LAN NIC, it required a jumper to be moved. Once I had that done and was able to access it, I discovered that I had a non-KVM IPMI. I didn't even know that "that" existed. I can get into the KVM and monitor just about every sensor, as well as reboot the server, but with no KVM; I can't change BIOS options and such. I found a new IPMI with KVM support for my motherboard on Ebay for 99 bucks. I really can't wait for this one to arrive, because sometime I want to tweak something in the BIOS and just can't get a KVM from my DATACENTER because there is a waiting list.

The server only came with 8 gigs of RAM so I placed another 8 on order. I just can't operate on 8 gigs. It would be the death of me. As it is there is enough traffic on that server to have to swap out to disk with 16gigs, so 24 or 32 gigs is a future goal.

Tuesday, July 23, 2013

The new server has arrived at the collocation center

The server has arrived but not unpacked yet.

I'm pre-emptivly backing up my configuration, files and databases to a rented dedicated server so when the time comes for the final backup and sync it won't take too long.

The plan is to:
  1. power up the rented dedicated server which won't be pulled until the 31st.
  2. Migrate my sites and data back to that server. (2-3 hours)
  3. remove the 4 1tb drives, 2 of the 4 gig DDR ECC memory and install them on the new server. 
  4. Load the OS and migrate my site and data to the new server in case the raid set is not identified
  5. Power down my rented dedicated server and the tower server.
  6. Packup the tower server with all the left-over bits and pieces(extra raid controllers, memory dimms, cables,etc) and ship them back to me. 
Once my old server arrives, I will be turning it into the ultimate Warcraft Monster box. Then my wife will divorce me.

Sunday, July 21, 2013

Pre-Login SSH banner

I was feeling very nostalgic one day and wanted an Ascii Art Login screen like the old BBSes I used to frequent as a youngster.

As you probably already know, I'm using Debian Squeeze, but this should work in just about any linux distro.

Just put what you want to appear in /etc/ssh/sshd_banner:

This is a private system! All attempts are logged!

Then, open /etc/ssh/sshd_config and modify this line:

#Banner /etc/issue.net
Banner /etc/ssh/sshd_banner


You can find cool ASCII art generators and galleries on-line.

Saturday, July 20, 2013

How limit postfix from sending email certain domains in Debian Squeeze

Well all know those certain users that you know they got that job because they are related to someone. And, most of them tend to send mail to made up domains.

This is how to limit them from sending to domains that don't exist.

Open up:
nano /etc/postfix/maps/header_checks

Add the following line per your requirements:
/^To:.*@hotmail\.com\.mx/ REJECT This domain does not exist.
/^To:.*@gmail\.com\.mx/ REJECT This domain does not exist.

You can easily change To: to From: and block receiving emails from those domains as well.

Here is a guide that might help you with other things you might want to block: http://www.akadia.com/services/postfix_uce.html

Friday, July 19, 2013

Refurbished Supermicro 2U rackmount server bought from Ebay

I originally had a Dell T300 as out in-house server with four 1tb Sata 7.2k drives in a RAID-5 configuration. It's an ageing box with 3.16ghz XEON processor and not a hell of a lot of space to grow.

I saw this ad on Ebay:
Supermicro 2U 12-Bay 2.6Ghz Quad Core 8GB SATA Server, 3Ware 9550SX-12LP Raid
 

I was able to bid the seller down to 500 bucks, and with free shipping, you can't beat it. The seller even said he would throw in the IPMI for free. With 12 drive slots it has plenty of room to expand. Dual-Quad core XEON processors, rails, I can migrate my registered memory from the old server for a total of 24 gigs of ram.

Once it arrives at my collocation center(scheduled to be deliver on the 23rd of this month), I will be migrating my drives (and any memory that will fit) from the old server to the new unit.

Naturally, I will be installing Debian 6.0.7 Squeeze. Why not Debian 7 you say? Because unfortunately, my control panel of choice, DTC, does not work with Debian 7 yet. I guess one day I will get a new fancy control panel with integrated billing and provisioning, but I've yet to feel the need to have a single point of failure for my entire business. My hostbill is doing fine, and my support ticket system is doing pretty good too. If it ain't broke, don't fix it, I say; unless you're getting a significant improvement in some area.