Uptime Monitoring with Pingdom

The other day I signed up for uptime monitoring with Pingdom for my website. I decided to find out how much downtime my own site really has. The issue of down time was brought to light after some of the other websites I administrator for work having technical issues causing downtime

The things I like about Pingdon is that you can can monitor 1 site for free and they host a public report of your sites uptime. My uptime report can be found here http://status.cloudportal.org/

If you are interested in creating a stats page for your domain have a look here http://blog.pingdom.com/2011/04/01/public-status-pages-under-your-own-custom-domain/

WordPress Comments and Varnish

After along time searching for the answer to fix my issue of where users post a comment and the IP address in the comment is of my Varnish server not the clients IP address who made the comment. Well this issue is now resolved after finding this post! http://theterminaladmin.com/wordpress-comments-and-varnish/

Ironically I couldn’t post a comment of gratitude onto his word-press site as I got a submitting error.

Just in-case is website disipears his post was the following:

While setting up this site I ran into an issue where comments posted were reporting the IP address as 127.0.0.1. This looked to be coming from Varnish and luckily, is fixable by editing two WordPress files.

The first is $document_root/wp-includes/pluggable.php. Add the following lines anywhere in the file:

if ( !function_exists('get_user_real_ip') ) { function get_user_real_ip() { $userip = ( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; return $userip; } }

The second is $document_root/wp-includes.comment.php:

Replace the following line:

 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );

With:

 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',get_user_real_ip() );

A simple fix but it works. You may need to re-apply this if you update/re-install WordPress but that is trivial at this point considering how easy it is :)

Web Server Upgrade Time Baby!

After many years of having my website hosted on a generic home-made server I have  upgraded to a newer server.

The new server is a HP ProLiant DL360 G3 with the specs-
CPU x2: Intel Xeon 3.06GHz
RAM: 2.5Gb ECC
HDD: x2 146.6GB SCSI 10,000RPM in a RAID1

The old server was a Intel D845EWD entry-level server motherboard with the specs-
CPU: Intel Pentium 4 3.0GHz
RAM: 2Gb non ECC
HDD x2 80 IDE in a RAID 1, 3x 300Gb SATA1 in a RAID5 on a Adaptec PCI Hardware RAID controller
Case: Antec beige tower

The choice of which Linux distribution to use was a not a decision I look lightly. In the end Ubuntu 12.04 LTS won over Centos 6.2. Both operating systems offered an awesome Enterprise OS but I am familiar with Ubuntu and already use it on my desktop and other servers.

I upgraded my firewall server a few weeks ago and since then have performed some tweaks to varnish the reverse web proxy service and now my website should load quicker and almost be slashdot proof. I think only only issue now is my lack of upload bandwidth and my ADSL router is crappy.

YouTube HTML5 Vs Flash

This is the first time I’ve done and performance tests between HTML5 and Flash. Lets see how this goes.

Firstly the computer I’m running is

The web browser I’m running is Google Chrome Version 19.0.1084.46

I watched a YouTube video http://www.youtube.com/watch?NR=1&feature=endscreen&v=iMP3PsKmcyU in 720p HD full screen
 

 

 

 

 

I watched the video in Flash v11.2.202.235 and the system resources looks as like
 I went to the url http://www.youtube.com/html5 and enabled HTML5

Watched the same video again in HTML5 and the system resources looks as like
 I was pleased by the cpu load reduction but I was very impressed by the improved picture quality.

Adobe Flash 11.2 Background Updates from an Internal Server

One major problem with Adobe Flash Player is that the software often has vulnerability which allow code to take control of a users system. The issue is gets worse by the fact most enterprise environments wont allow their users to have Administrator user rights to reduce the amount of viruses, malware and spyware installed thus not allowing the same users to install the latest version of Adobe Flash Player and leaving them with outdated versions which are vulnerable.

After GOOGLING to try and find a workable restitution I found http://helpx.adobe.com/flash-player/kb/administration-configure-auto-update-notification.html which talked about a new option in Adobe Flash Player called SilentAutoUpdate. This new option allows System administrators to push settings to Adobe Flash Player by creating a text file called mms.cfg in the users C:\Windows\System32\Macromed\Flash for Windows 32bit or C:\Windows\SysWOW64\Macromed\Flash for Windows 64bit. I’m not going to go into to much detail but I at my work I could use Group Policy to copy this file I’ve created to all my users computer to allow SilentAutoUpdate. SilentAutoUpdate works by a task in the systems Task Scheduler being created and running once a day. This task starts a service called  AdobeFlashPlayerUpdateSvc. The service program is located in the same location as the mms.cfg file called FlashPlayerUpdateService.exe. The FlashPlayerUpdateService.exe reads the mms.cfg file. To enable the SilentAutoUpdate option to log add SilentAutoUpdateVerboseLogging=1 into the mms.cfg file.

The only issue I have with the SilentAutoUpdate option is that the software must have direct access to the internet via ports 443 and 80. In some enterprise environments such as mine must access the internet via a proxy which causes the SilentAutoUpdate to fail to update.

1 way around the SilentAutoUpdate not working via a web proxy is to create an internal mirror. This can be done by following the instructions on the http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flash_player_11_2_admin_guide.pdf pages 17-19. Once creating a local mirror you can add the option SilentAutoUpdateServerDomain=server.domain.com to your mms.cfg file which tells your FlashPlayerUpdateService access the update files via your web server rather than the internet directly.

My MMS.CFG file for testing looks like this but once working I would remove the VerboseLoging option to reduce the log file size. The settings below turn off gui updates and enable silent updates:

AutoUpdateDisable=0
SilentAutoUpdateEnable=1
SilentAutoUpdateServerDomain=firewall.cloudportal.local
SilentAutoUpdateVerboseLogging=1

Then my other issue was how to I keep my mirror synced with Adobes so I created a Shell Script to do it for me in a daily cron job. The script creates the folder structure, uses wget to download the files and logs everything it does. Save the text below as adobe-flash-background-updates.sh and ensure the paths are correct before running. To run the script run the command sudo sh ./adobe-flash-background-updates.sh once you know to the script is working for you add it to cron.

#!/bin/sh

########## INTOMATION ABOUT SCRIPT ##########

# This Script Titled adobe-flash-background-updates and was written by Tyrone Wyatt of www.cloudportal.org.
# This Script is open to use by everyone and is not under any licence.
# See flash_player_11_2_admin_guide.pdf for more infomation on how this script is required to function.

########## SCRIPT CONFIG ##########

# The TITLE option is the scripts name
TITLE=adobe-flash-background-updates

# The LOG option is the log file.
LOG=/var/log/$TITLE.log

# The SOURCE option is the mirror on which you would like to download the flash files from.
SOURCE=http://fpdownload2.macromedia.com

# The DESTINATION option is where you would like your downloaded files to go so they are accessable by your web service.
DESTINATION=/var/www

# The VERSION option is the current major version of Flash Player (for Flash Player 11.2, the major version is 11).
VERSION=11

########## SCRIPT CORE ##########

touch $LOG

echo “Welcome to $TITLE Script!”
echo “=O====== $(date) ========” >> $LOG 2>&1

if [ -d $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/xml ];
then
echo ‘Skipping destination folder structure creation.’
else
echo ‘Creating destination folder structure.’
sudo mkdir -v $DESTINATION/pub/ >> $LOG 2>&1
sudo mkdir -v $DESTINATION/pub/flashplayer/ >> $LOG 2>&1
sudo mkdir -v $DESTINATION/pub/flashplayer/update/ >> $LOG 2>&1
sudo mkdir -v $DESTINATION/pub/flashplayer/update/current/ >> $LOG 2>&1
sudo mkdir -v $DESTINATION/pub/flashplayer/update/current/sau/ >> $LOG 2>&1
sudo mkdir -v $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/ >> $LOG 2>&1
sudo mkdir -v $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/xml/ >> $LOG 2>&1
sudo mkdir -v $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/install/ >> $LOG 2>&1
fi

echo ‘Downloading files…’
wget -nv $SOURCE/pub/flashplayer/update/current/sau/$VERSION/xml/version.xml -O $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/xml/version.xml >> $LOG 2>&1
wget -nv $SOURCE/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_ax_sgn.z -O $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_ax_sgn.z >> $LOG 2>&1
wget -nv $SOURCE/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_pl_sgn.z -O $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_pl_sgn.z >> $LOG 2>&1
wget -nv $SOURCE/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_64_ax_sgn.z -O $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_64_ax_sgn.z >> $LOG 2>&1
wget -nv $SOURCE/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_64_pl_sgn.z -O $DESTINATION/pub/flashplayer/update/current/sau/$VERSION/install/install_all_win_64_pl_sgn.z >> $LOG 2>&1

echo “Script complete! See log file for more infomation $LOG”
echo “=X====== $(date) ========” >> $LOG 2>&1

echo ‘ ‘ >> $LOG 2>&1

########## END OF SCRIPT ##########

I have been testing the script and am pleased to see it works well. The log file that the script creates looks much like the flashinstall.log for ease of reading.

If you require more infomation as I sometimes cut corners on documenting then you should read these other usful pages

Configuring Linux Ubuntu 10.04 LTS for APC UPS Network Shutdown

First I tried installing APC PowerChute 3.0.0 by doing the following

  1. Download Linux installer from http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=SFPCNS300&tab=software
  2. Copy pcns300Linux.tar.gz to /home/<username>. I used WinSCP.
  3. #sudo apt-get install openjdk-6-jre-headless
  4. #cd ~/
  5. #sudo tar -xvf pcns300Linux.tar.gz
  6. #cd Linux
  7. #vim install.sh
  8. search for $LINUX) and Change the next line down from /etc/SuSe-release to /etc/issue
  9. Safe file and exit vim
  10. #sudo sh ./install.sh
  11. Agree to licence agreement
  12. Leave installation path the default
  13. Enter Java path of /usr
  14. Bowser to https://<hostname>:6547/cfgwizard in your web browser and configure to your APC UPS.

But it didnt work very well at all. I had issues on my firewall server because APC PowerChute 3.0.0 uses a custom apache that runs on custom ports but on restart binded to port 80 where varnish is ment to be running! So it caused the public website to go down. I rememebered that I used to use apcupsd along time ago and gave that ago. It turns out it works!!!!

  1. #sudo apt-get install apcupsd
  2. #sudo vim /etc/apcupsd/apcupsd.conf
  3. Add these lines:
    UPSCABLE ether
    UPSTYPE pcnet
    DEVICE ipaddr:username:passphrase
  4. #sudo service apcupsd start
  5. #sudo service apcupsd status

After running the last command you should get some info from your UPS.

tyrone@corfw01:~$ sudo service apcupsd status
APC : 001,050,1266
DATE : Thu Mar 08 18:54:00 EST 2012
HOSTNAME : corfw01
VERSION : 3.14.6 (16 May 2009) debian
UPSNAME : corpus01
CABLE : Ethernet Link
MODEL : PCNET UPS Driver
UPSMODE : Stand Alone
STARTTIME: Thu Mar 08 18:53:29 EST 2012
STATUS : ONLINE
LINEV : 241.9 Volts
LOADPCT : 31.0 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 23.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
MAXLINEV : 241.9 Volts
MINLINEV : 233.2 Volts
OUTPUTV : 242.1 Volts
DWAKE : 000 Seconds
DSHUTD : 020 Seconds
DLOWBATT : 02 Minutes
LOTRANS : 168.0 Volts
HITRANS : 264.0 Volts
RETPCT : 000.0 Percent
ITEMP : 28.0 C Internal
ALARMDEL : 5 seconds
BATTV : 217.0 Volts
LINEFREQ : 50.0 Hz
LASTXFER : Unacceptable line voltage changes
NUMXFERS : 3
XONBATT : Sat Mar 10 08:12:26 EST 2012
TONBATT : 0 seconds
CUMONBATT: 20 seconds
XOFFBATT : Sat Mar 10 08:12:27 EST 2012
SELFTEST : NO
STESTI : 336
STATFLAG : 0x07000008 Status Flag
REG1 : 0x00 Register 1
REG2 : 0x00 Register 2
REG3 : 0x00 Register 3
MANDATE : 12/14/10
SERIALNO : IS123456789
BATTDATE : 12/14/10
NOMOUTV : 240 Volts
NOMBATTV : 192.0 Volts
EXTBATTS : 1
FIRMWARE : 452.18.W
APCMODEL : Smart-UPS RT 6000 RM-1
END APC : Sun Mar 11 01:28:26 EST 2012

Note that I had to change the APC network mangament 2 card’s passprase because the default passprase contains spaces.

New Server Missing 50% of RAM

So today one of the schools I support received a new server from Dell we ordered. Its fearly well spec’d with 2x quad-core 2.2Ghz Xeons, 2x 300Gb 15,000RPM SAS 4x 600Gb 15,00 RPM SAS Hard Drives and 64Gb of RAM!

I did what I normally do with any new server I receave and wipe what ever manufacture  installed and start again. So I put the Windows Server 2008 R2 DVD in the disk drive and installed as per usual. After installing I loaded into Windows and opened to the resource manager. Then a student tech asks me a question “Why goes it say that only 32Gb of RAM can be used by Windows?” Well I didn’t know what to say. I wasn’t sure why it said this. All our other servers are running no more than 24Gb and it all shows up.

I did some quick GOGGLING to find out that Server 2008 R2 Standard has a MAX memory of only 32GB! Well I was pissed off. I spent all this time installing windows to find out that during the first part of the installation I should have selected Enterprise edition not Standard like I normally would.  Oh well lesion learnt!

Adobe Announces Plans To Abandon Flash On Linux

This announcement has come as a bit of a shock to me. Adobe only recently released their first stable Linux 64bit flash plugin months ago and now this announcement that the plugin is going to be discontinued. While I am pleased that Adobes partnership with Google has meant that a 64bit flash plugin will exist on Linux for Google Chrome users such as myself. This is news is very bad for the Firefox users and Linux Distributions like Ubuntu.

I hope that Adobe wakes and a smells the roses. The Flash plugin is a thing of the past with HTML5 video and JavaScript  its replacement. Pulling stunts like this gives web designers even less reasons to use flash content.

http://blogs.adobe.com/flashplayer/2012/02/adobe-and-google-partnering-for-flash-player-on-linux.html