Category Archives: Linux

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

Samba Issues and Fix

After installing CentOS 5.2 x64, webmin 1.420, and vmware server 2.0.0, I tried to get samba working.

Getting samba to work correctly is the easiest via the webmin interface. Webmin actually makes almost everything easier. I like it when computers are made easier. Thank you, webmin. You can find how to install webmin by searching for webmin. Too bad I don’t get paid for the number of times I can type webmin. I’d be rich. Webmin.

Back to the task at hand… I set samba up to work:
yum install samba
But it’s not set to automatically start, so we have to use webmin ($$$) to get it to auto start. Samba requires two services to run:
1.) SMB – starts and stops the Samba smbd and nmbd daemons used to provide SMB network services.
2.) winbind – starts and stops the Samba winbind daemon.
I set both of them to startup when the system starts.

Then I set the permissions on a folder (/var/lib/virtual machines/) which I called vmware. They are/were setup correctly. But I couldn’t attach from my windows box to the samba share. Permission denied.

So then I tried to chmod -R 777 /Virtual\ Machines
Didn’t work.

As a final attempt, I tried to smbpasswd (username)
Typed in a new password
Failed to find entry for user (username)
Failed to modify password entry for user (username)

Webmin failed me! It said that it converted the users for me, but obviously it hasn’t.
So here’s the fix:

smbpassword -a (username)
New SMB password:
Retype new SMB Password
Added user (username)

And then, like magic, samba started working! Whooo!

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.