Friday, September 16, 2011

Excel Writer Pear and Centos

Dealing with 3rdparty modules can be difficult but at Blue Box we know how to fix them.

Recently I moved from an Ubuntu Server to Centos 5.6 server. Everything worked well except for one really annoying 3rdparty application that led us down a really black hole.


History
Spreadsheet_Excel_Writer
Spreadsheet_Excel_Writer was born as a porting of the Spreadsheet::WriteExcel Perl module to PHP.
It allows writing of Excel spreadsheets without the need for COM objects.

After 2 days of looking we found that when you install pear (yum install php-pear) it created File.php which was been loaded dynamically into php and ignoring the correct File.php in the bluebox 3rdparty engine directory. This meant when calling the Excel function it did not load all its required modules.

The fix. #rm /usr/share/php/File.php

Now we able to build excel spreadsheets again.

Friday, May 6, 2011

Keeping a eye!!



Recently I have made use of a SaaS application called Server Density by boxedice.com it is really awesome web based app that monitors your servers in realtime and alerts you on events that you create. For instance I need to know when my Server load reaches 4.00 I get a email and if it gets to 6.00 I get a txt. Pretty handy when you need to manage many servers.

What is really handy besides monitoring the OS you can set triggers for services like apache and mysql.

The best part of this product is I can snapshot those events so If I am out of the office and the load spikes It will snap shot and email me a link to the snap shot telling me exactly what triggered the load. This is useful when trying to find out what scripts are killing my server farm!

The power of mobile is another plus in my life. Been a Open Source fan I love the Google Andriod push technology to get alerts on my phone.

How does this tie back to Blue Box 2.0. Well having to manage many servers you tend to lose sight of what is actually happening and this product is a niche fit to my growing network. To get Server Density installed on your BB 2.0 system drop us a line in the callcenter and we will assist you.

Geek Out :)



Monday, April 11, 2011

Raid

Hardware raid on linux seems to have its moments. I spent 2 days fighting a raid card and eventually wrote it off. I have been running 90% of my servers on software raid1. This has proven very stable and reliable.

What I quiet enjoy is using reiserfs filesystem it seems to handle power outages as well with very little failure.

Some tips on Software raid

I always use raid 1.
I set the raid subset to boot in degraded mode (great when you can not access the console).
I set the swap and raid size exactly the same on both drives.

Weekly check the control using cat /proc/mdstat ;-)

When choosing software raid on Ubuntu use the alternative disk it is easier to configure at install level.

When you prompted for the guided partition

Setup manual partition
Follow this useful link.


Chat latter while I complete this server install :)


Tuesday, April 5, 2011

Backup Your Blue Box2 by Shell and store data remotely

Hi Geeks

Tooday I will share a simple shell backup script. The purpose of this backup script is to enable you to backup your server data quickly without doing much. You can then FTP your www and Mysql database to a remote server.

I have chosen to download my backup my data to my local linux server. the local path is /backup

So firstly create a local store
#mkdir /backup
Now Create the backup script in the global bin directory
#cd /usr/local/bin
#vi backup
Add the backup script below and edit the variables to suit your server
Save the file. Set the permissions to be executed you can run a 777 should you wish then finally test it.
Before testing if you opted for FTP remote transfer enable ncftpd
#apt-get install ncftpd

Happy Backups

Simply edit your choices.
#################################################
## ##
## Backup Procedure Start ##
## ##
#################################################
LOG="/tmp/log.txt"
EMAIL="me@email.com"
CLIENTMSG="ServerName-Bkup"
DATESTAMP="`date '+%a%H'`"
DATEMKDIR="`date '+%A'`"
CODE="/var/www/"
BAK="/backup"
NOW=$(date +"%m-%d-%Y") # mm-dd-yyyy format
FILE="fs-full.tar.gz"
#* MySQL login user name *#
MUSER="root"
#* MySQL login PASSWORD name *#
MPASS="somepass"
#* MySQL login HOST name *#
MHOST="127.0.0.1"
#* System binaries *#
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
GZIP="$(which gzip)"
TAR="$(which tar)"
FTP="$(which ftp)"
ZIP="$(which zip)"
#*FTP Transfer Optional
### FTP server Setup ###
FTPD="My_Backup_folder/"
FTPU="myusername"
FTPP="mypassword"
FTPS="some.ftp.server"
NCFTP="$(which ncftpput)"

#############################################################################
# #
#Starting Backup System - Backup creates folders for the DAY #
# I.E. \\server\backup\DAY Of The Week (Tuesday) #
#############################################################################
#** Clean Up Load Files
/bin/rm $BAK/$DATEMKDIR/*
/bin/echo "Old data cleaned up" >> $LOG
/bin/echo "Database Backup Time Started" >> $LOG
/bin/date >> $LOG
###Mysql backup All databases

#$MYSQLDUMP $DBNAME > /tmp/$DBNAME.sql
/bin/echo "Database Backup Time Completed" >> $LOG
/bin/date >> /tmp/log.txt
/bin/mkdir $BAK/$DATEMKDIR


#* Start Backup Mysql
# get all database listing
#DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
DBS="$($MYSQL -u $MUSER -h $MHOST -Bse 'show databases')"

# start to dump database one by one
for db in $DBS
do
FILE=$BAK/$DATEMKDIR/mysql-$db.gz
# gzip compression for each backup file
$MYSQLDUMP -u $MUSER -h $MHOST $db | $GZIP -9 > $FILE
done
/bin/echo "Database Backup Time Completed" >> $LOG
/bin/date >> /tmp/log.txt

#*Code Base Backup

$TAR zcvf $BAK/$DATEMKDIR/www.tgz $CODE


###ETC System Backup
$TAR zcvf $BAK/$DATEMKDIR/etc.tgz /etc

#### FTP Dump
cd $BAK
### Dump backup using FTP ###
#Start FTP backup using ncftp
ncftp -u"$FTPU" -p"$FTPP" $FTPS<
mkdir $FTPD
mkdir $FTPD/$NOW
cd $FTPD/$NOW
lcd $BAK/$DATEMKDIR/
mput *
quit
EOF

#**Mail
/bin/cat $LOG | mail -s $CLIENTMSG $EMAIL

Thursday, March 24, 2011

FireFox 4 is here

And after the hype of I.E. 9 and the millions of downloads posted by Microsoft Mozilla batted back and launched FireFox 4.

I installed it and noticed a vast difference in speed of load and general browser enhancements. They seem to have taken a lot of time into cleaning up the browser clutter and making tab flicking a lot faster. The general feel is a lot less clunky and more clean.

I managed to install all of my POS requirements back into version 4 with very little conflicts. The engine remained the same to me.

What I enjoyed was going from version 3.x to 4 kept my add ons. In a POS environment the Full Screen add on is one of my favorites so having this in 4 was a pleasure. They seem to also give you a bit more control over updates and settings, this is very useful in a large network environment where you need to restrict users from making personal changes.

I can say I am impressed and will continue to recommend firefox as the Blue Box 2.0 browser choice.

Friday, February 18, 2011

Date on your BB2

BB2 uses date from the server time stamp. On a traditional BB2 server the date is normally set by typing
#date -s "hh:mm:ss dd:mm:yyyy"

Also bear in mind Time Zones so to correct this on ubuntu type
#dpkg-reconfigure tzdata

This will allow you to correct the time zone of your bb2 server

Also have a look at your bb2_config.php file in the engine/conf/ direcorty you can control your date by time zone using php time zones.


Friday, February 4, 2011

Prevent Bots from searching your Portal DATA

Because bb2 is web based the chances of a web boot (like google) caching some data files stored in your portal directory is very likely. In order to bypass your core data been available to the world add the following the the route of your web_folder in this case we will assume bb2 is installed in
/var/www
Within the the /var/www directory add the following to the .htaccess file

IndexIgnore *

This file needs to be saved now. Once saved your subdirectories will no longer be brows eable to the world.