Latest Entries »

For some reason it’s not as apparent to change the outgoing Nagios e-mail address as you would think. It typically sends from nagios@your.host.name, which is fine for us nerds, but doesn’t look as nice when you’re providing monitoring services for a client or a co-worker.

Please note that this article assumes you’re using sendmail!

In order to change the sending address that Nagios uses, you will actually have to tell sendmail to “re-write” the default address. This is done using sendmail’s genericstable feature. Step 1 is to enable genericstable by adding the following lines to /etc/mail/sendmail.mc. Make sure that these are above the MAILER(…)dnl lines at the bottom:

FEATURE(`genericstable’)dnl
GENERICS_DOMAIN(`your.host.name’)dnl

After adding those, close and save the file and run the following command to apply your configuration changes:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Now that we’ve enabled the genericstable feature, we can add the re-write. You will want to edit/create /etc/mail/genericstable and add the following line (customizing for your desired address of course):

nagios mynewaddress@my.domain

Close and save the file. Now we want to build a genericstable database that sendmail can understand:

makemap hash /etc/mail/genericstable < /etc/mail/genericstable

And finally, for good measure, restart sendmail:

/etc/init.d/sendmail restart

Now Nagios should be sending out e-mails using a user-friendly address!

If you are running Plesk and you want to run something from a directory outside of the httpdocs directory you can do this simply by adding a vhost.conf file.  You will need to create the vhost.conf file in conf/ in your websites main directory.

cd /var/www/vhosts/domain.com/conf/

You can create this with your favourite editor.

vim vhost.conf

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir /tmp:/var/www/vhosts/domain.com
</Directory>

Save this file and then we just have to edit the httpd.include file.

Once the file is open you just need to add this line:

ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
Include /var/www/vhosts/domain.com/conf/vhost.conf
</VirtualHost>

Save this file and you just have to reconfigure plesk

/usr/local/psa/admin/sbin/websrvmng -u –vhost-name=domain.com

Now you should be able to access folders outside your main httpdocs folder. If you need to do this for https connections you can follow all the same steps but you will need to create a vhost_ssl.conf file instead of the vhost.conf file.

I just finished running fsck on an LVM and was having some issues since I was actually trying to run the check on the disk itself rather then the LVM. I completely forgot that you needed to run it on the actual individual LVM’s which prompted me to add this to our blog for others and also for quick reference for the future. Here is how you do it.

View full article »

This was my way of making up for it.. a little unorthodox, but it sure did the trick!

Homemade -y flag

Recently, we have had some issues where one script or website would cause an Apache child process to consume all of a server’s RAM. This eventually led to memory swapping and a kernel panic if left for a matter of minutes. We initially had set our eyes on RLimitMem, but quickly discovered that it only limits processes spawned by Apache children (such as PHP). So, in order to solve this problem, we stumbled on a great solution using an unexpected Apache module: mod_perl.

There is a perl module called Apache2::Resource (or Apache::Resource for those of you still using Apache 1.x) which allows resource throttling on a per process level. Not only can you limit memory usage, but CPU and other system resource limits are available as well (for a full list, consult your disto’s setrlimit man page). This module should be installed by default on most RHEL systems.

View full article »

We’re pleased to announce that Dynamic Hosting has upgraded our Silver, Gold, and Platinum dedicated servers! Included in the changes are:

  • Silver has gone from 2GB to 4GB of RAM
  • Gold has gone from 4GB to 6GB of RAM
  • Platinum has gone from being a RAID-1 on a SAS6ir to a RAID-5 on an H700

Our technical team made these decisions after some performance evaluations. We have also decided to provide these new configurations at the same price!

You can check out our Canadian dedicated servers at http://www.dynamichosting.biz/content/dedicated-servers/

Dynamic Hosting is now publicly offering VMWare Virtual Machines in Canada! We have been hosting VMs for our trusted partners for several years, and have finally opened them up to everyone. Using the latest in VMWare ESXi technology along with enterprise HP and Dell servers, and fiber channel SANs, we are proud to offer the most reliable and best performing VMs in Canada!

Not only do we give you full administrative access to the operating system of your choice, you can also use VMWare’s vSphere client to login and manage your VM. This allows for complete “hands on” management of your environment. You gain the ability to do reboots, KVM management, performance graphing, and more!

Come check out our plans today at http://www.dynamichosting.biz/content/vmware-linux-and-windows-vms/

If you’re trying to setup bandwidthd with PostgreSQL, you may run into the following error: bandwidthd: Connection to database ‘user = USER dbname = bandwidthd host = localhost password = PASSWORD’ failed: FATAL:  Ident authentication failed for user “USER”. This is most likely a problem with PostgreSQL and not bandwidthd itself.

Here’s how to fix it (on CentOS/RHEL):

vim /var/lib/pgsql/data/pg_hba.conf

Find the line:

host    all         all         127.0.0.1/32          ident sameuser

Change the last part to md5. Your line should look like this:

host    all         all         127.0.0.1/32          md5

Restart PostgreSQL

/etc/init.d/postgresql restart

Et voila! You should now be logging to PostgreSQL :)

Setting up Snort on your Server. (I used CentOS 5.6)
Assuming that you just installed a basic install of CentOS Server we will have to add a few things to the server so that Snort will run correctly.
First thing you want to install is mysql server and some other packages needed for Snort.
yum install -y mysql-server mysql-bench mysql-devel php-mysql gcc pcre-devel php-gd gd glib2-devel gcc-c++ libcap-devel
Once that is done we will add the Atomic Rocket Turtle Repo so that we can use yum to install snort.
wget http://www.atomicrocketturtle.com/RPM-GPG-KEY.art.txt
rpm –import RPM-GPG-KEY.art.txt
wget http://www.atomicorp.com/installers/atomic.sh
sh atomic.sh

A thanks to Adam Thurlow from SheepDog Inc. for providing this report for us!

Cherokee Webserver Report

Cherokee Logo

This report documents all of our findings testing the Cherokee Webserver for use with Django in production.
View full article »