Category Archives: Linux

The Linux Category actually encompasses *BSD, RH, Fedora, Ubuntu, and the like.

Moving VMWare Machines Around

I recently setup a new VMWare server on one of our older Dell servers (2850 with 8GB RAM 6X300GB SAS). And since I’m eventually redoing the primary VMWare server, I wanted to move all the critical virtual machines to the secondary server (for obvious reasons).

So far everything has been moving great, but I did have one issue:
After moving our collaboration helpdesk server, I could no longer remotely access the virtual machine.

ifconfig showed that only the l0 was loading.
nano /etc/networking/interfaces displayed both the l0 and eth0 settings
ifconfig -a informed me that in the transition, the virtual machine decided to change the ethernet device to eth1
nano /etc/networking/interfaces and I changed all the eth0 to eth1
sudo /etc/init.d/networking restart or just reboot the server

Test SMTP Using Telnet

I’ve been using this more and more and have finally memorized most (if not all) of it. But this is for those of us who don’t really like to remember useless information.

Start -> Run -> CMD
telnet
open mail.mailserver.tld 25
At this point the server should respond with a 220 mail.mailserver.tld ESMTP Mail Service.
ehlo test.com
The server then should respond with 250 mail.mailserver.tld along with all the supported features of the mail server
mail from:tester@test.com
250 Sender OK
rcpt to: admin@test.com
At this point, the server should say 554 Relay access denied. This means your server is not an open relay.
rcpt to: actualemailaddress@mailserver.tld
250 Recipient OK
data
354 Start Mail input; end with CRLF.CRLF
subject: subjecthere
You’ll have to hit enter twice after the subject, then go on and type the body.
body here.
Note the . at the end – you’ll have to type a return and another . to finish.
Then there should be a server response 250 Queued mail for delivery. You can quit now.
quit

Anti-SPAM SMTP Gateway

Ah joy of joys. One good, and bad, thing about Exchange 2007 is that you need to run a separate installation of an SMTP gateway. It’s good for security and also for lowering the load on the exchange server. It’s bad because that’s one extra point of failure, and it won’t work straight out of the box.

Up until recently we’ve been running a custom installed MAIA/Postfix/ClamAV/SpamAssassin server. The problem we’re encountering is the huge database files created by MAIA. Logging of every email is necessary, but we’re growing by 1GB every week. MySQL is a nice server, but even it has limits. One of those limits is when the server grows to the max of the HD – then all services stop. Never a fun time.

So as a backup plan, we installed a standard Ubuntu server running a standard SMTP postfix configuration. Only issue with that is it doesn’t have the anti-SPAM/greylisting (at least it has the AV installed). So instead of 99% of SPAM being blocked, it’s at 0%. Not fun.

Since I’m not the best at Postfix configuration, I decided to go with a package deal: ESVA (Email Security Virtual Appliance). Yes, it’s a virtual machine. You need to run a VMWare server of sorts (or workstation) in order to use this software suite. Click here for the website. So far it’s been a breeze to setup – it’s maintained by several people, has a forum board, and a few whitepapers on how to install/administer. I’ll be fully testing it out on a maiden voyage soon, so look for an update.

***UPDATE***

Here’s a few items that I learned during setup:
Stop “SPAM Not Delivered” messages
Edit /etc/MailScanner/MailScanner.conf and remove "notify" from the spam actions line.
Webmin stops working after an update or during initial setup. You MUST open webmin using the admin panel interface link (under tools).
If you want to edit the message body tags (the “scanned by ESVA” blah blah) go here:
/etc/MailScanner/reports/en
And edit the files you see (txt and html).
To keep /var low, do the following:
Turn on the script in /etc/cron.daily/clean.quarantine by changing the number 0 1
$days_to_keep = 14; in /etc/cron.daily/clean.quarantine
define(QUARANTINE_DAYS_TO_KEEP, 14); in /var/www/html/conf.php
INTERVAL 14 DAY in /usr/local/bin/mailwatch/tools/db_clean.php
esva-update and esva-configure are your friends
/etc/hosts is your friend too – You might need to add the IP of your mailserver and the name here

As a final update: I’m getting roughly 500MB worth of mail every day (SPAM and regular). It doesn’t appear to actually delete the SPAM as I have stated per the rules, but I set the days to keep quarantine to be 7 days instead of 14. 7 days X 500MB = 3.5GB. Weekends receive a ton less mail, so we’d probably be fine with 14, but I just want to make sure.

Ubuntu Repositories Download Speed

I recently upgraded my working Ubuntu 7.10 to Ubuntu 8.04. I hadn’t used the computer in about a month, so there were quite a few updates to do. Namely 83 updates.

sudo apt-get update
sudo apt-get upgrade

It was flying at anywhere from 300KB/sec to 950KB/sec on most of the packages, but then would falter down to 4000bytes/sec (and sometimes even less). I figured it was the Repositories getting nailed, or my network connection becoming unruly.

But, after searching for a while, I found the answer: the us.archive.ubuntu servers are SLOW. Doesn’t matter that the servers reside in the same country I’m located.

Edit the /etc/apt/sources.list file to remove the “us.”

cd /etc/apt
cp /sources.list sources.list.old
nano sources.list

Anywhere it says “us.archive.ubuntu” remove the us., then it should say “http://archive.ubuntu” etc.

Analog On Ubuntu

This is a step by step process to install Analog logging server for apache on Ubuntu Server.

Update your ubuntu server
sudo apt-get update
sudo apt-get upgrade

Install analog
sudo apt-get install analog

Edit analog config file
sudo nano /etc/analog.cfg

Now I ended up putting in the following:

OUTFILE /var/www/stats/report.html
HOSTNAME “My Site”
MONTHLY ON
WEEKLY ON
DAILYREP ON
REQUEST ON
DIRECTORY ON
SEARCHWORD ON
SEARCHQUERY ON
BROWSERSUM ON
OSREP ON
FAILURE ON
REQLINKINCLUDE pages
REFLINKINCLUDE *
REDIRREFLINKINCLUDE *
FAILREFLINKINCLUDE *
SUBBROW */*
SUBTYPE *.gz,*.Z

And I kept all the search engine and page include stuff by default.

You can then run a crontab to allow the script to run every hour or day or month.
For everyone’s reference, here’s my settings in Crontab:
sudo crontab -e
15-45 * * * * /usr/bin/analog
That forces analog to run 15 and 45 minutes after every hour, every day, every week, every month.

VHCS On Ubuntu

I was given the project of DNS entries for several customers. After playing around with BIND9 for several hours (I actually got it to work for all sites EXCEPT http://sitename.tld – it worked fine for subdomains), a colleague suggested that I try VHCS. VHCS is a free software suite that allows for Virtual Hosts, DNS, and other web related items to be shared and easily managed between several groups. You can grab more data here: VHCS.net

I also chose to put this on Ubuntu because debian packages are easy to install, Ubuntu is fully supported by a huge user base, and Ubuntu also uses a very small footprint.

Once you download the suite, follow the Install directions all the way until you get an error similar to this:
If specified by -literal_key, then the key length must be equal to the chosen cipher's key length of 56 bytes at /var/www/vhcs2/engine/setup/../vhcs2_common_code.pl line 1443
Compilation failed in require at ./vhcs2-setup line (line whatever)
.

Here’s the fix:
nano /var/www/vhcs2/engine/vhcs2_common_code.pl
Control + W and search for db_pass_key
Any time you see 'key' => $main::db_pass_key fill in the following ABOVE the line:
'keysize' => 32,

Then rerun the script ./vhcs2-setup

P.S. By the way even, the instructions don’t really mention that you have to copy some folders over. Make sure you copy everything in the vhcs2-2.4.7.1/configs folder to /etc/vhcs2/ otherwise it will fail out. If you get some postfix errors, that’s probably ok.

P.S. Part 2 There is a much easier product to setup: ISPConfig. You can find it at ISPConfig.com. I recommend using ISPConfig as it is actively maintained.