<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hawk Host Blog &#187; Tips</title>
	<atom:link href="http://blog.hawkhost.com/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hawkhost.com</link>
	<description>All things Hawk Host</description>
	<lastBuildDate>Tue, 02 Mar 2010 01:47:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using netcat as an intercepting proxy</title>
		<link>http://blog.hawkhost.com/2009/12/12/using-netcat-as-an-intercepting-proxy/</link>
		<comments>http://blog.hawkhost.com/2009/12/12/using-netcat-as-an-intercepting-proxy/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 20:47:11 +0000</pubDate>
		<dc:creator>Cody</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.hawkhost.com/?p=580</guid>
		<description><![CDATA[A couple of days ago I needed a way to see how a particular client was interacting with a server. Obviously there are numerous ways to do this, but I was curious how easy it would be to implement something similar with a quick netcat command. Sure enough after a little bit of fiddling I [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I needed a way to see how a particular client was interacting with a server. Obviously there are numerous ways to do this, but I was curious how easy it would be to implement something similar with a quick <a href="http://en.wikipedia.org/wiki/Netcat">netcat</a> command. Sure enough after a little bit of fiddling I was able to produce exactly what he needed.</p>
<blockquote><p>nc -l -p 12345 &lt; pipe | tee outgoing.log | nc server 12345 | tee pipe incoming.log</p></blockquote>
<p>Now this may seem a little cryptic so I&#8217;m going to dissect each portion to explain how it works. Keep in mind the &#8220;pipe&#8221; references an actual <a href="http://en.wikipedia.org/wiki/Named_pipe">pipe</a>. You can make a FIFO pipe by running &#8220;<a href="http://linux.die.net/man/3/mkfifo">mkfifo</a> pipe&#8221; or &#8220;<a href="http://linux.die.net/man/3/mknod">mknod</a> pipe p&#8221; &#8211; the former is the most usual way. If you&#8217;re not familiar with named pipes I recommend <a href="http://en.wikipedia.org/wiki/Named_pipe">reading up on them</a> before continuing with this post as you may get a little confused.</p>
<blockquote><p>nc -l -p 12345 &lt; pipe</p></blockquote>
<p>This portion simply has netcat listen on port 12345 and send anything from the pipe to the connected client. If you&#8217;re not familiar with the pipes think of it as a simple file with the word &#8220;hello&#8221; in it. When someone were to successfully connect to the netcat instance it would send the &#8220;hello&#8221; to the client.</p>
<p><span id="more-580"></span></p>
<blockquote><p>| tee outgoing.log</p></blockquote>
<p>If you&#8217;re not familiar with <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?tee">tee</a> this may seem a bit obscure. Tee prints the things piped to it to stdout as well as writing it to a file. In this instance any traffic from the connected client will get printed to stdout and to the file &#8220;outgoing.log&#8221;. An example of how this would work is if I connected to the netcat instance and simply typed &#8220;hello&#8221; it would print it out to the screen and log it to the &#8220;outgoing.log&#8221; file.</p>
<blockquote><p>| nc server 12345</p></blockquote>
<p>This is the server that you would normally want to connect to. Remember the goal is to make a quick intercepting proxy to see how the client reacts to the server. This is the server.</p>
<blockquote><p>| tee pipe incoming.log</p></blockquote>
<p>Here is where the magic happens. This completes the relay so the client and server can communicate across the proxy. What this does is takes the network traffic from the server and using tee prints it to stdout while piping it to our &#8220;pipe&#8221; and &#8220;incoming.log&#8221; files respectively.</p>
<p>Now all of this may make sense individually, though how they work together might be slightly confusing.</p>
<p>If you recall the first command sends all data from our &#8220;pipe&#8221; to the client &#8211; and at the end we pipe all data from the server to the &#8220;pipe&#8221;. See now? We&#8217;re simply taking all data the server send and sending it to the client completing the relay and allowing for normal operation.</p>
<p>Now in this case I needed this for a quick look at how a normal IRC client interacts with the server since the RFC is lacking &#8211; so here is a real world example of where this was used (though there&#8217;s likely infinite better ways to do it):</p>
<blockquote><p>nc -l -p 12345 &lt; pipe | tee outgoing.log | nc irc.freenode.net 6667 | tee pipe incoming.log</p></blockquote>
<p>You&#8217;ll notice when you execute the above command you&#8217;ll start seeing some traffic from the server instantly:</p>
<blockquote><p>NOTICE AUTH :*** Looking up your hostname&#8230;<br />
NOTICE AUTH :*** Checking ident<br />
NOTICE AUTH :*** No identd (auth) response<br />
NOTICE AUTH :*** Couldn&#8217;t look up your hostname</p></blockquote>
<p>Now we connect to the netcat server &#8211; in this case localhost on port 12345 and if everything goes as planned it should connect like normal to Freenode. If you take a peak at the netcat server you&#8217;ll see a bunch of activity!</p>
<p>The cool part is the logs &#8211; we can see exactly how this particular IRC client (IRSSI) and server (Freenode) interact.</p>
<p><a href="http://rhinoass.com/incoming.log">incoming.log</a><br />
<a href="http://rhinoass.com/outgoing.log">outgoing.log</a></p>
<p>Once again this isn&#8217;t the best way to do this &#8211; tcpdump, wireshark and infinite other choices are available. That being said it&#8217;s fun to fiddle and learn.</p>
<p>-Cody</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/12/12/using-netcat-as-an-intercepting-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Theme Performance</title>
		<link>http://blog.hawkhost.com/2009/09/24/wordpress-theme-performance/</link>
		<comments>http://blog.hawkhost.com/2009/09/24/wordpress-theme-performance/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 21:00:02 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://blog.hawkhost.com/?p=511</guid>
		<description><![CDATA[When people are looking for a wordpress theme they very rarely are looking at the performance of it.  The person is looking at how pretty the design is and if it fits their site.  There is however a lot more to it then simple the design of the wordpress.  A wordpress theme can add a [...]]]></description>
			<content:encoded><![CDATA[<p>When people are looking for a wordpress theme they very rarely are looking at the performance of it.  The person is looking at how pretty the design is and if it fits their site.  There is however a lot more to it then simple the design of the wordpress.  A wordpress theme can add a lot of extra CPU and memory usage depending on how it&#8217;s designed.</p>
<p>I&#8217;m seeing more and more where wordpress themes are not using style.css or at least .css for their style sheets.  More and more they are using style.php which in turn simply outputs the style sheet.  This sort of setup suddenly requires an extra PHP process every page load thus increased memory as well to compensate.  The fact it&#8217;s just going to output CSS still does not matter it&#8217;s really bad to be doing.  This is especially bad when a wordpress blog is running say wp-super-cache they&#8217;re probably trying to serve everything via html files.  Well that purpose is defeated when every page load PHP is loading up to serve their style sheet.  Now as to why more themes are doing this I&#8217;m not sure maybe it&#8217;s make them look more professional in the eyes of the users I have no idea.</p>
<p>Of course if you see style sheets being displayed via php you also get the same thing with java script.  All the js files become js.php with simply the javascript being output in the php file.  There is no actual using of PHP logic besides the print &#8220;js stuff&#8221;</p>
<p>There is one other problem I see quite a bit and that&#8217;s extra features included in the theme.  For example we&#8217;ve had several users use themes with phpthumb included.  The theme was using it in several places to make smaller images of portions.  Along with that they also did not configure it properly and some bots found it and started using the install to generate thumbnails for other web sites.<br />
That&#8217;s just a few examples but I would advise anyone when installing a wordpress theme take a look at what it offers and what it&#8217;s doing.  If it&#8217;s using php files everywhere you might want to see if it&#8217;s actually necessary.  If they include extra features or include third party scripts you might want to check if they even set it up properly.  I would not rely on the theme developers on these sort of things.  I&#8217;ve seen some free themes not even doing relative paths properly resulting in serving images and such via their own demo of their script.  So I really would not trust the theme maker has done a great job with the other aspects of the theme.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/09/24/wordpress-theme-performance/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>cPanel x86_64 Reseller unable to Add Packages</title>
		<link>http://blog.hawkhost.com/2009/09/14/cpanel-x86_64-reseller-unable-to-add-packages/</link>
		<comments>http://blog.hawkhost.com/2009/09/14/cpanel-x86_64-reseller-unable-to-add-packages/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 00:43:48 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=505</guid>
		<description><![CDATA[Using 64bit is really common now in fact most hosts are using this on their newer systems due to using more than 4GB of memory.  On cPanel there is a common problem that crops up with errors showing up after a while in WHM for resellers after there is quite a few accounts on the [...]]]></description>
			<content:encoded><![CDATA[<p>Using 64bit is really common now in fact most hosts are using this on their newer systems due to using more than 4GB of memory.  On cPanel there is a common problem that crops up with errors showing up after a while in WHM for resellers after there is quite a few accounts on the server.  cPanel sets the memory limit relatively low and on 64bit systems int&#8217;s and such are using more memory due to the 64bit system.  cPanel added a feature which allows you to set a maximum amount of memory used by a cPanel process before it is killed.  As a result in 64bit systems they&#8217;re more frequently hitting the modest 256MB limit while 32bit systems do not run into this issue as often.  The reseller user will receive the following error when adding a package:</p>
<blockquote><p><span>[an error occurred while processing this directive]</span></p></blockquote>
<p>The user will see this error over and over again when adding the package.  There is also an error in the cPanel error_log which I cannot remember at this point as we had a machine give this error a while back.  The thing is we know what causes it now so I did not bother checking the error_log of cPanel.  So all you need to do is go into tweak settings and find the following setting:</p>
<blockquote><p>The maximum memory a cPanel process can use before it is killed off (in megabytes). Values less than 256 megabytes can not be specified. A value of &#8220;0&#8243; will disable the memory limits.</p></blockquote>
<p>We typically set this value at 768-1024 MB on our higher end systems (12GB ram total).</p>
<p>Do not feel bad if you did not know as I honestly did not until I made a ticket with cPanel support.  Even then at the time they needed to login to figure out what was causing it.  It&#8217;s really not a well documented problem but it seems to be coming up more often now.  You probably see the same thing with other applications and even the languages themselves.  For example PHP the memory limit of 32MB is really problematic on 64bit systems which is why we use 128MB.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/09/14/cpanel-x86_64-reseller-unable-to-add-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why You Should Use WP-Super-Cache</title>
		<link>http://blog.hawkhost.com/2009/09/13/why-you-should-use-wp-super-cache/</link>
		<comments>http://blog.hawkhost.com/2009/09/13/why-you-should-use-wp-super-cache/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 19:48:02 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=502</guid>
		<description><![CDATA[At Hawk Host we deal with CPU usage issues with accounts like every other host out there.  I&#8217;ve noticed an ever growing pattern of the problems always coming from Wordpress blogs and almost always they have no caching what so ever.  When a web page is served without any caching in wordpress it will load [...]]]></description>
			<content:encoded><![CDATA[<p>At Hawk Host we deal with CPU usage issues with accounts like every other host out there.  I&#8217;ve noticed an ever growing pattern of the problems always coming from Wordpress blogs and almost always they have no caching what so ever.  When a web page is served without any caching in wordpress it will load up PHP then grab the data via MySQL.  These are both the slowest and most intensive portions of a web page.  The images, css files ect. are all served nearly instantly by the web server and it can serve a lot more of these static files per second then PHP pages.</p>
<p>This is where WP-Super-Cache comes into play what it does is when pages are served the first time it checks the caches and if they do not exist it then creates the cached file and serves it.  It has two options using rewrite rules to send users to .html versions if they&#8217;re available or to have PHP still handle it but load the PHP files instead.  How the HTML version works is the rewrite rules it inserts into the .htaccess file checks for file existence in the cache folder and if it&#8217;s there that&#8217;s where the file is served out of.  This is the ideal situation as no PHP being loaded at all means a server can handle a lot of traffic meaning even being on the frontpage of digg may very well be handled fairly easily.  There are some cases where users forget this portion so we always make sure to remind users to get the rewrite rules in.  In a lot of cases their blog goes from using a lot of resources under traffic to being a user we have no idea we&#8217;re even hosting.</p>
<p>So how do you know if the cache is working?  Well on each page if you view the HTML source you&#8217;ll see something like this:</p>
<blockquote><p>&lt;!&#8211; Dynamic page generated in 0.277 seconds. &#8211;&gt;<br />
&lt;!&#8211; Cached page generated by WP-Super-Cache on 2009-09-13 14:22:03 &#8211;&gt;</p></blockquote>
<p>You should also make sure the cache page generated time has not changed on a refresh of the page seconds later (tells you it&#8217;s broken).  So if I refresh the page again and I have made no changes to the blog I should see this again:</p>
<blockquote><p>&lt;!&#8211; Cached page generated by WP-Super-Cache on 2009-09-13 14:22:03 &#8211;&gt;</p></blockquote>
<p>This tells me the cache is working and the page was served via a html file.</p>
<p>I hope this convinces everyone who is not running WP-Super-Cache to install it now and configure it!  Especially if you&#8217;re hosting with us because eventually if your site becomes popular I&#8217;m sure you&#8217;ll hear from us about installing it to reduce your usage so that your site can scale up much better.</p>
<p>I plan on posting some more Wordpress related posts in the next few weeks regarding things I&#8217;ve noticed on blogs that decrease performance and increase resource usage.  Hopefully the tips help users who think they might not belong in a shared hosting environment to think otherwise after correcting these issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/09/13/why-you-should-use-wp-super-cache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Catch All Email</title>
		<link>http://blog.hawkhost.com/2009/08/28/catch-all-email/</link>
		<comments>http://blog.hawkhost.com/2009/08/28/catch-all-email/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 23:39:45 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=496</guid>
		<description><![CDATA[The catch all email was a great thing back in the day it was neat you could retrieve mail for sales@domain.com billing@domain.com ect. ect. all through one simple email address.  A lot of users used it without issue and it solved having to check various emails they could just tell users to email random addresses [...]]]></description>
			<content:encoded><![CDATA[<p>The catch all email was a great thing back in the day it was neat you could retrieve mail for sales@domain.com billing@domain.com ect. ect. all through one simple email address.  A lot of users used it without issue and it solved having to check various emails they could just tell users to email random addresses and it would arrive at it&#8217;s spot.  Fast forward to now and the large amounts of mail received by pretty much any domain on the internet and this once cool feature is now a major headache for us as well as any other hosting provider.</p>
<p>With the rise of spam and users no longer displaying their emails on sites the spam bots have become much smarter.  It&#8217;s no longer use email addresses found on web sites and only use them.  The spam bots now send mail to jimmy@domain.com, johnny@domain.com, susan@domain.com ect. ect.  As a result of this a simple spam email could become a mail bomb of thousands of emails hitting a single email account thus putting extreme strain on the server as well as quickly filling a users mail box.  So a lot of users stopped using this feature in favor of forwarders for the specific email accounts so it&#8217;s been less of a problem.  Of course some users still use this feature until they get hit by mail bomb and they end up switching out as it&#8217;s impossible to manage their own mail anymore.</p>
<p>Even with this no longer being a preferred feature of users we still run into problems with people having the default/catch all set to their accounts username.  We by default have this set to fail rather than catch the mail unfortunately by cPanel last I checked the default was catch-all.  The majority of web hosts do not do a great job with managing their servers so they have it set to catch all.  When we have to restore a users account from another server we inherit the ugly catch all that was setup.  So we get to deal with the spam and mail the user receives to any possible email address to their domain.</p>
<p>Now you might be saying well doesn&#8217;t spam help prevent all this mail?  It does but it cannot stop it all and it also slows down a server.  The mail portion on a server is one of the most intensive portions due to just the volume of mail coming in every day.  This is why a lot of providers have suggested to their users use services like google apps or have outside mail servers.  They are attempting to off load one of the most expensive things on their servers which is mail.  Now add in the fact the mail includes spam from every possible email address for a domain and it becomes much more of a problem.  So us using spam blocking techniques do not solve the issues they just help the user while we still need to process the mail going through our spam checker system then if the spam count is high enough getting thrown away.  Also spam blocking systems do not come near effective at blocking everything without blocking a lot of legitimate mail in the process.</p>
<p>All the CPU usage from the mail does not factor in the pure amount of mail you will receive when you have a default mail address set to say the username of your account.  We&#8217;ve had users move from another host and it&#8217;s enabled and they do not check the default email address.  A few years later and they&#8217;ve hit their quota as their default mail address is 2GB of mail or more.  So it can fill a users quota up pretty easily if left unchecked for a long time which is usually the case since the user is not aware it&#8217;s even enabled.</p>
<p>So the only solution here is to say no to the catch all email feature.  If you&#8217;ve never checked it out in cPanel I suggest visiting the &#8220;Default Address&#8221; feature in cPanel and making sure it is set to &#8220;Discard with error to sender (at SMTP time)&#8221;.  A lot of hosts do not have this set so if you came from another host it&#8217;s probably not set to fail on a non existent email address.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/08/28/catch-all-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVZ Apache mpm_worker Memory Issues</title>
		<link>http://blog.hawkhost.com/2009/08/01/openvz-apache-mpm_worker-memory-issues/</link>
		<comments>http://blog.hawkhost.com/2009/08/01/openvz-apache-mpm_worker-memory-issues/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 00:51:26 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=479</guid>
		<description><![CDATA[A lot of users look to run Apache&#8217;s mpm_worker rather than the prefork mpm as it&#8217;s regarded to be much more efficient than the perfork mpm.  Add in FastCGI rather than mod_php and it&#8217;s a great combination of stability as well as performance.  Unfortunately there is one issue with running this on OpenVZ and that [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of users look to run Apache&#8217;s mpm_worker rather than the prefork mpm as it&#8217;s regarded to be much more efficient than the perfork mpm.  Add in FastCGI rather than mod_php and it&#8217;s a great combination of stability as well as performance.  Unfortunately there is one issue with running this on OpenVZ and that is the stack size.  Even the modest VPS with very little traffic will end up using it&#8217;s allowed memory as well as it&#8217;s burst memory.  Many suggest just not running mpm_worker with OpenVZ but this is not the best solution.  The problem has to do with the default thread stack size of 8MB which with OpenVZ becomes real memory rather than simply virtual that will not actually be used by the system unless necessary.  There are several easy fixes for this:</p>
<p>The first one is to modify the init.d script of Apache to reduce the stack size.  So for a cPanel system it&#8217;ll be located at /etc/init.d/httpd and you&#8217;ll want to add the following:</p>
<blockquote><p>ulimit -s 256</p></blockquote>
<p>This will make the stack size just 256KB which will suffice for most users.  I prefer to just do this with Apache but if you like you could modify this globally by changing /etc/security/limits.conf or for all services you could change /etc/init.d/rc .  I believe though the best action is to just change Apache until you run into an issue with another service having the same issue.  As you may not want just 256 but higher for a specific service or the defaults are fine in other cases and lower may reduce performance.</p>
<p>Well I hope that helps everyone out to get the performance of mpm_worker while not having to deal with the memory issues with regards to the default stack size.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/08/01/openvz-apache-mpm_worker-memory-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SoftLayer Network Tips</title>
		<link>http://blog.hawkhost.com/2009/07/07/softlayer-network-tips/</link>
		<comments>http://blog.hawkhost.com/2009/07/07/softlayer-network-tips/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 20:25:17 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=467</guid>
		<description><![CDATA[We&#8217;ve been a softlayer customer for a long time and we have quite a few machines with them at this point and we have people once in a while asking how in the world do we do what we do at softlayer.  Some examples are routing our IP&#8217;s on a VLAN and having ranges on [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been a softlayer customer for a long time and we have quite a few machines with them at this point and we have people once in a while asking how in the world do we do what we do at softlayer.  Some examples are routing our IP&#8217;s on a VLAN and having ranges on various machines and quickly routing them across different servers.  Another common one is how do we route private network IP&#8217;s to our VPS plans giving a user the potential to use say NAS.   I&#8217;m going to quickly go through them for anyone curious</p>
<p><strong>VLAN Routed IP&#8217;s</strong></p>
<p>VLAN routed IP&#8217;s most believe are only useful for virtual private servers where you can use IP pool features to spread a range across numerous servers.  This is untrue as we actually have every single IP routed to our VLAN&#8217;s to make it possible to share ranges among servers.  That&#8217;s actually easy to do you just need to use the right netmask on the IP&#8217;s so a 32 IP range is a 255.255.255.224 for example.  You can use the site <a href="http://grox.net/utils/whatmask/">http://grox.net/utils/whatmask/</a> to quickly calculate this for you if you&#8217;re unsure so say you were given 1.2.3.4/28 255.255.255.240.  So for each IP you add or a range you add specify the netmask as otherwise you can cause some very strange routing later on when re-routing IP&#8217;s.</p>
<p>So the second portion is I have 1.2.3.4 on Machine1 and I want to route it to Machine2 this is very easy to do.  You want to add 1.2.3.4 to Machine2 then arp the IP to the new server.  I prefer to remove it from the old server as well before doing the arp as I don&#8217;t want to cause any confusion but it may not be necessary I just prefer to be safe than sorry in case it causing routing issues of the range.  So to re-route the 1.2.3.4 with the gateway 4.3.2.1 you&#8217;d run the following command on Machine2 in SSH:</p>
<blockquote><p>arping -A -s 1.2.3.4 -I eth1 4.3.2.1</p></blockquote>
<p>Obviously you&#8217;d change 1.2.3.4 with your IP and 4.3.2.1 with the gateway of your VLAN.  In the SoftLayer panel you can find the gateway of your VLAN by going to any IP and looking for the server address and below that it lists the gateway of the VLAN.  It is also worth noting with this setup you lose the use of 3 IP&#8217;s so I recommend your minimum IP range is 32 IP&#8217;s and you also obviously need softlayers VLAN routed IP&#8217;s.  In the Softlayer IP manager it also tells you which IP&#8217;s are not usable so it&#8217;s pretty self explanatory there.</p>
<p><strong>Private IP&#8217;s on VPS</strong></p>
<p>We also give each VPS it&#8217;s own private IP so they have access to Softlayer tools such as the resolvers but we could expand this out to NAS, iSCSI ect.  There are several topics going around on how to do it in OpenVZ but we&#8217;ve found the easiest solution is just one command on the VPS and it does not even care where the private IP is on the VPS&#8217;s ip list.  The first thing to do this is you need VLAN routed private IP&#8217;s which you should have if you have a public IP set.  Add one private IP to the VPS which is it no in use then login to the VPS in question.  We&#8217;ll say the private ip is 10.10.10.10 in this case and we&#8217;ll need to run the following command:</p>
<blockquote><p>ip r a 10.0.0.0/8 dev venet0 scope link src 10.10.10.10</p></blockquote>
<p>Now you can ping 10.0.80.11 and you&#8217;ll notice it now responds to pings!  You can also receive 10.x.x.x traffic from any IP and also send it to any this includes VPS&#8217;s (might be useful to some).  Just so this is automatically ran you can add it to /etc/rc.local or someway so it automatically executes this.  There might be a way to do this without modifying the VPS it self but I have yet to find one so if anyone knows feel free to add a comment about it.</p>
<p>So I hope this helps some how or maybe if you have a better way of doing either of these feel free to post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/07/07/softlayer-network-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Load Balancing &amp; VPS (Part 1, Perlbal)</title>
		<link>http://blog.hawkhost.com/2009/05/24/software-load-balancing-vps-part-1-perlbal/</link>
		<comments>http://blog.hawkhost.com/2009/05/24/software-load-balancing-vps-part-1-perlbal/#comments</comments>
		<pubDate>Sun, 24 May 2009 22:11:53 +0000</pubDate>
		<dc:creator>Cody</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[perlbal]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=377</guid>
		<description><![CDATA[This is just going to be a quick overview of some common methods of load balancing your web services via software load balancers. This post will have several parts, each covering different software load balancers. This particular part we will be covering Perlbal.
In this post I&#8217;ll be using two different VPS accounts as an example [...]]]></description>
			<content:encoded><![CDATA[<p>This is just going to be a quick overview of some common methods of load balancing your web services via software load balancers. This post will have several parts, each covering different software load balancers. This particular part we will be covering <a title="Perlbal " href="http://www.danga.com/perlbal/" target="_blank">Perlbal</a>.</p>
<p>In this post I&#8217;ll be using two different <a title="VPS Compare" href="http://www.hawkhost.com/VPS/compare" target="_blank">VPS</a> accounts as an example since we will need to spread the load across something. I&#8217;ll be referencing them as VPS1 and VPS2. In the examples they will be running Ubuntu, though most of the tutorial can be applied to any distribution. One thing to note is I&#8217;ll be using <a href="http://en.wikipedia.org/wiki/Aptitude_debian" target="_blank">Aptitude</a> for package management which is fairly specific to Debian based distributions. Usually <a href="http://en.wikipedia.org/wiki/Yellow_dog_Updater,_Modified" target="_blank">Yum</a> will be your alternative &#8211; and in the worse case scenario you will have to compile the packages manually.</p>
<h3><span style="text-decoration: underline;">What is Perlbal?</span></h3>
<blockquote><p>Perlbal is a single-threaded event-based server supporting HTTP load balancing, web serving, and a mix of the two.</p></blockquote>
<p>Perlbal is a software load balancer created by <a href="http://www.danga.com/perlbal/" target="_blank">Danga Interactive</a> for the use on LiveJournal, Typepad, and other ventures. It&#8217;s a lightweight reverse proxy that has the ability to serve as a web server, though that is out of the scope of this post.</p>
<h3><span style="text-decoration: underline;">What is a &#8220;reverse proxy&#8221;?</span></h3>
<p>According to <a title="Reverse Proxy" href="http://en.wikipedia.org/wiki/Reverse_proxy" target="_blank">Wikipedia</a> a reverse proxy is:</p>
<blockquote><p>A reverse proxy or surrogate is a proxy server that is installed in a server network. Typically, reverse proxies are used in front of Web servers. All connections coming from the Internet addressed to one of the Web servers are routed through the proxy server, which may either deal with the request itself or pass the request wholly or partially to the main web servers.</p></blockquote>
<p>I believe this description is very fitting &#8211; it&#8217;s essentially a &#8220;middle man&#8221; for a request (in this case HTTP request) that decides where it should be routed to. This could mean simply deciding to put it on VPS1, or VPS2 &#8211; or it could mean if the HTTP request is for an image we&#8217;ll send it to <a href="http://www.lighttpd.net/" target="_blank">Lighty</a>, and if it&#8217;s a normal request to a PHP page we&#8217;ll send it to Apache. Think of it as a &#8220;router&#8221; in the literal sense.</p>
<h3><span style="text-decoration: underline;">Why is it useful?</span></h3>
<p>I&#8217;ll give two simple scenario&#8217;s to try and explain the useflness of reverse proxies:</p>
<h4>Scenario 1</h4>
<p>You&#8217;re serving 100 requests/second and are running out of memory on your server &#8211; you notice that a good 80% of the requests are simply for static files, such as images and stylesheets &#8211; unfortunately Apache still takes a large amount of memory / CPU for these requests causing you to exhaust your resources. One way you could reduce the usage is simply setting up an alternative web server such as Lighty that has a lighter footprint to serve your static files, and keep Apache for the requests serving your application.</p>
<h4>Scenario 2</h4>
<p>We&#8217;ll also use the example of serving 100 requests/second &#8211; but let&#8217;s just say your server simply can&#8217;t handle the traffic. You could setup another server identical to your current one, and have the reverse proxy listen for incoming requests and it will direct the traffic to both servers seemlessly &#8211; allowing you to split the resources across the board and maintaining a fast / stable website.</p>
<p>These examples may have some flaws, though they&#8217;re simply here to illustrate common uses / the benefits of using a reverse proxy (or software load balancer).</p>
<h3><span style="text-decoration: underline;">First things first</span></h3>
<p>First you need to find where your bottleneck is in your application. Is it the web server or is it the database server? Could it simply be slow SQL queries that could be fixed by adding a index? Ultimately you want to make sure that your application is optimized as much as possible &#8211; and make sure the bottleneck can&#8217;t simply be fixed by a few tweaks.</p>
<h3><span style="text-decoration: underline;">How do I setup the environment described in Scenario 1?</span></h3>
<p>In this setup we&#8217;re going to use Apache to serve all HTTP requests relating to PHP &#8211; or your application, and use Lighty to serve static files such as images. The goal here is to use Lighty because of its low footprint to serve static files such as images and to lower the overall usage of your server.</p>
<h4>1) Getting the packages</h4>
<p>You will need the following packages:</p>
<ul>
<li>Apache  (setup for PHP)</li>
<li>Lighttpd</li>
<li>Perlbal</li>
</ul>
<p>In Ubuntu each of these should be in the repositories, so you can install them with via Aptitude:</p>
<blockquote><p>aptitude install apache2 lighttpd perlbal -y</p></blockquote>
<p>I believe most package repositories have Apache and Lighttpd, though Perlbal could be a hit or miss. Luckily Perlbal is in CPAN so you can install it fairly easily:</p>
<blockquote><p>perl -MCPAN -e &#8216;install perlbal&#8217;</p></blockquote>
<h4>2) Setting up Apache, Lighttpd</h4>
<p>Once you&#8217;ve installed the packages you will need to configure both of the webservers to listen on a port other than port 80. The reason for this is Perlbal will  be listening on port 80 and deciding what to do with the requests. In this example I will have Apache listen on port 8080, and Lighty listening on port 8181:</p>
<p>Apache2 Configuration:</p>
<blockquote><p>Listen 8080</p></blockquote>
<p>It&#8217;s up to you to configure Apache completely, the point here is to simply have it listen on port 8080 instead of 80.</p>
<p>Lighttpd Configuration:</p>
<blockquote><p>server.port = 8181</p></blockquote>
<p>Once again it&#8217;s up to you to configure Lighty, we&#8217;re just having it listen on port 8181 instead of 80.</p>
<h4>3) Setting up Perlbal</h4>
<p>Now we have to setup Perlbal to handle the request. What we are going to do is have every request that is going to the subdomain &#8220;static.domain.com&#8221; be served via Lighttpd, and everything else via Apache. A quick note before we begin &#8211; Perlbal is capable of serving files, so Lighttpd is not required. I&#8217;m simply using it to illustrate how one would go about doing it.</p>
<p>Perlbal configuration:</p>
<blockquote><p>load Vhosts</p>
<p>CREATE SERVICE select<br />
SET listen = 127.0.0.1:80<br />
SET roles = selector<br />
SET plugins = vhosts</p>
<p>VHOST *.domain.com = apache_server<br />
VHOST static.domain.com = lightttpd_server<br />
ENABLE select</p>
<p>CREATE POOL apache_server<br />
POOL apache_server ADD 127.0.0.1:8080<br />
ENABLE apache_server</p>
<p>CREATE POOL lighttpd_server<br />
POOL lighttpd_server ADD 127.0.0.1:8181<br />
ENABLE lighttpd_server</p></blockquote>
<p>In a nutshell this configuration does three important things &#8211; it tells Perlbal to listen on port 80 so it can accept the normal HTTP requests, it then says any request going to &#8220;*.domain.com&#8221; will be sent to our Apache instance, and anything going to &#8220;static.domain.com&#8221; go to our Lighty instance. For more information on Perlbals configuration please check out their documentation &amp; mailing list.</p>
<h4>4) Start everything up</h4>
<p>Now we simply need to start up our web servers and Perlbal accordingly:</p>
<blockquote><p>/etc/init.d/apache2 start<br />
/etc/init.d/lighttpd start<br />
/etc/init.d/perlbal start</p></blockquote>
<h4>5) See if it works</h4>
<p>Last but not least we need to make sure everything works. Simply visit &#8220;domain.com&#8221; and make sure it loads accordingly, then visit &#8220;static.domain.com&#8221; and verify that loads. If both load fine it should be working &#8211; if you want to make sure you can take a peak in the logs to see incoming requests (/var/log/apache2/* , /var/log/lighttpd/*).</p>
<h3><span style="text-decoration: underline;">How do I setup the environment described in Scenario2?</span></h3>
<p>In this setup we&#8217;re simply going to split the requests across two VPS servers. One of the VPS instances will house the Perlbal instance as well as the web server, and the other VPS will simpy house another web server.</p>
<h4>1) Getting the packages</h4>
<p>I&#8217;m going to assume you already have a web server of your choice setup on  both VPS1 and VPS2. All you will need to download is Perlbal:</p>
<p>On Ubuntu:</p>
<blockquote><p>aptitude install perlbal -y</p></blockquote>
<p>or installing Perlbal via CPAN:</p>
<blockquote><p>perl -MCPAN -e &#8216;install perlbal&#8217;</p></blockquote>
<h4>2) Configuring the web server</h4>
<p>The only configuration required on the web server is simply changing what port it is listening on. Keep in mind you only have to do this if Perlbal is sharing the same system as a web server &#8211; if you&#8217;ve decided to give Perlbal its own environment this is not necessary. In these examples I&#8217;ll assume you changed the web servers to listen on port 8080.</p>
<h4>3) Configuring Perlbal</h4>
<p>Now we have to setup Perlbal to listen on port 80 and direct the requests among VPS1 and VPS2</p>
<p>Perlbal Configuration:</p>
<blockquote><p>CREATE POOL web_servers<br />
POOL web_servers ADD 1.2.3.4:8080<br />
POOL web_servers ADD 1.2.3.5:8080</p>
<p>CREATE SERVICE balancer<br />
SET listen = 0.0.0.0:80<br />
SET role = reverse_proxy<br />
SET pool = web_servers<br />
SET persist_client = on<br />
SET persist_backend = on<br />
SET verify_backend = on<br />
SET balance_method = random<br />
ENABLE balancer</p></blockquote>
<p>Though the configuration is fairly self explanatory &#8211; we&#8217;re creating a &#8220;pool&#8221; and adding our web servers to it. We then create a &#8220;service&#8221; for Perlbal saying we want it to listen on port 80 and act as a reverse proxy. We also tell it to use the pool we just created. The other options you don&#8217;t need to worry about too much &#8211; though the &#8220;balance_method&#8221; option you have two choices: random and round-robin. The differences between them should be fairly obvious &#8211; random will choose a random server out of the pool while round-robin will go through each of the servers in the pool in a more orderly manner.</p>
<h4>4) Start Perlbal</h4>
<p>Now all you have to do is start perlbal:</p>
<blockquote><p>/etc/init.d/perlbal start</p></blockquote>
<h4>5) See if it works</h4>
<p>Simply visit your domain and see if the page loads &#8211; you can refresh a few times to make sure that it&#8217;s hitting both servers and both servers are responding accordingly. Once again you may want to check your web servers logs to verify it&#8217;s getting the requests.</p>
<p>This post is meant to be only a primer and not used in a production environment. I understand there are some principles I either skimmed over or completely omitted. This post was done solely off of memory and past experiences &#8211; so please be careful if you try to use a setup similar to the ones outlined in this post. If you come across any errors please let me know so I can fix them.</p>
<h3><span style="text-decoration: underline;">Some other similar topics I&#8217;ll try to cover in future posts:</span></h3>
<ul>
<li>Setup software load balancing using <a title="Haproxy" href="http://haproxy.1wt.eu/" target="_blank">HAProxy</a></li>
<li>Setup software load balancing using <a href="http://sysoev.ru/nginx/" target="_blank">NGINX</a></li>
<li>Setup software load balancing using <a href="http://www.apsis.ch/pound/" target="_blank">Pound</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/05/24/software-load-balancing-vps-part-1-perlbal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Few Cause Problems for the Majority</title>
		<link>http://blog.hawkhost.com/2009/04/08/the-few-cause-problems-for-the-majority/</link>
		<comments>http://blog.hawkhost.com/2009/04/08/the-few-cause-problems-for-the-majority/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 02:34:33 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=345</guid>
		<description><![CDATA[The one thing with web hosting no matter who your market is there are a few users who cause problems for the majority of the user base.  That&#8217;s whether you&#8217;re selling 10000GB of space or 1GB of space there will be users who do things that are not advised.  We at Hawk Host deal with [...]]]></description>
			<content:encoded><![CDATA[<p>The one thing with web hosting no matter who your market is there are a few users who cause problems for the majority of the user base.  That&#8217;s whether you&#8217;re selling 10000GB of space or 1GB of space there will be users who do things that are not advised.  We at Hawk Host deal with these and it&#8217;s growing on a daily basis how many warning emails we&#8217;re sending out or users with active tickets we&#8217;re working on resolving the problems they&#8217;re causing.  These always revolve around poorly made PHP scripts, poor MySQL queries or large amounts of traffic that is not traffic worth having.  I figured I&#8217;d share a few of the most recent ones I&#8217;ve personally had to deal with in hopes that other users will not go making the same mistakes.</p>
<p><strong>Poorly Made Wordpress Plugin</strong></p>
<p>There is a wordpress plugin that when activated causes large amounts of strain on MySQL servers.  This is so bad it&#8217;s even bad on a dedicated server due to the nature of the plugin.  I believe it has to do with some sort of rss reader system and the ranking of posts but I am not entirely sure.  It does not sound bad yet but in every case we&#8217;ve had to warn or disable user accounts performing queries that generate millions of rows only to limit them to just a few displayed which is the sure sign of a poorly made query.  Some cases the user does not even realize it but with the plugin enabled their site was taking 10-15 seconds to load but they just sort of shrugged it off!  It was probably hurting their traffic significantly due to the page load times thanks to the query that even on an empty server would take 10-15 seconds to run!</p>
<p><strong>The Chat Script</strong></p>
<p>There was a web site recently that had a chat system right on the front page of their website available to their users.  This was a flash based system querying the server constantly.  It was causing a small site to generate hundreds of thousands of page views a day.  This meant constant php processes running and constant mysql queries to have the chat system to run.  It did not affect their page loads but it sure made a big red warning sign on our end to why in the world is a site using a large amount of the resources.  This was the most recent case but we deal with people all the time putting up chat systems on their sites that throws the users straight into the chat.  It&#8217;s just a recipe for disaster and in most cases once the users realize they disable it.  The few say we will host it elsewhere and our site and move and we just sort of shrug as someone using 10% of one of our servers is like a small dedicated server somewhere else.  It&#8217;s just not something we could afford to give someone or frankly any shared host could do for $10/month or whatever low price the user would be paying.  The most frusterating part about these is we clearly state we do not allow chat systems of any kind on our servers.</p>
<p><strong>The Shoutbox</strong></p>
<p>The one we deal with the most is the shout box which is basically a constant refreshing chat system. A user throws it on every page of their forum and turns that 1000 visitors a day into 100,000 page views. As their site grows it becomes more and more obvious to us what they&#8217;re doing and we end up asking them to remove it.  We point to our acceptable use policy about not allowing them and explain how little gain the shoutbox provides.  The cost to run one outweighs it&#8217;s gain and most agree but a few will disagree and believe 100,000 page views to PHP+MySQL is reasonable for every 1000 real visitors per day.  We never attempt to retain them as they cost us more than they&#8217;re worth having and it only gets worse and their visitor count climbs.</p>
<p><strong>The Wordpress Skin</strong></p>
<p>We&#8217;ve seen a growing trend of users sign up with us and they provide wordpress skins.  The scary part is just how many have not heard of relative links.  In some cases we&#8217;re used as an image host as all the skins images are accessed via http://thersite.com/skin/wp-content/images/myimage.png rather than the relative link so it would use the users server to display the image.  They are worse though some will have PHP code in their skin which will generate a side bar and rather than using a relative include they do &lt;?php include(&#8220;http://theirsite.com/skin/sidebar.php&#8221;);  ?&gt; Or using file_get_contents or something along those lines so that we are used to generate some sort of sidebar.  Now the most startling one I&#8217;ve seen thus far is one offering the ability to generate thumbnails in their skin.  Cool feature except they did not use the relative thumbnail generator url but rather their site&#8217;s url to do it.  As a result we were now acting as the thumbnail generator for various web sites images which is intensive and doing it a few hundred thousand times a day can really bog down a server and make a site use a lot of resources.  A very simple fix in every case except for the sites already using the older versions of the skins.</p>
<p>These are just a few of the common situations we run into constantly.  A very frusterating problem as most users never realize what they&#8217;re doing is a bad idea.  In some cases they do not even understand the problem making it impossible for us to even help.  Those cases they may very well just cancel over it and go to the next host with the same problem and repeat the cycle.  I figured I&#8217;d share a few of the many situations we deal with frequently.  These few users cause almost all our problems and if we were to have some automatic system to find all these trouble makers it would save us a lot of time.  That&#8217;ll never happen though as it&#8217;s a tough thing to allow normal amounts of traffic and just the odd intensive thing through while stopping these bad ones that crop up on machines.  There are hosts who have some systems in place but they shut down high traffic sites to so they base it off of the number of CPU cycles in x amount of time and the visitors get this nasty message.  Those would not solve our problems so they&#8217;re not an option and we continue to just look at resources being used on machines on a general overview and when a site is using an abnormal amount we contact them.  It would just be great if we could somehow know what a user would run 6 months down the road and tell them it&#8217;s not going to work.  I&#8217;m just dreaming though that&#8217;s mind reading <img src='http://blog.hawkhost.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/04/08/the-few-cause-problems-for-the-majority/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Multivariate Testing</title>
		<link>http://blog.hawkhost.com/2009/03/22/multivariate-testing/</link>
		<comments>http://blog.hawkhost.com/2009/03/22/multivariate-testing/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 04:54:23 +0000</pubDate>
		<dc:creator>Cody</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[HawkHost]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[multivariate testing]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=316</guid>
		<description><![CDATA[**WARNING**
The formatting on this post is lackluster &#8211; once again who am I to fight against the ways of WordPress? Hopefully the point / useful information gets across. I haven&#8217;t checked the spelling in this post either &#8211; so don&#8217;t kill me if you find a typo.
I&#8217;ve recently been fiddling around with multivariate testing on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>**WARNING**</strong><br />
The formatting on this post is lackluster &#8211; once again who am I to fight against the ways of WordPress? Hopefully the point / useful information gets across. I haven&#8217;t checked the spelling in this post either &#8211; so don&#8217;t kill me if you find a typo.</p>
<p>I&#8217;ve recently been fiddling around with <a href="http://en.wikipedia.org/wiki/Multivariate_testing" target="_blank">multivariate testing</a> on several websites I run (including Hawk Host) and I though it may prove to be a useful blog post for our customers. Here I&#8217;ll explain how to setup multi-variant testing using <a href="http://www.google.com/websiteoptimizer" target="_blank">Google Site Optimizer</a> and a simple web page (though you can apply it to any page / website).</p>
<h2>Step One</h2>
<p>After signing up for <a href="http://www.google.com/websiteoptimizer" target="_blank">Google Site Optimizer</a> sit down and decide on which portions of your website / webpage you want to subject to testing. Usually this is something like the a header, image, description or something along those lines. For example I&#8217;m currently utilizing it for Hawk Host on the tabbed content section.</p>
<h2>Step Two</h2>
<p>Once you&#8217;ve decided what you want to subject to testing on your website select &#8220;Create Experiment&#8221; on Google Site Optimizer. You will be prompted with two options: <a href="http://en.wikipedia.org/wiki/A/B_testing" target="_blank">A/B Testing</a> &amp; Multivariate Testing. Select the latter. You will be prompted with a brief introduction to selecting which portions of your website you want to subject to testing (same as I said above) &#8211; scroll to the bottom of the page and select the check box and hit &#8220;Create&#8221;.</p>
<h2>Step Three</h2>
<p>You will now be asked to provide three URL&#8217;s:</p>
<ol>
<li><strong>Name Your Experiment</strong><br />
<span style="margin-left:15px;">This is an internal name for your experiment. Name it anything you like.</span></li>
<li><strong>Identify Your Test Page</strong><br />
<span style="margin-left:15px;">This will be the URL to the page you&#8217;re testing. In Hawk Host&#8217;s case it&#8217;s the main page, or www.hawkhost.com</span></li>
<li><strong>Identify Your Conversion Page</strong><br />
<span style="margin-left:15px;">This will help you identify which variants are converting &#8211; usually this will be your shopping cart success page or the page you want the visitor to end up on (a sales page, etc)</span></li>
</ol>
<p>Once you&#8217;ve filled out the prospective fields hit &#8220;Continue&#8221;. You will be prompted with two radio buttons asking if your team will be installing the JavaScript code or if you will be. Depending on your situation select the appropriate option (usually the latter one).</p>
<h2>Step Four</h2>
<p>Here&#8217;s where we get nerdy. You will be presented with four sections of JavaScript to add to your webpage, each are very important so don&#8217;t skip any.</p>
<ol>
<li><strong>Control Script</strong><br />
<span style="margin-left:15px;">You will put this right after your beginning &lt;head&gt; tag. This just adds Googles JavaScript functions to help identify the sections you&#8217;re testing.</span></li>
<li><strong>Tracking Script</strong><br />
<span style="margin-left:15px;">Paste this right before your closing body tag (&lt;/body&gt;). This chunk of code adds Google&#8217;s tracking to your web page to provide detailed stats on which variants are being displayed, converted, etc.</span></li>
<li><strong>Page Selections</strong><br />
<span style="margin-left:15px;">Use the example they provide for you and paste the code they provide right before the portion you want to be a variant. Here are some examples:</p>
<p><code><br />
&lt;script&gt;utmx_section("heading")&lt;/script&gt;<br />
&lt;h1>Test heading&lt;/h1&gt;<br />
&lt;/noscript&gt;</p>
<p>&lt;script>utmx_section("content")&lt;/script&gt;<br />
&lt;p&gt;Test content&lt;/p&gt;<br />
&lt;/noscript&gt;<br />
</code></p>
<p>In these examples the portion directly following the <em>utmx_section</em> code is the <em>default</em> content. Usually this is what you currently have on your website. The variants are handled on Google&#8217;s end.</span></li>
<li><strong>Conversion Script</strong><br />
<span style="margin-left:15px;">This portion of code will goes to the page where you want the visitor to end up. Usually this is a &#8220;Thank you&#8221; page after purchasing an item or something of that nature. Paste this on that page (ideally near the bottom).</span></li>
</ol>
<p>Once you&#8217;ve done that select &#8220;Validate&#8221; &#8211; this will attempt to validate that the scripts are properly installed. Don&#8217;t be concerned if the conversion portion fails &#8211; depending on the software you&#8217;re utilizing for your website you may not be able to confirm the code directly (EX: success page after purchasing an item). Select &#8220;Continue&#8221; if everything passes the validation.</p>
<h2>Step Five</h2>
<p>You will now be prompted with an area to create your variants. You will notice all of the sections you created now show up on the left. Simply select &#8220;Add new variation&#8221; under the section you want to create a new variant. It will bring up a little text box with the default HTML code for your default value. From here modify it however you see fit &#8211; once you&#8217;re finished (make sure to preview it!) select &#8220;Save&#8221;. Go and do this for every section &#8211; but don&#8217;t add too many variations for each section. Unless you have a large amount of traffic you won&#8217;t get enough statistics on each permutation and will end up with worthless stats. Google recommends no more than 3 variations per section (we personally use 5~ per section on Hawk Host).</p>
<p>Once you&#8217;ve finished select &#8220;Continue&#8221;</p>
<h2>Step Six</h2>
<p>You will be brought to a page with a summary of your experiment. The most important thing on this page is deciding how much traffic you want to send to the experiment. If you select 100% that means everyone visiting your webpage will be subject to the variating content. If you select 50% only half of the visitors will be subject to the variating content, the other half will see the default content. We personally use 100% the majority of the time depending on how drastic the content change is. Use your discretion here.</p>
<p>Once you&#8217;ve finished with that select &#8220;Launch Now&#8221;</p>
<h2>Step Seven</h2>
<p>Wait! Wait several weeks to gather enough statistics &#8211; Google will provide you with in-depth stats on which combinations are being displayed, which are converting, and if possible it will tell you which seem to be converting on a regular basis. Using this information you should be able to find tune your website to convert as much as possible (based on design at least).</p>
<p>I hope this was useful to someone &#8211; I&#8217;ll try to clean this post up a bit over the next week or so, though feel free to ask any questions you may have in the comments. I&#8217;ll add image in the next couple of days to help clarify the steps mentioned.</p>
<p>Until next time,<br />
Cody</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/03/22/multivariate-testing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
