<?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>Dan Myers &#187; Magento</title>
	<atom:link href="http://www.danmyers.name/wp/category/magento/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danmyers.name/wp</link>
	<description>PHP, ActionScript, TorqueScript, Frameworks</description>
	<lastBuildDate>Fri, 27 Aug 2010 12:11:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Integrating Fed Ex Ship Manager with Magento</title>
		<link>http://www.danmyers.name/wp/2009/12/integrating-fed-ex-ship-manager-with-magento/</link>
		<comments>http://www.danmyers.name/wp/2009/12/integrating-fed-ex-ship-manager-with-magento/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 21:49:19 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.danmyers.name/wp/?p=140</guid>
		<description><![CDATA[If you&#8217;ve ever wanted to get your shipping a bit more automated, look no further than the good folks on the Magento community forums. &#8220;mjohnsonperl&#8221; was good enough to write an article on how to do just that, using FedEx Ship Manager. I&#8217;ve added some code to his original query to bring the ship method [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever wanted to get your shipping a bit more automated, look no further than the good folks on the Magento community forums.  &#8220;mjohnsonperl&#8221; was good enough to write an article on how to do just that, using FedEx Ship Manager.  I&#8217;ve added some code to his original query to bring the ship method over to Ship Manager as well.  Below is the complete, modified query.</p>
<p>BTW, if you&#8217;ve ever tried to write/modify a query for a database built using EAV data modeling&#8230; well, you get to be friends with Jack Daniels really fast, because that&#8217;s the only way to understand the data when looking at ad hoc queries. Thank goodness for Morphine&#8230; the band. Look them up in iTunes.</p>
<p><a href="http://www.magentocommerce.com/wiki/groups/207/fedex_ship_manager_configuration">Original FedEx Ship Manager Article</a></p>
<p><a href="http://www.magentocommerce.com/wiki/groups/207/fedex_-_shipping_view">Original MySQL View for Ship Manager</a></p>
<pre class="brush: plain;">
create view vi_sales_order_shipping as
select   so.increment_id as 'order_no',
        (    select xsov.value
            from sales_order_varchar xsov
            inner join eav_attribute xea on xsov.attribute_id = xea.attribute_id
            where    xsov.entity_id = so.entity_id and
                    xea.attribute_code = 'customer_email'
        ) as 'customer_email',

        /* --- SHIP TO ADDRESS --- */

        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'firstname'
        ) as 'shipto_firstname',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'lastname'
        ) as 'shipto_lastname',
        concat(
            (       select xsoev.value
                from sales_order_int soi_sa
                inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
                	and soi_sa_ea.attribute_code = 'shipping_address_id'
                inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
                inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
                where    so.entity_id = soi_sa.entity_id and
                        xea.attribute_code = 'firstname'
            ), ' ',
            (       select xsoev.value
                from sales_order_int soi_sa
                inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
                	and soi_sa_ea.attribute_code = 'shipping_address_id'
                inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
                inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
                where    so.entity_id = soi_sa.entity_id and
                        xea.attribute_code = 'lastname'
            )
        ) as 'shipto_contact_name',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'company'
        ) as 'shipto_company',
        (   select substring_index(xsoev.value, char(10), 1 )
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'street'
        ) as 'shipto_street_line_1',
        (   select case when xsoev.value like concat('%', char(10), '%')
        	then substring_index(xsoev.value, char(10), -1 ) else '' end
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and                    xea.attribute_code = 'street'
        ) as 'shipto_street_line_2',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and                    xea.attribute_code = 'city'
        ) as 'shipto_city',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and                    xea.attribute_code = 'region'
        ) as 'shipto_region',
        (   select     dcr.code
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_int xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            inner join directory_country_region dcr on dcr.region_id = xsoev.value
            where     so.entity_id = soi_sa.entity_id and xea.attribute_code = 'region_id'
        ) as 'shipto_region_code',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'postcode'
        ) as 'shipto_postcode',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'country_id'
        ) as 'shipto_country_id',
        (    select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'shipping_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'telephone'
        ) as 'shipto_telephone',

        /* --- BILL TO ADDRESS --- */

        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'firstname'
        ) as 'billto_firstname',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'lastname'
        ) as 'billto_lastname',
        concat(
            (       select xsoev.value
                from sales_order_int soi_sa
                inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
                	and soi_sa_ea.attribute_code = 'billing_address_id'
                inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
                inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
                where    so.entity_id = soi_sa.entity_id and
                        xea.attribute_code = 'firstname'
            ), ' ',
            (       select xsoev.value
                from sales_order_int soi_sa
                inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
                	and soi_sa_ea.attribute_code = 'billing_address_id'
                inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
                inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
                where    so.entity_id = soi_sa.entity_id and
                        xea.attribute_code = 'lastname'
            )
        ) as 'billto_contact_name',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'company'
        ) as 'billto_company',
        (   select substring_index(xsoev.value, char(10), 1 )
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'street'
        ) as 'billto_street_line_1',
        (   select case when xsoev.value like concat('%', char(10), '%')
        	then substring_index(xsoev.value, char(10), -1 ) else '' end
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and                    xea.attribute_code = 'street'
        ) as 'billto_street_line_2',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and                    xea.attribute_code = 'city'
        ) as 'billto_city',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and                    xea.attribute_code = 'region'
        ) as 'billto_region',
        (   select     dcr.code
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_int xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            inner join directory_country_region dcr on dcr.region_id = xsoev.value
            where     so.entity_id = soi_sa.entity_id and xea.attribute_code = 'region_id'
        ) as 'billto_region_code',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'postcode'
        ) as 'billto_postcode',
        (   select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'country_id'
        ) as 'billto_country_id',
        (    select xsoev.value
            from sales_order_int soi_sa
            inner join eav_attribute soi_sa_ea on soi_sa.attribute_id = soi_sa_ea.attribute_id
            	and soi_sa_ea.attribute_code = 'billing_address_id'
            inner join sales_order_entity_varchar xsoev on xsoev.entity_id = soi_sa.value
            inner join eav_attribute xea on xsoev.attribute_id = xea.attribute_id
            where    so.entity_id = soi_sa.entity_id and
                    xea.attribute_code = 'telephone'
        ) as 'billto_telephone',

        /* --- ORDER DETAILS --- */
	( select xsov.value
	from sales_order_varchar xsov
	inner join eav_attribute xea on xsov.attribute_id = xea.attribute_id
	where xsov.entity_id = so.entity_id and
	xea.attribute_code = 'shipping_description'
	) as 'order_ship_description', 

	( select xsov.value
	from sales_order_varchar xsov
	inner join eav_attribute xea on xsov.attribute_id = xea.attribute_id
	where xsov.entity_id = so.entity_id and
	xea.attribute_code = 'shipping_method'
	) as 'order_ship_method',

        (   select xsod.value
            from sales_order_decimal xsod
            inner join eav_attribute xea on xsod.attribute_id = xea.attribute_id
            where    xsod.entity_id = so.entity_id and
                    xea.attribute_code = 'weight'
        ) as 'order_weight',
        so.subtotal as 'order_subtotal',
        so.grand_total as 'order_total'
from sales_order so
/*where so.increment_id = '100000412';*/
/*use the above to filter by a specific order number*/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.danmyers.name/wp/2009/12/integrating-fed-ex-ship-manager-with-magento/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixing 500 Errors on Media Temple DV 3.5 Running FastCGI</title>
		<link>http://www.danmyers.name/wp/2009/12/fixing-500-errors-on-media-temple-dv-3-5-running-fastcgi/</link>
		<comments>http://www.danmyers.name/wp/2009/12/fixing-500-errors-on-media-temple-dv-3-5-running-fastcgi/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:04:08 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://www.danmyers.name/wp/?p=87</guid>
		<description><![CDATA[I&#8217;ve gotten a lot of questions about 500 errors on Media Temple. I&#8217;m currently running a Media Temple DV 3.5 Extreme server with Magento. It&#8217;s been quite a process getting things tuned up, but I&#8217;ve got the performance to an acceptable level now. See for yourself&#8230; http://www.bcsports.com/. When I first switched to the FastCGI version [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gotten a lot of questions about 500 errors on Media Temple.  I&#8217;m currently running a Media Temple DV 3.5 Extreme server with Magento. It&#8217;s been quite a process getting things tuned up, but I&#8217;ve got the performance to an acceptable level now.  See for yourself&#8230; <a href="http://www.bcsports.com/" target="_blank">http://www.bcsports.com/</a>.  When I first switched to the FastCGI version of PHP, there were a few issues to deal with, the most important were the sporadic 500 errors that would pop up.</p>
<p>You know, it was odd, I thought I had everything running smoothly, but my client would call me and say &#8220;I&#8217;m getting a 500 error right now&#8221;.  I&#8217;d hit the server myself and &#8230; no problems.  Pages loaded fine.  So I decided to load test the server with a service that hits the server from many locations around the world.  Whamo&#8230; 500 errors popping up.  I immediately switched back to mod_php and ran it that way for a while.  It was much slower, but more reliable.</p>
<p>So after a while, I realized that I needed the performance of FastCGI to run Magento with a reasonable amount of speed.  I spent some additional time looking into the source of the 500 errors, and through some tuning and testing, I believe I&#8217;ve got it nailed.  It seems that the timeout settings were causing the CGI to die before PHP got a chance to respond.  So, without further ado, below is the configuration that cured my server&#8230;</p>
<p>1. With your favorite text editor, edit /etc/httpd/conf.d/fcgid.conf to the following:</p>
<pre class="brush: plain;">
# added by psa-mod-fcgid-configurator
LoadModule fcgid_module /usr/lib/httpd/modules/mod_fcgid.so

&lt;IfModule mod_fcgid.c&gt;
  SocketPath /var/lib/httpd/fcgid/sock
&lt;/IfModule&gt;

# added by psa-mod-fcgid-configurator
&lt;IfModule mod_fcgid.c&gt;
IdleTimeout 300
ProcessLifeTime 10000
MaxProcessCount 64
DefaultMaxClassProcessCount 15
IPCConnectTimeout 600
IPCCommTimeout 600
&lt;/IfModule&gt;
</pre>
<p>2. Restart apache by running &#8220;/etc/init.d/httpd restart&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danmyers.name/wp/2009/12/fixing-500-errors-on-media-temple-dv-3-5-running-fastcgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Run PHP as a FastCGI on a MediaTemple DV 3.5 Server</title>
		<link>http://www.danmyers.name/wp/2009/08/run-php-as-a-fastcgi-on-a-mediatemple-dv-3-5-server/</link>
		<comments>http://www.danmyers.name/wp/2009/08/run-php-as-a-fastcgi-on-a-mediatemple-dv-3-5-server/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 14:21:53 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://www.danmyers.name/wp/?p=52</guid>
		<description><![CDATA[If you found this article, you probably have a reason to want to move away from mod_php. &#160;Mine was because I was trying to operate a Magento install on a MediaTemple DV 3.5 server with periodic problems and outages. &#160;The symptoms were that the site would slow down tremendously, to the point that requests would [...]]]></description>
			<content:encoded><![CDATA[<p>If you found this article, you probably have a reason to want to move away from mod_php. &nbsp;Mine was because I was trying to operate a Magento install on a MediaTemple DV 3.5 server with periodic problems and outages. &nbsp;The symptoms were that the site would slow down tremendously, to the point that requests would just hang&#8230; no response from the server. &nbsp;Eventually, I was able to look at server resources in the Plesk interface and this is what I saw:</p>
<p><img class="alignnone size-full wp-image-53" title="load_average_100" src="http://www.danmyers.name/wp/wp-content/uploads/2009/08/load_average_100.gif" alt="load_average_100" width="404" height="68" /></p>
<p>The CPU usage was through the roof. &nbsp;And it stayed there too. &nbsp;In case you&#8217;re not familiar with Plesk, you can find the CPU usage by logging into Plesk, then going to Virtuozzo &gt;&gt; Resources. &nbsp;So I performed various upgrades to the server to try and get this system under control. &nbsp;First, I installed APC (Alternative PHP Cache) which is a handy little program that caches the compiled PHP opcode to save the computer some processor cycles. &nbsp;That helped a bit, but still didn&#8217;t solve the periodic problem of server slowdowns. &nbsp;I decided to install php as a FastCGI to free up some resources. &nbsp;Doing so on Media Temple was not as easy as I&#8217;d have liked, and the lack of documentation made it a bit of a challenge. &nbsp;Here are the steps I took:</p>
<ol>
<li>You must enable root access on your Media Temple DV account. &nbsp;This is required, since some of the files you&#8217;ll be creating need to go into directories where only root is allowed. Media Temple has a knowledgebase article on the subject. &nbsp;Basically you click a button on your Media Temple Account Center page.</li>
<li>Enable CGI and FastCGI on the domain where this will be applied. &nbsp;Here&#8217;s how: 1. Log into Plesk &nbsp;2. Click on Domains on the left side &nbsp; 3. Click the blue VR icon next to your domain &nbsp; 4. Under services check the boxes next to CGI support and FastCGI support &nbsp;5. Click the OK button at the bottom</li>
<li>Now your domain is ready to run FastCGI. &nbsp;Log into your server via SSH as root.</li>
<li>Run the commands below (without the quotes. &nbsp;replace yourdomain.com with your actual domain name)</li>
<li>&#8220;cd /var/www/vhosts/yourdomain.com/&#8221;</li>
<li>&#8220;cp /usr/bin/php-cgi bin/&#8221;</li>
<li>&#8220;chown -R username:psacln bin&#8221; (replace username with your FTP login name for this domain)</li>
<li>&#8220;vi conf/vhost.conf&#8221; &nbsp;(using vi or your favorite editor, create this file)<br />
<code lang="text">AddHandler fcgid-script .php<br />
<Directory /var/www/vhosts/yourdomain.com/httpdocs><br />
     FCGIWrapper /var/www/vhosts/yourdomain.com/bin/php-cgi .php<br />
     Options ExecCGI<br />
     allow from all<br />
</Directory></code>
</li>
<li>Save the file, then if you&#8217;re using SSL on this server, run this command: &#8220;cp conf/vhost.conf conf/vhost_ssl.conf&#8221;</li>
<li>Now, restart the server: &#8220;/etc/init.d/httpd restart&#8221;</li>
<li>If you want to see if it really worked, you can create a php page on your server with the line phpinfo(); &nbsp;Look through the page and you should see &#8220;Server API: CGI/FastCGI&#8221; &nbsp;if so, you&#8217;re in business.</li>
<li>Good luck.</li>
</ol>
<p><strong>UPDATE:</strong> Due to popular demand, I&#8217;ve written an article on how to cure 500 errors using this configuration.  <a href="/wp/2009/12/fixing-500-errors-on-media-temple-dv-3-5-running-fastcgi/">Click here to read.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.danmyers.name/wp/2009/08/run-php-as-a-fastcgi-on-a-mediatemple-dv-3-5-server/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Installing APC on Media Temple DV 3.5 Server</title>
		<link>http://www.danmyers.name/wp/2009/08/installing-apc-on-media-temple-dv-35-server/</link>
		<comments>http://www.danmyers.name/wp/2009/08/installing-apc-on-media-temple-dv-35-server/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 19:42:53 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dv]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Media Temple]]></category>

		<guid isPermaLink="false">http://www.danmyers.name/wp/?p=50</guid>
		<description><![CDATA[Here are some quick and easy steps to install APC on a Media Temple DV 3.5 Server A. Install Developer Tools and enable SSH access. Log into Account Center on Media Temple Click on the Admin button next to your domain Click on the &#8220;Root Access and Developer Tools&#8221; button Click the enable button next [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some quick and easy steps to install APC on a Media Temple DV 3.5 Server</p>
<p>A. Install Developer Tools and enable SSH access.</p>
<ol>
<li>Log into Account Center on Media Temple</li>
<li>Click on the Admin button next to your domain</li>
<li>Click on the &#8220;Root Access and Developer Tools&#8221; button</li>
<li>Click the enable button next to Root access</li>
<li>Click the install button next to Developer Tools</li>
<li>This process takes 10-15 minutes to complete, so hold your britches</li>
</ol>
<p>B. Download, compile and install APC.  Log into your system using an SSH client (Like Terminal on a Mac or Putty on a PC), then run the commands below in order.</p>
<ol>
<li>cd /usr/local/src</li>
<li>wget http://pecl.php.net/get/APC-3.0.19.tgz</li>
<li>tar -xvf APC-3.0.19.tgz</li>
<li>cd APC-3.0.19</li>
<li>phpize</li>
<li>./configure &#8211;enable-apc-mmap &#8211;with-apxs &#8211;with-php-config=/usr/local/php/bin/php-config &#8211;with-php-config=/usr/bin/php-config</li>
<li>make</li>
<li>make install</li>
<li>echo &#8220;extension=apc.so&#8221; &gt; /etc/php.d/apc.ini</li>
<li>/etc/init.d/httpd restart</li>
</ol>
<p>C. The last thing you want to do is copy the apc.php file to your web server to see if APC is running properly.  You can do that with the following command.  Make sure you replace the words &#8220;yourdomain.com&#8221; with your actual domain name for your web site.</p>
<ol>
<li>cp apc.php /var/www/vhosts/yourdomain.com/httpdocs/</li>
</ol>
<p>Now go to http://www.yourdomain.com/apc.php and you should see the caching stats there.</p>
<p>Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danmyers.name/wp/2009/08/installing-apc-on-media-temple-dv-35-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

