<?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/"
	>

<channel>
	<title>Th' Blog</title>
	<link>http://www.kentrichards.net/components/com_mojo</link>
	<description>Misc discoveries...</description>
	<pubDate>Mon, 20 Jul 2009 23:37:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0</generator>
	<language>en</language>
			<item>
		<title>Drupal:  Getting another menu block</title>
		<link>http://www.kentrichards.net/blog/p,10/</link>
		<comments>http://www.kentrichards.net/blog/p,10/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 09:03:37 +0000</pubDate>
		<dc:creator>joe_blow</dc:creator>
		
	<category>drupal</category>
		<guid isPermaLink="false">/?p=10</guid>
		<description><![CDATA[(Applies to D6 &#038; D7)
Drupal 6 only gives you one block for each of the menus.  Here&#8217;s how you get another one for any of the menus.

Login with permission to use (or enable) PHP input filter &#038; create blocks.
Go to Administer > Site building > Blocks.
Click Add.
Enter description and title as necessary.
For the Block [...]]]></description>
			<content:encoded><![CDATA[<p><em>(Applies to D6 &#038; D7)</em></p>
<p>Drupal 6 only gives you one block for each of the menus.  Here&#8217;s how you get another one for any of the menus.</p>
<ol>
<li>Login with permission to use (or enable) PHP input filter &#038; create blocks.</li>
<li>Go to <strong>Administer > Site building > Blocks</strong>.</li>
<li>Click <strong>Add</strong>.</li>
<li>Enter description and title as necessary.</li>
<li>For the Block body:
<ol>
<li>Choose PHP Code Input Format.</li>
<li>Enter this code:<br />
<div class="codeblock">
<code>&lt;?php<br />
echo menu_tree('primary-links');<br />
/*<br />
 * Other possible values for the parameter:<br />
 *   'navigation'<br />
 *   'secondary-links'<br />
 *   'admin_menu'<br />
 *<br />
 * See API function menu_tree() for details:<br />
 * http://api.drupal.org/api/function/menu_block/6<br />
 */<br />
?&gt;</code>
</div>
</li>
</ol>
</li>
<li>Save the block.</li>
<li>Apply CSS to theme as needed and enjoy.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.kentrichards.net/components/com_mojo/wp-feed.php?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>Drupal: Changing default strings (text) without using full translation system</title>
		<link>http://www.kentrichards.net/blog/p,9/</link>
		<comments>http://www.kentrichards.net/blog/p,9/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 08:54:55 +0000</pubDate>
		<dc:creator>joe_blow</dc:creator>
		
	<category>drupal</category>
		<guid isPermaLink="false">/?p=9</guid>
		<description><![CDATA[Methods

Edit settings.php file
String Overrides module

Method 1: Edit settings.php file
Pros

Quick method for small number of strings.
Less accessible in cases where you want to retain some control even after granting administrator access.

Cons

English only.
No admin pages, requires access to files on server (FTP / SFTP / SSH).  Difficult to delegate changes to non-developers.

Procedure

Edit settings.php for the site [...]]]></description>
			<content:encoded><![CDATA[<h2>Methods</h2>
<ol>
<li>Edit <b>settings.php</b> file</li>
<li>String Overrides module</li>
</ol>
<h2>Method 1: Edit settings.php file</h2>
<h3>Pros</h3>
<ul>
<li>Quick method for small number of strings.</li>
<li>Less accessible in cases where you want to retain some control even after granting administrator access.</li>
</ul>
<h3>Cons</h3>
<ul>
<li>English only.</li>
<li>No admin pages, requires access to files on server (FTP / SFTP / SSH).  Difficult to delegate changes to non-developers.</li>
</ul>
<h3>Procedure</h3>
<ol>
<li>Edit <b>settings.php</b> for the site in question.
<ul>
<li>You&#8217;ll need to either download the file, edit it, and re-upload it, or edit it in place on the server.  Of course, make a backup.</li>
<li>Either way, you&#8217;ll probably need to temporarily change the permissions of the file and its containing folder to to give you &#8220;write access&#8221;.  When done, be sure to change them back to what they were.</li>
<li>The default settings file is in <br/><code>drupal_root_folder/sites/default/settings.php</code></li>
</ul>
</li>
<li>Look for this code at the bottom:<br />
<div class="codeblock">
<code># $conf['locale_custom_strings_en'] = array(<br />
#   'forum'      => 'Discussion board',<br />
#   '@count min' => '@count minutes',<br />
# );<br />
</code></div>
</li>
<li>Remove the comment marks (&#8217;#') and add string replacement assignments:<br />
<div class="codeblock">
<code> $conf['locale_custom_strings_en'] = array(<br />
   'Old string 1'      => 'New string 1',<br />
   'Old string 2'      => 'New string 2',<br />
 );<br />
</code></div>
</li>
</ol>
<h2>Method 2: String Overrides module</h2>
<p>(http://drupal.org/project/stringoverrides)</p>
<h3>Pros</h3>
<ul>
<li>Admin page for managing string replacements.</li>
<li>Uses access permissions.  Easier to delegate management of overrides.</li>
</ul>
<h3>Cons</h3>
<ul>
<li>Yet another module to install, update, and administer.</li>
<li>Possible performance hit.  Stores replacements in the database.</li>
<li>Uses access permissions.  Harder to restrict changes when you have to give administrator access to others.</li>
</ul>
<h3>Procedure</h3>
<ol>
<li>Install and enable the module.</li>
<li>Follow the instructions / documentation for adding string overrides.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.kentrichards.net/components/com_mojo/wp-feed.php?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Adding fastCGI (suexec) PHP to a Media Temple (dv) 3.5 Dedicated Virtual Server</title>
		<link>http://www.kentrichards.net/blog/p,3/</link>
		<comments>http://www.kentrichards.net/blog/p,3/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 23:43:47 +0000</pubDate>
		<dc:creator>joe_blow</dc:creator>
		
	<category>Uncategorized</category>
		<guid isPermaLink="false">/?p=3</guid>
		<description><![CDATA[While the (dv) 3.5 machines come with PHP5 and FastCGI by default, PHP is still setup to run as an Apache module rather than as a fcgi process.
I&#8217;m assuming you already know why you want to run PHP as CGI, so I won&#8217;t go into the benefits.
First, make backups.  I don&#8217;t work for Media [...]]]></description>
			<content:encoded><![CDATA[<p>While the (dv) 3.5 machines come with PHP5 and FastCGI by default, PHP is still setup to run as an Apache module rather than as a fcgi process.</p>
<p>I&#8217;m assuming you already know why you want to run PHP as CGI, so I won&#8217;t go into the benefits.</p>
<p>First, make backups.  I don&#8217;t work for Media Temple, and I&#8217;ve never used their snapshot backup system, but it sure looks like a fast and convenient way for making a full backup of the machine.</p>
<p>Now, here&#8217;s the blow-by-blow (adapted from <a href="http://kb.mediatemple.net/questions/260/Upgrade+to+PHP+5+on+(dv)+3.0+Dedicated+Virtual+Servers">this KB article</a>).  These instructions must be followed for each domain, though there&#8217;s probably a way to make it the default - perhaps by modifying httpd.conf.:</p>
<ol>
<li>Enable root acccess, CGI, and FastCGI for the machine / domain in question.</li>
<li>On my machine, Safe Mode was on by default, so I&#8217;m skipping the Safe Mode step from the KB article.</li>
<li>Find out the FTP username for the domain.  This is the username under which PHP will run (the point of this is so that PHP will have permission to access the files and folders that you uploaded via FTP, which will be <em>owned</em> by the FTP user).</li>
<li>Log in via SSH as root and navigate to the directory for the domain (/var/www/vhosts/yourdomain.com/).</li>
<li>Copy the CGI version of PHP to the <strong>bin</strong> directory and change ownership as so (replace &#8220;username&#8221; with the FTP username you found above) with these commands:<br />
<div class="codeblock"><code>cp /usr/bin/php-cgi bin/<br />
chown -R username:psacln bin</code></div>
</li>
<li>Open / create <strong>vhost.conf</strong> for editing:<br />
<div class="codeblock"><code>cd conf<br />
vi vhost.conf</code></div>
</li>
<li>Add the following lines to <strong>vhost.conf</strong>, replacing &#8220;yourdomain.com&#8221; with your actual domain name:<br />
<div class="codeblock"><code>AddHandler fcgid-script .php .php5<br />
&lt;Directory /var/www/vhosts/yourdomain.com/httpdocs&gt;<br />
     FCGIWrapper /var/www/vhosts/yourdomain.com/bin/php-cgi .php<br />
     allow from all<br />
&lt;/Directory&gt; </code></div>
<p><u>Notes:</u></p>
<p>Adding &#8220;.php&#8221; to the <strong>AddHandler</strong> directive allows also files with &#8220;.php&#8221; extension to run as FastCGI.</p>
<p>No ideas about the <strong>FCGIWrapper</strong> directive&#8230;  Only 1-2 arguments are allowed, so I changed the second to &#8220;.php&#8221;</p>
<p>I removed the <strong>Options</strong> line from the KB article code because <strong>ExecCGI</strong> and <strong>FollowSymlinks</strong> was enabled by default on my (dv) 3.5 server.</p>
<p>Likewise, I left out the <strong>SuexecUserGroup</strong> line from the KB article code.
</li>
<li>Save <strong>vhost.conf</strong>, quit vi, and restart the webserver:<br />
<div class="codeblock"><code>/usr/local/psa/admin/sbin/websrvmng -a -v</code></div>
<p>I&#8217;m pretty sure you have to restart with this command rather than the manual restart command so that the new <strong>vhost.conf</strong> is recognized.</li>
<li>Test by creating a phpinfo() file in your web directory and visit it with the browser.  You should see &#8220;CGI/FastCGI&#8221; on the Server API line (right after the configuration info):<br />
<img src="/images/stories/blog/phpinfo-server-api.png" alt="Server API row of phpinfo output" /></li>
</ol>
<p>The new system should still be using <em>/etc/php.ini</em> for configuration.  Note that the default <em>php.ini</em> configuration is not considered to be secure and should be reviewed.</p>
<p>Update:  This may interfere with your sessions.  If you&#8217;re having login problems with a web app (or with webmail), then check the error log to see if the problem is unwritable session save path.  </p>
<p>There a probably a couple of ways to fix this.  The easiest is to change the owner:group of <em>/var/lib/php/session</em> to <em>username:psaserver</em> (where username is the FTP user used above).  I imagine you don&#8217;t want to use this method if you&#8217;re running several domains as PHP/CGI.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kentrichards.net/components/com_mojo/wp-feed.php?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
		<item>
		<title>VPN connections with DNS suffix on the Mac</title>
		<link>http://www.kentrichards.net/blog/p,2/</link>
		<comments>http://www.kentrichards.net/blog/p,2/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 03:10:10 +0000</pubDate>
		<dc:creator>joe_blow</dc:creator>
		
	<category>Uncategorized</category>
		<guid isPermaLink="false">/?p=2</guid>
		<description><![CDATA[Doing things the hard way again.  I struggled for a couple of hours trying to get this to work.  The problem was mostly because I didn&#8217;t understand what a &#8220;DNS suffix&#8221; is and how to configure the Mac to use it&#8230;
First, creating a VPN:
It&#8217;s pretty straightforward to do via Internet Connect.  Just [...]]]></description>
			<content:encoded><![CDATA[<p>Doing things the hard way again.  I struggled for a couple of hours trying to get this to work.  The problem was mostly because I didn&#8217;t understand what a &#8220;DNS suffix&#8221; is and how to configure the Mac to use it&#8230;</p>
<p>First, creating a VPN:</p>
<p>It&#8217;s pretty straightforward to do via Internet Connect.  Just enter the info your network admin gave you, and you should get a basic connection.</p>
<p>Now, the &#8220;DNS suffix&#8221;:  </p>
<p>Here&#8217;s a little background:  </p>
<p>Let&#8217;s say you&#8217;re given a URL for an intranet page like <code>http://machine_name/the_file.html</code>, and a DNS suffix of <code>company_net.lan</code>.  In the URL, the &#8220;domain&#8221; is actually an abbreviation.  The full domain can be interpolated by adding the DNS suffix to the end of the abbreviated domain, to give you <code>http://machine_name.company_net.lan/the_file.html</code>.  You should be able to get to the page by using this URL with the full domain name (assuming you&#8217;re connected to the VPN).</p>
<p>If you just entered the URL into the browser as-is, you&#8217;d probably get an error, because the browser wouldn&#8217;t know what to do with <em>http://machine_name</em> as the domain name.  It would probably either say something like <strong>Firefox can&#8217;t find the server at http://machine_name.</strong> or translate the URL to <em>http://www.machine_name.com/the_file.html</em>, which would also lead to undesired results.</p>
<p>Why not just use the real URL, then?  While you could get to the page that way, the page might have links or images on it that use the abbreviated domain name.  They wouldn&#8217;t work, because the browser wouldn&#8217;t know how to interpret the abbreviated domain name.</p>
<p>Enter the DNS suffix. Specifying the DNS suffix tells the system to automatically append the suffix to the abbreviated domain.  So, whenever the browser transmits <em>http://machine_name/</em>, the suffix is added automatically as the query goes out through the connection, the machine gets found, and the correct information gets returned to the browser.</p>
<p>Now, where to put the DNS suffix.  It&#8217;s easy, if not intuitive.</p>
<ol>
<li>Make sure you&#8217;re connected to your VPN.</li>
<li>Open <strong>System Preferences -> Network</strong>.</li>
<li>For whatever location you&#8217;re using, open the second drop-down menu.  You should see an entry for the VPN you&#8217;re using. Choose it.</li>
<li>Make sure you&#8217;re on the <strong>TCP/IP</strong> tab in the preference pane.</li>
<li>In the <strong>Search Domains</strong> field, enter the DNS suffix you were given and click <strong>Apply Now</strong> (the DNS suffix might look something like <em>mycompanyintranet.lan</em>).</li>
<li>Now go back to your browser and try the URL with the abbreviated domain (make sure you&#8217;re connected and the browser is talking to the VPN).</li>
</ol>
<p>Here&#8217;s a little tidbit about Internet Connect: If you have unused connections you want to delete, just drag their icons out of the top of the window.  This will delete the connection and all of it&#8217;s configurations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kentrichards.net/components/com_mojo/wp-feed.php?feed=rss2&amp;p=2</wfw:commentRss>
		</item>
	</channel>
</rss>
