<?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>Fireside Media Development Blog &#187; Tutorials</title>
	<atom:link href="http://www.firesidemedia.net/dev/topic/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.firesidemedia.net/dev</link>
	<description></description>
	<lastBuildDate>Mon, 24 Aug 2009 23:23:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress Tutorial: Using SSH to Install/Upgrade</title>
		<link>http://www.firesidemedia.net/dev/wordpress-install-upgrade-ssh/</link>
		<comments>http://www.firesidemedia.net/dev/wordpress-install-upgrade-ssh/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:33:13 +0000</pubDate>
		<dc:creator>Jonathan Dingman</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.firesidemedia.net/dev/?p=81</guid>
		<description><![CDATA[This tutorial will guide you step by step on how to setup your server so you can install new plugins and upgrade existing plugins using an SSH2 layer in PHP and WordPress. What is WordPress? WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will guide you <strong>step by step</strong> on how to setup your server so you can <strong>install new plugins and upgrade existing plugins using an SSH2</strong> layer in PHP and WordPress.</p>
<p><strong>What is WordPress?</strong><br />
WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on hundreds of thousands of sites and seen by tens of millions of people every day.</p>
<p><strong>What is SSH[2]?</strong><br />
SSH (Secure Shell) is a protocol allowing a secure channel to be established between a web server and a client&#8217;s local machine. Many web hosting companies now offer SSH for greater security.<br />
<span id="more-81"></span></p>
<hr />
<p><strong>Tutorial Pre-requisites</strong></p>
<p>There are a few things that need to be in place before you can actually use this tutorial.</p>
<p>The first thing to do is make sure you have SSH2 installed via pecl.  If it&#8217;s not installed or you&#8217;re not sure, run this command: <strong>pecl install ssh2</strong></p>
<p><strong>note:</strong>  If your case is where the installed version of SSh2 is beta, run this command instead: <strong>pecl install channel://pecl.php.net/ssh2-0.11.0</strong></p>
<p>If you don&#8217;t feel comfortable running these commands yourself and you know of a server administrator that can help, or you&#8217;re paying for managed services, ask them to install this for you.</p>
<p>After SSH2 is installed, follow these instructions to ensure that the SSH2 extension is enabled in PHP.  Again, if you are using managed services, simply ask them to do this for you.</p>
<dl>
<dt>Ubuntu/Debian</dt>
<dd>cd /etc/php5/conf.d; echo &#8220;extension=ssh2.so&#8221; > ssh2.ini</dd>
<dd>/etc/init.d/apache2 restart</dd>
<dt>Red Hat, CentOS, Fedora</dt>
<dd>cd /etc/php.d; echo &#8220;extension=ssh2.so&#8221; > ssh2.ini</dd>
<dd>/etc/init.d/httpd restart</dd>
</dl>
<hr />
<h3>Step 1: Generating the server-side RSA keys</h3>
<pre class="brush: plain;">
ssh-keygen
</pre>
<p><em>Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/user1/.ssh/id_rsa):<br />
Created directory &#8216;/home/user1/.ssh&#8217;.<br />
Enter passphrase (empty for no passphrase): <strong>(just hit enter, no need for a password)</strong><br />
Enter same passphrase again: <strong>(same thing, hit enter again)</strong><br />
Your identification has been saved in /home/user1/.ssh/id_rsa.<br />
Your public key has been saved in /home/user1/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx user1@server1.example.com</em></p>
<p><small>The xx:xx:xx etc. will be replaced with your actual fingerprint.</small></p>
<h3>Step 2: Creating an &#8216;authorized_keys&#8217; file</h3>
<pre class="brush: plain;">
cd .ssh
cp id_rsa.pub authorized_keys
</pre>
<h3>Step 3: Setting the proper file permissions</h3>
<pre class="brush: plain;">
cd ~/
chmod 755 .ssh
chmod 644 .ssh/*
</pre>
<h3>Step 4: Choosing the &#8216;SSH&#8217; option</h3>
<p><img src="http://www.firesidemedia.net/dev/files/wordpress-ssh-connection-information.jpg" alt="WordPress SSH Connection Information" title="WordPress SSH Connection Information" /></p>
<p>In this tutorial, I opted not to use a password, so you do not need to enter a password.</p>
<h3>Step 5: Click &#8220;Proceed&#8221;</h3>
<p>The last step is to click the proceed button and it will install a new plugin or upgrade an existing plugin via the integrated SSH layer in WordPress.  You should see results something like this&#8230;</p>
<p><img src="http://www.firesidemedia.net/dev/files/activated-plugin-via-ssh.jpg" alt="Activated WordPress Plugin via SSH" title="Activated WordPress Plugin via SSH" width="500" height="147" /></p>
<h3>== Optional ==</h3>
<p>If you want to automate the process a bit more, there are a few more things you can do to make it even easier.</p>
<p>If you open up your <strong>wp-config.php</strong> and add these lines, it will make the process smoother.</p>
<pre class="brush: plain;">
define('FTP_PUBKEY','/home/user1/.ssh/id_rsa.pub');
define('FTP_PRIKEY','/home/user1/.ssh/id_rsa');
define('FTP_USER','user1');
define('FTP_PASS','');
define('FTP_HOST','server1.example.com:22');
</pre>
<p>Now, when you click &#8220;upgrade&#8221; or &#8220;install&#8221; on a new plugin, it will bypass the first screen you saw above asking for the details.  It will automatically go into the process and start the install/upgrade.</p>
<h3>Thank you</h3>
<p>A huge thanks to <a href="http://dd32.id.au/">Dion Hulse</a> and <a href="http://sivel.net/">Matt Martz</a> for helping me with creating this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.firesidemedia.net/dev/wordpress-install-upgrade-ssh/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>OpenX Advanced Targeting Using WordPress</title>
		<link>http://www.firesidemedia.net/dev/openx-targeting-using-wordpress/</link>
		<comments>http://www.firesidemedia.net/dev/openx-targeting-using-wordpress/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 13:23:46 +0000</pubDate>
		<dc:creator>Jonathan Dingman</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[OpenX]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.firesidemedia.net/dev/?p=56</guid>
		<description><![CDATA[What is Openx OpenX is, in my opinion, the most efficient and hands-free open source ad server on the web today. It&#8217;s flexible, easy to use, and best of all, free. What is WordPress WordPress is one of the leading platforms in blogging on the web today. Whether you are self-hosted (using wordpress.org) or being [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is Openx</strong></p>
<p>OpenX is, in my opinion, the most efficient and hands-free open source ad server  on the web today.  It&#8217;s flexible, easy to use, and best of all, free.</p>
<p><strong>What is WordPress</strong></p>
<p>WordPress is one of the leading platforms in blogging on the web today.  Whether you are self-hosted (using wordpress.org) or being hosted on Automattic servers (using wordpress.com), WordPress is an amazing blogging platform which makes blogging easy and fun.</p>
<p>This OpenX and WordPress tutorial will outline how to more effectively use the targeting features of OpenX utilizing the built-in features of WordPress.  It will explain how to do this by using WordPress tags and OpenX source parameters, both built-in features to WordPress and OpenX, respectively.</p>
<p><strong>OpenX Solution Used</strong>:  Hosted OpenX (<a href="http://hosted.openx.org/">http://hosted.openx.org/</a>)<br />
<strong>WordPress Version</strong>: <a href="http://wordpress.org/download/release-archive/">2.6.2</a></p>
<p>For this tutorial, I will be using tags are the &#8220;source&#8221; for OpenX.</p>
<hr />
<h4>Step 1:  Setup tags so OpenX can view them as a &#8220;source.&#8221;</h4>
<pre class="php">&lt;?php
        while ( have_posts() ) : the_post();
                $fsm_oxtags = get_the_tags();
                if ($fsm_oxtags) { foreach ($fsm_oxtags as $tag) {
                        $taglist .= $tag-&gt;name . '|';
                }
                $taglist = rtrim($taglist, '|');
                $oxtags = rawurlencode($taglist);
                }
        endwhile;
?&gt;</pre>
<p>I have these in the top of my single.php file within WordPress.  This only creates the variable of $oxtags so it can be echo&#8217;d elsewhere.</p>
<p>Details of Step 1: The first bit of code will create the loop.  then it will go through each tag and set it as &#8220;tag |&#8221; because I am using pipes to separate each tag for OpenX.  Next, it will trim off the last pipe because it&#8217;s not needed, creating something like&#8230; &#8220;tag 1|tag 2|tag 3|tag 4&#8243; &#8230; and like I just mentioned, it will strip off the last pipe.  Lastly, it will put that string, &#8220;tag 1|tag 2|tag 3|tag 4&#8243; &#8230; into a raw encoded URL string which we will be able to echo later in the page.  <strong>Note:</strong> this is only being set at $oxtags so it can be used elsewhere, nothing is echo&#8217;d in this part of the script.<br />
<span id="more-56"></span></p>
<h4>Step 2: Setup your OpenX invocation code</h4>
<pre class="javascript">&lt;script type='text/javascript'&gt;&lt;!--//&lt;![CDATA[
   var m3_u = (location.protocol=='https:'?'https://d.openx.org/ajs.php':'http://d.openx.org/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write (&quot;&lt;scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);
   document.write (&quot;?zoneid=1009&quot;);
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write (&quot;&amp;exclude=&quot; + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write (&quot;&amp;loc=&quot; + escape(window.location));
   document.write (&quot;&amp;source=<strong>&lt;?php echo $oxtags; ?&gt;</strong>&quot;);
   if (document.referrer) document.write (&quot;&amp;referer=&quot; + escape(document.referrer));
   if (document.context) document.write (&quot;&#038;context=&quot; + escape(document.context));
   if (document.mmm_fo) document.write (&quot;&amp;mmm_fo=1&quot;);
   document.write (&quot;'&gt;&lt;\/scr&quot;+&quot;ipt&gt;&quot;);
//]]&gt;--&gt;&lt;/script&gt;</pre>
<p>Now that we have the $oxtags variable ready, we can echo it where we need it.  Simply add the next line, such as I have, <code class="inline">document.write (&quot;&amp;source=<strong>&lt;?php echo $oxtags; ?&gt;</strong>&quot;);</code>, then we&#8217;re almost ready to start using advanced targeting within OpenX using your WordPress tags.</p>
<h4>Step 3:  Rewind the content loop</h4>
<p><span class="big red">!!! IMPORTANT !!!</strong></p>
<p>This is critical!  You must do this if you want your posts&#8217; content to display properly.</p>
<pre class="php">&lt;?php rewind_posts(); if (have_posts()) : while (have_posts()) : the_post(); ?&gt;</pre>
<p>The reason for this is that you need to rewind the posts so the loop is displayed properly. (<a href="http://codex.wordpress.org/The_Loop#Loop_Examples_2">documentation</a>)</p>
<p>The line above is what my real loop looks like in my single.php file, ensuring that the content of the loop is displayed properly as it was originally.</p>
<p><strong>Note:</strong> You only need to rewind_posts(); if you have multiple loops or you put the Step 1 code before the first loop, which I did for this tutorial.</p>
<h4>Step 4:  Setup OpenX Targetting to Deliver to Specific Tags</h4>
<p>Now that we have sources setup within the JavaScript and PHP for WordPress, we need to get to work adding some banners using specific sources.  Go to one of your campaigns, then select a banner you&#8217;ve already added or add a new banner.  Go to the <strong>Delivery Options</strong> tab.  This is where you can select your targeting limitations.</p>
<p>First, add the delivery option to limit the banner display for a specific source.</p>
<p><img src="http://www.firesidemedia.net/dev/files/wordpress-openx-target-source.jpg" alt="OpenX: Setup Delivery Options to be Limited by a Source" title="OpenX: Setup Delivery Options to be Limited by a Source" /></p>
<p>Next, set it to &#8220;contains&#8221; so you can specify which tagged posts you want to display this banner.</p>
<p><img src="http://www.firesidemedia.net/dev/files/wordpress-openx-target-contains.jpg" alt="OpenX: Setup Delivery Options to Contain a Source" title="OpenX: Setup Delivery Options to Contain a Source" /></p>
<p>Lastly, specify the source you want to use fr banner delivery limitation.</p>
<p><img src="http://www.firesidemedia.net/dev/files/wordpress-openx-banner-delivery-options.jpg" alt="OpenX: Specify the Delivery Source for Banner Limitation" title="OpenX: Specify the Delivery Source for Banner Limitation" /></p>
<h4>Results</h4>
<p>Here is what your final output should look like:</p>
<pre class="javascript">&lt;script type='text/javascript'&gt;&lt;!--//&lt;![CDATA[
   var m3_u = (location.protocol=='https:'?'https://d.openx.org/ajs.php':'http://d.openx.org/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write (&quot;&lt;scr&quot;+&quot;ipt type='text/javascript' src='&quot;+m3_u);
   document.write (&quot;?zoneid=1009&quot;);
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write (&quot;&amp;exclude=&quot; + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write (&quot;&amp;loc=&quot; + escape(window.location));
   document.write (&quot;&amp;source=<strong>tag%201%7Ctag%202</strong>&quot;);
   if (document.referrer) document.write (&quot;&amp;referer=&quot; + escape(document.referrer));
   if (document.context) document.write (&quot;&#038;context=&quot; + escape(document.context));
   if (document.mmm_fo) document.write (&quot;&amp;mmm_fo=1&quot;);
   document.write (&quot;'&gt;&lt;\/scr&quot;+&quot;ipt&gt;&quot;);
//]]&gt;--&gt;&lt;/script&gt;</pre>
<p>I bolded the part that was used with the Step 1 code.  Basically, it will output your tags for each WordPress post as a &#8220;source&#8221; so you can use them for targeting on your site.</p>
<p><em>Thanks goes out to <a href="http://outnow.ch/">Thomas</a> and <a href="http://www.stevesmith1983.co.uk/">Steve Smith</a> for helping me get this working</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.firesidemedia.net/dev/openx-targeting-using-wordpress/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
