Tweaking Debian Apache / Munin

May 13th, 2012 Leon Posted in Linux, System Monitoring, Web Site Hosting | No Comments »

Today I was cutting one of our client’s development wordpress sites over to production and ran into a couple of tweaks that were needed.

Mainly, I wanted to get Munin hooked up to the new server so we could monitor system load, disk activity, mysql activity, and the apache statistics. However, when I went to set up the Apache and Mysql plugins there were a few issues that needed to be tweaked.

First, the .htaccess file for WordPress was causing the /server-status/ url to get hijacked by WP prior to getting processed by the Apache Status Module. Based on this post I needed to adjust the .htaccess file to ignore the status requests, and wound up with:

 # BEGIN WordPress
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index\.php$ - [L] 
 RewriteCond %{REQUEST_URI} !=/server-status/?auto
 RewriteCond %{REQUEST_URI} !=/server-status
 RewriteCond %{REQUEST_URI} !=/server-status/
 RewriteCond %{REQUEST_FILENAME} !-f 
 RewriteCond %{REQUEST_FILENAME} !-d 
 RewriteRule . /index.php [L] 
 </IfModule>
 # END WordPress

Next, when the munin apache modules where run an error like the following would occur:

Can’t locate object method “new” via package “LWP::UserAgent”

the solution based on this post was to install the libwww-perl package, which provides those methods. This was able to get the Munin Apache Plugins working.

As for Mysql – based on this post I had to install the libcache-cache-perl and libipc-sharelite-perl packages to meet the missing dependencies.

Now it’s just a matter of waiting for the hits to come in and stare at the graphs for a while.


PDF Processing with PDFTK

May 5th, 2012 Leon Posted in Linux, Software | No Comments »

While working on a PDF processing system for one of my clients I started running into issues with PDFTK which is used to merge individual files together.

PDFTK is a command line toolkit that lets you slice, dice, and merge PDF files.

After much experimenting and googling I came to the following guidelines to keep myself out of trouble:

Don’t Try To Create Files Larger Than 1.2GB

While creating file I keep track of the size of the input files and if the total gets above 1GB I split the file at that point

PDFTK Doesn’t Like Big Single Page Files

This one was tougher to track down. I was trying to assemble files and we had a bunch of single page PDF files that were tabloid size full page photos scanned at 300dpi. It turns out that when you get to a certain number of large single page input documents PDFTK starts running into memory allocation issues. The solution here was to split the document any time there were more than 3 documents added that were about 15mb each.

In a nutshell clients order a number of single page PDF files, and when we fulfill the order merged PDF files are created. We now split the PDF files when one of the following conditions is tripped:

  • output document is more than 500 pages
  • output document is more than 500 mb
  • output document contains more than three pages of 15mb

While these numbers may seem a bit arbitrary we settled on the first two conditions because certain clients computers seemed to start having issues reading PDF files with Acrobat when the files exceeded those numbers.

Anyway – hope this helps.


linode.com – Linux VPS Hosting

March 23rd, 2011 Leon Posted in Linux | No Comments »

With my leaving Fulcrum Enterprises, and the closing of our Phoenix data center, the search was on for where to relocate our servers.  Due to some bad experiences in the past, I’ve always wanted to be able to get my hands on our equipment.  However, after a lengthy discussion with Brent Burval at ezSolutions, we decided to look ‘to the cloud’ (I really hate that phrase).

After examining quite a few VPS hosting services we settled on linode.com.  The main reasons we settled on this company where:

  • attractive pricing
  • large selection of distributions
  • ability to migrate an existing server to a VPS
  • availability of additional IP Addresses (rackspace only allows 5 per VPS)
  • extensive online documentation
  • user friendly control panel

For more information please see the linode web site.


Getting Out Of The Hosting Business

March 23rd, 2011 Leon Posted in Ramblings | No Comments »

After a number of problems at our data center, combined with some hacker attacks, I’ve decided to get out of the web hosting business and am resigning from Fulcrum Enterprises.  All of our business hosting clients will be transferred over to ezSolutions, and I will be working with them as a consultant and developer.  We should have all the email and web site accounts transferred by the end of April.

I will continue to do business consulting and web site development for my existing clients, however all hosting related issues will be handled through ezSolutions.