<?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>Jesse Forrest</title>
	<atom:link href="http://jesseforrest.name/feed" rel="self" type="application/rss+xml" />
	<link>http://jesseforrest.name</link>
	<description>Life in Design and Development</description>
	<lastBuildDate>Thu, 20 Dec 2012 18:16:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Resolving VMware&#8217;s &#8220;Unable to update run-time folder sharing status: Unknown error&#8221;</title>
		<link>http://jesseforrest.name/resolving-vmwares-unable-to-update-run-time-folder-sharing-status-unknown-error/305</link>
		<comments>http://jesseforrest.name/resolving-vmwares-unable-to-update-run-time-folder-sharing-status-unknown-error/305#comments</comments>
		<pubDate>Thu, 20 Dec 2012 18:13:26 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Sharing]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=305</guid>
		<description><![CDATA[<p>The Problem Sometimes when upgrading VMware, I noticed that I can no longer share directories between my local file system and the VMs file system. In an effort to get shared folders working, I would then go to the following&#8230;</p><p>The post <a href="http://jesseforrest.name/resolving-vmwares-unable-to-update-run-time-folder-sharing-status-unknown-error/305">Resolving VMware&#8217;s &#8220;Unable to update run-time folder sharing status: Unknown error&#8221;</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><strong>The Problem</strong><br />
Sometimes when upgrading VMware, I noticed that I can no longer share directories between my local file system and the VMs file system.  </p>
<p>In an effort to get shared folders working, I would then go to the following location in VMware:<br />
Virtual Machine -> Sharing -> Sharing Settings &#8230;</p>
<p>I would accurately see the folders I want to share and I would see that Shared Folders is &#8220;ON&#8221;.  In an attempt to re-share the folders I toggled Shared Folders to &#8220;OFF&#8221;.  I then toggled it back to &#8220;ON&#8221; and noticed the following error:</p>
<blockquote><p>Unable to update run-time folder sharing status: Unknown error </p></blockquote>
<p><strong>The Solution</strong></p>
<p>The problem is related to VMware tools and you will need to reinstall it. Here are the steps you should follow:</p>
<p>1. Open up VMware</p>
<p>2. Go to:<br />
<code>Virtual Machine -> Update VMware Tools</code></p>
<p>3. Click &#8220;Install&#8221; button</p>
<p>4. It will automatically download the VMware Tools package. When the package is completed downloading double click the *.tar.gz file to untar all it&#8217;s contents.</p>
<p>5. Go to the recently expanded folder (you might need to put a different path to where it actually downloaded the distribution):<br />
<code>cd ./vmware-tools-distrib/bin/</code></p>
<p>6. Change to root:<br />
<code>sudo -s</code></p>
<p>7. Remove current VMware Tools:<br />
<code>./vmware-uninstall-tools.pl</code></p>
<p>8. Reinstall:<br />
<code>cd ..</code><br />
<code>./vmware-install.pl</code></p>
<p>Use all the default values by simply hitting the enter key.</p>
<p>The post <a href="http://jesseforrest.name/resolving-vmwares-unable-to-update-run-time-folder-sharing-status-unknown-error/305">Resolving VMware&#8217;s &#8220;Unable to update run-time folder sharing status: Unknown error&#8221;</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/resolving-vmwares-unable-to-update-run-time-folder-sharing-status-unknown-error/305/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FaceProject Creates Framed Photos Using PHP GD library</title>
		<link>http://jesseforrest.name/faceproject-creates-framed-photos-using-php-gd-library/289</link>
		<comments>http://jesseforrest.name/faceproject-creates-framed-photos-using-php-gd-library/289#comments</comments>
		<pubDate>Sat, 29 Sep 2012 17:20:33 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[FaceProject]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=289</guid>
		<description><![CDATA[<p>The above photo was generated using FaceProject, a PHP class that takes a photo of a person and generates a stylized and framed version of it. I spent last night creating FaceProject, simply to toy around with the GD library&#8230;</p><p>The post <a href="http://jesseforrest.name/faceproject-creates-framed-photos-using-php-gd-library/289">FaceProject Creates Framed Photos Using PHP GD library</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>The above photo was generated using FaceProject, a PHP class that takes a photo of a person and generates a stylized and framed version of it.  I spent last night creating FaceProject, simply to toy around with the GD library and came up with what I believe a pretty cool looking photo. </p>
<p>The project is currently hosted on GitHub: <a href="https://github.com/jesseforrest/FaceProject" title="FaceProject" target="_blank">FaceProject</a></p>
<p>The photo above was created from this original photo:</p>
<div>
<a href="http://jesseforrest.name/wp-content/uploads/2012/09/face-project-original.jpg"><img src="http://jesseforrest.name/wp-content/uploads/2012/09/face-project-original.jpg" alt="" title="FaceProject Original Photo" width="300" height="400" class="alignleft size-full wp-image-290" /></a>
</div>
<div style="clear:both;">
There is still a lot of work to be done on FaceProject and it&#8217;s far from being a stable codebase, but wanted to at least show it&#8217;s progress after it&#8217;s first night of inception!
</div>
<p></p>
<p>The post <a href="http://jesseforrest.name/faceproject-creates-framed-photos-using-php-gd-library/289">FaceProject Creates Framed Photos Using PHP GD library</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/faceproject-creates-framed-photos-using-php-gd-library/289/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Email2Image &#8211; PHP Library to Convert an Email Address to Image</title>
		<link>http://jesseforrest.name/email2image-php-library-convert-email-address-to-image/272</link>
		<comments>http://jesseforrest.name/email2image-php-library-convert-email-address-to-image/272#comments</comments>
		<pubDate>Wed, 19 Sep 2012 22:29:31 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Convert]]></category>
		<category><![CDATA[Decrypt]]></category>
		<category><![CDATA[Email Address]]></category>
		<category><![CDATA[Email2Image]]></category>
		<category><![CDATA[Encrypt]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[GD]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Mcrypt]]></category>
		<category><![CDATA[Secure]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=272</guid>
		<description><![CDATA[<p>Email2Image is a PHP library that I wrote to securely convert email addresses to PNG images. The project is hosted on GitHub here: https://github.com/jesseforrest/Email2Image This basic example will show how to select the font to be used and output an&#8230;</p><p>The post <a href="http://jesseforrest.name/email2image-php-library-convert-email-address-to-image/272">Email2Image &#8211; PHP Library to Convert an Email Address to Image</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Email2Image is a PHP library that I wrote to securely convert email addresses to<br />
PNG images. The project is hosted on GitHub here:<br />
<a title="Email2Image" href="https://github.com/jesseforrest/Email2Image" target="_blank">https://github.com/jesseforrest/Email2Image</a></p>
<p>This basic example will show how to select the font to be used and output an image for the email address example@example.com.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Email2Image.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Email2Image<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFontPath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./fonts/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFontFile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tahoma.ttf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFontSize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setWidth</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHeight</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBackgroundColor</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'293134'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setForegroundColor</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'668aaf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHorizontalAlignment</span><span style="color: #009900;">&#40;</span>Email2Image<span style="color: #339933;">::</span><span style="color: #004000;">MIDDLE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setVerticalAlignment</span><span style="color: #009900;">&#40;</span>Email2Image<span style="color: #339933;">::</span><span style="color: #004000;">MIDDLE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setEmail</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'example@example.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$email2Image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">outputImage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The above code will output the following image:</p>
<div><a href="http://jesseforrest.name/wp-content/uploads/2012/09/example-at-example-dot-com.png"><img class="size-full wp-image-276 aligncenter" title="example-at-example-dot-com" src="http://jesseforrest.name/wp-content/uploads/2012/09/example-at-example-dot-com.png" alt="" width="400" height="200" /></a></div>
<p><strong>Advanced examples using encryption and decryption are available at the above listed GitHub page.</strong></p>
<p>The post <a href="http://jesseforrest.name/email2image-php-library-convert-email-address-to-image/272">Email2Image &#8211; PHP Library to Convert an Email Address to Image</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/email2image-php-library-convert-email-address-to-image/272/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate a Compliment Color in PHP</title>
		<link>http://jesseforrest.name/generate-a-compliment-color-in-php/264</link>
		<comments>http://jesseforrest.name/generate-a-compliment-color-in-php/264#comments</comments>
		<pubDate>Mon, 10 Sep 2012 18:08:05 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=264</guid>
		<description><![CDATA[<p>This function accepts a string that contains a hexadecimal color (i.e. &#8220;5DBA00&#8243;) and returns a string containing a different color that can be used as it&#8217;s compliment. A common usage is if you have a background color and you want&#8230;</p><p>The post <a href="http://jesseforrest.name/generate-a-compliment-color-in-php/264">Generate a Compliment Color in PHP</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>This function accepts a string that contains a hexadecimal color (i.e. &#8220;5DBA00&#8243;) and returns a string containing a different color that can be used as it&#8217;s compliment. A common usage is if you have a background color and you want to find a compliment color that can be used for the font in the foreground.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #009933; font-style: italic;">/**
 * Returns a hex color string which compliments the passed in 6 character
 * hex string
 *
 * @param string $hexColor The 6 character hex string
 *
 * @return string
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> getComplimentColor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hexColor</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$rHex</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%02X</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">hexdec</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hexColor</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$gHex</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%02X</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">hexdec</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hexColor</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$bHex</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%02X</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">hexdec</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hexColor</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #b1b100;">return</span> <span style="color: #000088;">$rHex</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$gHex</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$bHex</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Here is an example of how to use the function:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #000088;">$originalColor</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'5DBA00'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$complimentColor</span> <span style="color: #339933;">=</span> getComplimentColor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$originalColor</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
Main Color: #<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$originalColor</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div style=&quot;
   margin: 8px;
   width: 100px; 
   height: 100px; 
   background-color: #<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$originalColor</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>;&quot;&gt;
&lt;/div&gt;
&nbsp;
Compliment Color: #<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$complimentColor</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div style=&quot;
   margin: 8px;
   width: 100px; 
   height: 100px; 
   background-color: #<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$complimentColor</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>;&quot;&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>The above example will output the following:</p>
<p><a href="http://jesseforrest.name/wp-content/uploads/2012/09/php-compliment-color.png"><img class="alignleft size-full wp-image-267" title="php-compliment-color" src="http://jesseforrest.name/wp-content/uploads/2012/09/php-compliment-color.png" alt="PHP Compliment Color" width="206" height="281" /></a></p>
<p>The post <a href="http://jesseforrest.name/generate-a-compliment-color-in-php/264">Generate a Compliment Color in PHP</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/generate-a-compliment-color-in-php/264/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup a Production CentOS LAMP Web Server</title>
		<link>http://jesseforrest.name/setup-a-production-centos-lamp-web-server/212</link>
		<comments>http://jesseforrest.name/setup-a-production-centos-lamp-web-server/212#comments</comments>
		<pubDate>Mon, 27 Aug 2012 04:00:51 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[GeoIP]]></category>
		<category><![CDATA[IPTables]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Memcached]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Secure]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Vixie Cron]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=212</guid>
		<description><![CDATA[<p>Overview This article explains how to configure a production web server with CentOS Linux, Apache, MySQL, and PHP.  It will also explain how to harden the system to protect from typical intrusions.  All steps are required unless otherwise stated as&#8230;</p><p>The post <a href="http://jesseforrest.name/setup-a-production-centos-lamp-web-server/212">Setup a Production CentOS LAMP Web Server</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><strong>Overview</strong><br />
This article explains how to configure a production web server with CentOS Linux, Apache, MySQL, and PHP.  It will also explain how to harden the system to protect from typical intrusions.  All steps are required unless otherwise stated as &#8220;Optional&#8221;. Please read the steps thoroughly prior to doing them, since doing them incorrectly can leave the system in an unstable or unusable state.</p>
<p><strong>Prerequisites</strong><br />
You should be proficient in getting around a Linux operating system. You should be familiar with the vi text editor for Linux. You should know common vi commands to open, insert, and save documents since they are not listed in this article. You should have a basic understanding of what a LAMP system is.</p>
<p><strong>Problems or Feedback?</strong><br />
If you run into problems while running the following steps, please post comments below. I will try my best to help you get the issue(s) squared away, plus we can open it to the community for brainstorming. This article is by no means perfect, so it&#8217;s always good to hear feedback too. If you feel like something should be added to this article, please let me know.</p>
<p><strong>Install Operating System</strong><br />
First you will need to get a server pre-installed with the latest stable release of <a title="CentOS" href="https://www.centos.org/" target="_blank">CentOS</a>. Most hosting companies do this step for you.  However, installing the CentOS operating system is outside the scope of this article.  Once that is done, you must SSH into the machine as the <em>root </em>user:</p>
<p><code># ssh root@<span style="color: #808080;">&lt;new_server_ip_address&gt;</span></code></p>
<p class="alert yellow"><strong>Note:</strong> Any line that starts with a &#8220;#&#8221; symbol is used to denote entering text into a terminal window. Do not actually type the &#8220;#&#8221; symbol.</p>
<p class="alert blue"><strong>Tip:</strong> I recommend storing your <em>root</em> password in a safe place, such as <a title="PasswordSafe" href="http://passwordsafe.sourceforge.net/" target="_blank">PasswordSafe</a>.</p>
<p><strong>Update Yum and Install Initial Packages</strong><br />
We will be using Yellowdog Updater Modified (yum) as our package management utility. After you SSH into the web server as <em>root</em>, you will need to run the following commands to update the system:<br />
<code># yum -y update<br />
# yum -y groupinstall "Development Tools"<br />
# yum -y install zlib-devel<br />
# yum -y install httpd openssl-devel openssl mod_ssl vsftpd rpm-build rpm-devel autoconf automake lynx gcc<br />
# yum -y install mysql mod_auth_mysql mysql-devel mysql-server<br />
# yum -y install mod_python python python-devel<br />
# yum -y install php-devel php php-common php-gd php-mcrypt php-mhash php-xml php-xmlrpc php-domxml php-gd php-mbstring php-mysql php-ncurses php-pear<br />
# yum -y install sendmail sendmail-cf<br />
# yum -y install wget<br />
# yum -y install yum-utils<br />
# yum -y install yum-plugin-replace<br />
# yum -y install vim-X11 vim-common vim-enhanced vim-minimal<br />
# yum -y install iptables<br />
# yum -y install nmap<br />
# yum -y install vixie-cron</code></p>
<p><strong>Setup host access</strong><br />
We need to setup host access (TCP_WRAPPERS).  There are two host access files (<em>/etc/hosts.allow</em> and <em>/etc/hosts.deny</em>) that are part of the TCP_WRAPPER package.  This makes it possible to allow or deny access to certain services based on the IP.  We need to edit the <em>hosts.allow</em> and <em>hosts.deny </em>files:</p>
<p>Run the following command to edit the file in vi text editor:<br />
# vi /etc/hosts.allow</p>
<p>Paste the following into the file and then save the file:<br />
<code>sshd:ALL<br />
vsftpd:ALL<br />
sendmail:ALL<br />
</code></p>
<p><code><p class="alert blue"><strong>Tip:</strong> I recommend limiting access to your production servers based on specific IP addresses.  This helps to prevent intruders from getting access to your server.  For example, let's say you have an office IP address of 55.55.55.55, you would make the <code>sshd</code> line look like this:<br />
<code>sshd:<span style="color: #808080;">55.55.55.55</span></code></code></p>
<p>You can enter multiple IP addresses also (separated by <strong>spaces</strong>).</p></p>
<p>Run the following command:<br />
# vi /etc/hosts.deny</p>
<p>Paste the following into the file to deny all other services and then save the file:<br />
<code>ALL:ALL</code></p>
<p><strong>Create User Account</strong><br />
Create a user account that you will use to log in to this server.  Try to select a name that is distinct from your website.  For example, if your website is <em>mywebsite.com</em>, do not make your username called <em>mywebsite</em>.  In this example, we will use the username <em>jesseforrest</em>.  You will want to replace <em>jesseforrest</em> with a more logical username that fits your needs. This account will be used for SSH connections.</p>
<p><code># adduser <span style="color: #808080;">jesseforrest</span><br />
# passwd <span style="color: #808080;">jesseforrest</span></code></p>
<p>Enter in a password and hit enter.<br />
Retype the password and hit enter.</p>
<p class="alert blue"><strong>Tip: </strong>Make sure to save the username and password in your PasswordSafe.</p>
<p>Allow the user <em>jesseforrest</em> to &#8220;<code>su -</code>&#8221; into the <em>root</em> user:<br />
<code># usermod -G wheel <span style="color: #808080;">jesseforrest</span></code></p>
<p><strong>Test SSH Connectivity</strong><br />
You should now have SSH access to the new server and be able to &#8220;<code>su -</code>&#8221; into the <em>root</em> user. To test, open a new terminal window and run the following commands:</p>
<p><code># ssh <span style="color: #808080;">jesseforrest</span>@<span style="color: #808080;">&lt;new_server_ip_address&gt;</span><br />
# su -</code></p>
<p>Enter in the root password.</p>
<p><strong>Disable root SSH Access and Change Default SSH Port Number</strong><br />
The <em>root</em> account should never be able to login via SSH. The user should have to first login as a specific user and then &#8220;<code>su -</code>&#8221; into <em>root</em>.  We should also change the default port used for SSH connectivity to prevent from common attacks. We will switch the SSH port to 11985, but you can pick any open port you like.</p>
<p>Run the following command:<br />
<code># vi /etc/ssh/sshd_config</code></p>
<p>Then change the following lines to match the following and then save it:<br />
<code>PermitRootLogin no<br />
Protocol 2<br />
Port 11985</code></p>
<p><strong>Allow SSH Keys to Connect</strong><br />
You will want to use SSH keys to connect to your server instead of entering in a password.</p>
<p>Open a <strong>new terminal window</strong> and run the following command:<br />
<code># ssh-keygen -t rsa -b 2048</code></p>
<p>Enter in a path to store your *_id_rsa file. The path should be similar to this:<br />
<code>~/.ssh/<span style="color: #808080;">jesseforrest</span>_id_rsa</code></p>
<p>Create a new passphrase.</p>
<p class="alert blue"><strong>Tip: </strong>Store this passphrase in your PasswordSafe.</p>
<p>On the client machine (the computer you will be connecting from) tighten up file system permissions:<br />
<code># chmod 700 ~/.ssh<br />
# chmod 600 ~/.ssh/*</code></p>
<p>Now copy the public key to the machine you want to SSH into and fix permissions:<br />
<code># scp ~/.ssh/<span style="color: #808080;">jesseforrest</span>_id_rsa.pub <span style="color: #808080;">jesseforrest</span>@<span style="color: #808080;">&lt;ip_address_of_server&gt;</span>:</code></p>
<p>Connect to the remote server:<br />
<code># ssh <span style="color: #808080;">jesseforrest</span>@<span style="color: #808080;">&lt;ip_address_of_server&gt;</span> -p 11985</code></p>
<p>You will need to create the ~/.ssh directory if it does not yet exist<br />
<code># mkdir ~/.ssh</code></p>
<p>Append your public key to the authorized_keys file.<br />
<code># cat ~/<span style="color: #808080;">jesseforrest</span>_id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys</code></p>
<p>Remove the public key file from the server<br />
<code># rm ~/<span style="color: #808080;">jesseforrest</span>_id_rsa.pub</code></p>
<p>Set the permissions so it is only readable and writable by you, the owner.<br />
<code># chmod 600 ~/.ssh/authorized_keys<br />
# chmod 700 ~/.ssh</code></p>
<p>Restart SSH Daemon:<br />
<code># /etc/init.d/sshd restart</code></p>
<p><strong>Setup Keychain </strong><br />
Use Keychain, an SSH Agent, so that you don’t need to enter a passphrase every time you connect.  Install keychain if it is not installed yet:<br />
<code># wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm<br />
# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt<br />
# rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm<br />
# yum install keychain</code></p>
<p>We need to add keychain to start automatically.<br />
<code># vi ~/.bash_profile</code></p>
<p>Add the following line:<br />
<code>eval $(keychain --eval --agents ssh -Q --quiet <span style="color: #808080;">jesseforrest</span>_id_rsa)</code></p>
<p><strong>Test SSH Connectivity</strong><br />
You should now have SSH access to the new server through SSH keys:<br />
<code># ssh <span style="color: #808080;">jesseforrest</span>@<span style="color: #808080;">&lt;new_server_ip_address&gt;</span> -p 11985<br />
# su -</code><br />
Enter in the <em>root</em> password.</p>
<p><strong>Disabling Password Logins (only allow SSH)</strong><br />
<code># vi /etc/ssh/sshd_config</code></p>
<p>Modify to the following and then save it:<br />
<code>PasswordAuthentication no<br />
ChallengeResponseAuthentication no</code></p>
<p>Restart SSH Daemon:<br />
<code># /etc/init.d/sshd restart</code></p>
<p><strong>Update Path Variable</strong><br />
<code># vi ~/.bash_profile</code></p>
<p>Change the line &#8220;<code>PATH=$PATH:$HOME/bin</code>&#8221; to:<br />
<code>PATH=$PATH:/usr/sbin/:/sbin:$HOME/bin</code></p>
<p><strong>Optional &#8211; Update Hosts File</strong><br />
If this server is not in the Domain Name System (DNS), you must explicitly add it to the <em>/etc/hosts</em> file so that you can reference it by host name.</p>
<p>If necessary, edit /etc/hosts by running the following command:<br />
<code># vi /etc/hosts</code></p>
<p>Paste the IP address and host name of the server like this:<br />
<span style="color: #808080;"><code>&lt;ip_address&gt; &lt;host_name&gt;</code></span></p>
<p>Example:<br />
<code>173.232.244.226 mywebsite.com</code></p>
<p><strong>Setup Hostnames</strong><br />
Make sure the following is set in <code>/etc/sysconfig/network</code> with hostnames changed to the actual host name.</p>
<p><code>NETWORKING=yes<br />
HOSTNAME=<span style="color: #808080;">&lt;host_name&gt;</span></code></p>
<p>Example:<br />
<code>NETWORKING=yes<br />
HOSTNAME=mywebsite</code></p>
<p><strong>Start Cron Daemon</strong><br />
<code># /sbin/service crond start</code></p>
<p><strong>Disabling SELinux</strong><br />
<code># vim /etc/selinux/config</code></p>
<p>Verify it is set to the following:<br />
<code>SELINUX=disabled</code></p>
<p><strong>Configure the Required System Services to Start at Boot</strong><br />
<code># chkconfig httpd on<br />
# chkconfig mysqld on<br />
# chkconfig vsftpd on<br />
# chkconfig sshd on<br />
# chkconfig crond on<br />
# chkconfig iptables on</code></p>
<p><strong>Configure Apache</strong><br />
<code># vim /etc/httpd/conf/httpd.conf</code></p>
<p>Fill out the following information (replace &lt;hostname&gt; with something like mywebsite.com):</p>
<p><code>ServerAdmin support@mywebsite.com<br />
ServerName <span style="color: #808080;">&lt;hostname&gt;</span>:80<br />
NameVirtualHost *:80<br />
DirectoryIndex index.php index.html index.htm<br />
ServerTokens Prod<br />
ServerSignature Off</code></p>
<p>Make this change wherever needed:<br />
<code>Options -Indexes FollowSymLinks</code></p>
<p>Add the following line if it does not exist:<br />
<code>TraceEnable Off</code></p>
<p>Save the file.</p>
<p><code># vim /etc/httpd/conf.d/ssl.conf</code></p>
<p>Update the <code>SSLCipherSuite</code> line and change <code>+LOW</code> to <code>!LOW</code></p>
<p>Save the file.</p>
<p><strong>Restart HTTP Daemon</strong><br />
<code># /etc/init.d/httpd restart</code></p>
<p><strong>Configure VSFTP</strong><br />
<code># vim /etc/vsftpd/vsftpd.conf</code></p>
<p>Make the following changes:<br />
<code>anonymous_enable=NO<br />
xferlog_file=/var/log/vsftpd.log<br />
idle_session_timeout=600<br />
nopriv_user=nobody<br />
ascii_upload_enable=YES<br />
ftpd_banner= **** WARNING - Your actions are being logged ****<br />
pam_service_name=vsftpd<br />
userlist_enable=YES<br />
listen=YES<br />
tcp_wrappers=YES<br />
chroot_local_user=YES<br />
userlist_deny=NO</code></p>
<p>Next, we need to configure vsftpd.userlist and specify which users can FTP to the server.  This compliments the userlist_deny setting in vsftpd.conf.  When set to NO, this makes the vsftpd.userlist file a list of users that ARE allowed to log in.</p>
<p><code># vim /etc/vsftpd/user_list</code></p>
<p>We recommend removing all users so that nobody is able to FTP in.  However, if you want to allow a user to FTP in, you can add them here.</p>
<p><strong>Configure MySQL</strong><br />
<code># cd /usr/share/doc/mysql-server-</code><br />
(hit tab to get current version installed and then hit enter)</p>
<p><code># cp my-medium.cnf /etc/my.cnf</code><br />
(hit enter and then &#8220;y&#8221; to confirm)</p>
<p><code># vim /etc/my.cnf</code></p>
<p>Paste the following and save. You might want to tweak these values based on your system specifications and database requirements:</p>
<p><code>[mysqld]<br />
set-variable = max_connections=500<br />
log-slow-queries<br />
safe-show-database<br />
query-cache-type = 1<br />
query-cache-size = 150M<br />
table_cache = 512<br />
thread_cache_size=32<br />
key_buffer_size=128M<br />
long_query_time=2<br />
log_queries_not_using_indexes</code></p>
<p class="alert yellow"><strong>Note:</strong> This configuration will setup a query cache, log queries that take longer than 2 seconds to run, and log queries that are not using indexes. If you want to change any of this behavior you will need to make the appropriate changes to fit your needs.</p>
<p>Restart MySQL Daemon:<br />
<code># /etc/init.d/mysqld restart</code></p>
<p>Now the <em>root</em> password for MySQL must be set using the following command.  Do NOT use the same <em>root</em> password as the Linux <em>root</em> password.</p>
<p><code># mysqladmin -u root password "<span style="color: #888888;">&lt;password&gt;</span>"</code></p>
<p class="alert blue"><strong>Tip: </strong>Make sure to save the username and password in your PasswordSafe.</p>
<p><strong>Optional</strong><strong> – Install and Configure Memcached</strong><br />
Install the memcache daemon:<br />
<code># yum install memcached</code></p>
<p>Start the daemon:<br />
<code># /etc/init.d/memcached start</code></p>
<p>Even though memcached is running on the server, it’s not accessible from PHP without the PECL extension. So run this:<br />
<code># pecl install memcache</code></p>
<p>(Use all defaults)</p>
<p><code># vim /etc/php.ini</code><br />
Paste the following at the bottom of the file:</p>
<p><code>[memcache]<br />
extension=memcache.so</code></p>
<p><code># vim /etc/sysconfig/memcached</code></p>
<p>Make the following changes:</p>
<p><code>PORT="11986"<br />
CACHESIZE="1024"</code></p>
<p>Restart Apache<br />
<code># /etc/init.d/httpd restart</code></p>
<p>Make the service startup on reboot<br />
<code># chkconfig memcached on</code></p>
<p>Start Memcache<br />
<code># /etc/init.d/memcached start</code></p>
<p><strong>Optional</strong><strong> – Install a GoDaddy Signed SSL Certificate</strong></p>
<p>Generate private key:<br />
<code># openssl genrsa -out ca.key 2048</code></p>
<p>Copy the necessary key to the required location<br />
<code># cp ca.key /etc/pki/tls/private/<span style="color: #888888;">&lt;hostname&gt;</span>.key</code></p>
<p>Generate CSR:<br />
<code># openssl req -new -key ca.key -out ca.csr</code></p>
<p>Enter in all required information.</p>
<p>Get the contents of the CSR by running:<br />
<code># cat ca.csr</code></p>
<p>Copy all the contents into &#8220;Enter your Certificate Signing Request (CSR) below:&#8221; in GoDaddy.  Download bundle from GoDaddy and copy those files to the correct locations:</p>
<p><code># cp <span style="color: #888888;">&lt;hostname&gt;</span>.crt /etc/pki/tls/certs/<span style="color: #888888;">&lt;hostname&gt;</span>.crt<br />
# cp gd_bundle.crt /etc/pki/tls/certs/<span style="color: #888888;">&lt;hostname&gt;</span>-chain.crt</code></p>
<p>Update the Apache SSL configuration file:<br />
<code># vim +/SSLCertificateFile /etc/httpd/conf.d/ssl.conf</code></p>
<p>Change the paths to match where the Key file is stored:<br />
<code>SSLCertificateFile /etc/pki/tls/certs/<span style="color: #888888;">&lt;hostname&gt;</span>.crt</code></p>
<p>Change the path for the Certificate Key File:<br />
<code>SSLCertificateKeyFile /etc/pki/tls/private/<span style="color: #888888;">&lt;hostname&gt;</span>.key</code></p>
<p>Change the path to the intermediate bundle file:<br />
<code>SSLCertificateChainFile /etc/pki/tls/certs/<span style="color: #888888;">&lt;hostname&gt;</span>-chain.crt</code></p>
<p>Save and close</p>
<p>Restart HTTP Daemon<br />
<code># /etc/init.d/httpd restart</code></p>
<p><strong>Optional – Install a Self-Signed SSL Certificate</strong><br />
If you want to install a self-signed SSL certificate, you can follow these steps.</p>
<p>Generate private key:<br />
<code># openssl genrsa -out ca.key 1024</code></p>
<p>Generate CSR:<br />
<code># openssl req -new -key ca.key -out ca.csr</code></p>
<p>Enter in all required information</p>
<p>Generate self-signed key:<br />
<code># openssl x509 -req -days 1825 -in ca.csr -signkey ca.key -out ca.crt</code></p>
<p>Copy the files to the correct locations (do not move them if you use SELinux):<br />
<code># cp ca.crt /etc/pki/tls/certs<br />
# cp ca.key /etc/pki/tls/private/ca.key<br />
# cp ca.csr /etc/pki/tls/private/ca.csr</code></p>
<p>Update the Apache SSL configuration file:<br />
<code># vi +/SSLCertificateFile /etc/httpd/conf.d/ssl.conf</code></p>
<p>Change the paths to match where the Key file is stored:<br />
<code>SSLCertificateFile /etc/pki/tls/certs/ca.crt</code></p>
<p>Change the path for the Certificate Key File:<br />
<code>SSLCertificateKeyFile /etc/pki/tls/private/ca.key</code></p>
<p>Save and close</p>
<p>Restart HTTP Daemon<br />
<code># /etc/init.d/httpd restart</code></p>
<p><strong>Optional &#8211; Example Configuring Iptables </strong><br />
This will configure Iptables to open the following input ports: 80 (HTTP), 443 (HTTPS), 11985 (SSH). It will also open the following output ports: 80 (HTTP), 443 (HTTPS).</p>
<p><code># /sbin/iptables -P INPUT ACCEPT<br />
# /sbin/iptables -F<br />
# /sbin/iptables -A INPUT -i lo -j ACCEPT<br />
# /sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<br />
Drop packets where new incoming tcp connections are not SYN<br />
# /sbin/iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP<br />
Drop packets with incoming fragments<br />
# /sbin/iptables -A INPUT -f -j DROP<br />
Drop incoming malformed XMAS packets<br />
# /sbin/iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP<br />
Drop incoming malformed NULL packets<br />
# /sbin/iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP<br />
# /sbin/iptables -A INPUT -p tcp --dport 11985 -j ACCEPT<br />
# /sbin/iptables -A INPUT -i eth0 -p tcp -m multiport --dports 80,443 -m state --state NEW,ESTABLISHED -j ACCEPT<br />
# /sbin/iptables -A OUTPUT -o eth0 -p tcp -m multiport --sports 80,443 -m state --state ESTABLISHED -j ACCEPT<br />
# /sbin/iptables -P INPUT DROP<br />
# /sbin/iptables -P FORWARD DROP<br />
# /sbin/iptables -P OUTPUT ACCEPT</code></p>
<p><strong>Verify and Save Iptables</strong><br />
Some ports might appear in the nmap output even if you specified them restricted in iptables.  This is probably because they are being run from localhost.  To verify your iptables configuration you can run:<br />
<code># /sbin/iptables -L</code></p>
<p>Run the following if correctly configured:<br />
<code># /sbin/service iptables save</code></p>
<p>Verify only the ports you want opened are listed by running the following<br />
<code># nmap -sT -O localhost</code></p>
<p><strong>Update PHP Configuration<br />
</strong><code># vim /etc/php.ini</code></p>
<p>Make these changes:</p>
<p><code>display_errors = Off<br />
date.timezone = America/New_York<br />
html_errors = Off<br />
expose_php = Off<br />
error_log = /var/log/php_errors.log</code></p>
<p class="alert blue"><strong>Tip: </strong>Set date.timezone to whatever is applicable to your server.  A list of timezones are available on <a title="PHP's List of Supported Timezones" href="http://www.php.net/manual/en/timezones.php" target="_blank">PHP&#8217;s List of Supported Timezones</a> web page. </p>
<p>Save and quit.</p>
<p><strong>Optional &#8211; Install GeoIP</strong><br />
<code># yum -y install GeoIP GeoIP-devel<br />
# pecl install geoip<br />
# vim /etc/php.ini</code></p>
<p>Add this to end of php.ini:</p>
<p><code>[geoip]<br />
extension=geoip.so</code></p>
<p>Save and quit.</p>
<p><strong>Protect Files and Folders</strong></p>
<p>Set the correct restrictions:<br />
<code># chown -R apache:apache /var/www/html/</code></p>
<p>Write protect Apache, PHP, and MySQL configuration files:</p>
<p><code># chattr +i /etc/php.ini<br />
# chattr +i /etc/php.d/*<br />
# chattr +i /etc/my.cnf<br />
# chattr +i /etc/httpd/conf/httpd.conf</code></p>
<p><strong>Restart HTTP Daemon</strong><br />
<code># /etc/init.d/httpd restart</code></p>
<p><strong>Verifying Configuration Works</strong><br />
<code># vim /var/www/html/info.php</code></p>
<p>Enter:<br />
<code>&lt;?php phpinfo();</code></p>
<p>Save and quit.</p>
<p>Use browser to hit:<br />
<code>http://<span style="color: #808080;">&lt;Server_IP_Address&gt;</span>/info.php</code></p>
<p><strong>Optional</strong><strong> – Install locate and updatedb on CentOS</strong></p>
<p><code># yum install mlocate<br />
# /etc/cron.daily/mlocate.cron</code></p>
<p><strong>References<br />
</strong><em><a href="http://www.rayheffer.com/36/building-a-secure-web-server-with-centos-5-part-1/">http://www.rayheffer.com/36/building-a-secure-web-server-with-centos-5-part-1/<br />
</a></em><a href="https://wiki.archlinux.org/index.php/SSH_Keys"><em>https://wiki.archlinux.org/index.php/SSH_Keys</em></a></p>
<p>&nbsp;</p>
<p>The post <a href="http://jesseforrest.name/setup-a-production-centos-lamp-web-server/212">Setup a Production CentOS LAMP Web Server</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/setup-a-production-centos-lamp-web-server/212/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Convert Strings into a URL Friendly Format Using PHP</title>
		<link>http://jesseforrest.name/convert-strings-into-url-friendly-format-php/159</link>
		<comments>http://jesseforrest.name/convert-strings-into-url-friendly-format-php/159#comments</comments>
		<pubDate>Mon, 11 Apr 2011 01:32:40 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=159</guid>
		<description><![CDATA[<p>This function converts strings into a format that can be used in URLs. For example, the string &#8220;Mike&#8217;s Karate School&#8221; would be returned as &#8220;mikes-karate-school&#8221;. This function is recommended to be used on non-multibyte character sets. So this is not&#8230;</p><p>The post <a href="http://jesseforrest.name/convert-strings-into-url-friendly-format-php/159">How to Convert Strings into a URL Friendly Format Using PHP</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>This function converts strings into a format that can be used in URLs.  For example, the string &#8220;Mike&#8217;s Karate School&#8221; would be returned as &#8220;mikes-karate-school&#8221;.  This function is recommended to be used on non-multibyte character sets.  So this is not recommended for UTF-8, since certain PHP functions (like strtolower) should not be used on multibyte strings.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Returns a string in a URL friendly format.
 * @param string $str The input string.
 * @return string The URL friendly string.
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> getUrlFriendlyString<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #666666; font-style: italic;">// convert spaces to '-', remove characters that are not alphanumeric</span>
   <span style="color: #666666; font-style: italic;">// or a '-', combine multiple dashes (i.e., '---') into one dash '-'.</span>
   <span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ereg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;[-]+&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">ereg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;[^a-z0-9-]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span>
      <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">return</span> <span style="color: #000088;">$str</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The post <a href="http://jesseforrest.name/convert-strings-into-url-friendly-format-php/159">How to Convert Strings into a URL Friendly Format Using PHP</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/convert-strings-into-url-friendly-format-php/159/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Joimo&#8217;s Expansion into New Activities</title>
		<link>http://jesseforrest.name/joimos-expanding-into-new-activities/153</link>
		<comments>http://jesseforrest.name/joimos-expanding-into-new-activities/153#comments</comments>
		<pubDate>Mon, 11 Apr 2011 00:55:01 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=153</guid>
		<description><![CDATA[<p>In 2011, Joimo took a big leap and started offering a variety of different sports and recreational activities.  I&#8217;m happy to say that we now offer bowling, dodgeball, indoor soccer, outdoor soccer,  and kickball! Photo from San Diego Co-ed Dodgeball!</p><p>The post <a href="http://jesseforrest.name/joimos-expanding-into-new-activities/153">Joimo&#8217;s Expansion into New Activities</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>In 2011, <a title="Joimo" href="http://www.joimo.com" target="_blank">Joimo</a> took a big leap and started offering a variety of different sports and recreational activities.  I&#8217;m happy to say that we now offer bowling, dodgeball, indoor soccer, outdoor soccer,  and kickball!</p>
<p><a href="http://jesseforrest.name/wp-content/uploads/2011/04/joimo-dodgeball.png"><img class="aligncenter size-full wp-image-152" title="Joimo Dodgeball" src="http://jesseforrest.name/wp-content/uploads/2011/04/joimo-dodgeball.png" alt="Joimo Dodgeball" width="599" height="215" /></a></p>
<p style="text-align: center;">Photo from San Diego Co-ed Dodgeball!</p>
<p>The post <a href="http://jesseforrest.name/joimos-expanding-into-new-activities/153">Joimo&#8217;s Expansion into New Activities</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/joimos-expanding-into-new-activities/153/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log Manager: COM Port Card Logging Software Written in Visual Basic</title>
		<link>http://jesseforrest.name/log-manager-com-port-card-logging-com-port-reader/109</link>
		<comments>http://jesseforrest.name/log-manager-com-port-card-logging-com-port-reader/109#comments</comments>
		<pubDate>Sun, 11 Apr 2010 08:25:27 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[com port]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[logging software]]></category>
		<category><![CDATA[manager]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vb6]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=109</guid>
		<description><![CDATA[<p>In October of 2004, I decided to take on a new project at college.  I was determined to write software that could be used in the Computer Science Major&#8217;s Lab to monitor who came in and out.  I originally began&#8230;</p><p>The post <a href="http://jesseforrest.name/log-manager-com-port-card-logging-com-port-reader/109">Log Manager: COM Port Card Logging Software Written in Visual Basic</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">In <strong>October of 2004</strong>, I decided to take on a new project at college.  I was determined to write software that could be used in the Computer Science Major&#8217;s Lab to monitor who came in and out.  I originally began the project in an attempt to learn how to write software that could interpret the data that was received from a card-scanner via a COM port.  Then my interest grew and I decided to write a fully functional Log Manager.  I knew a variety of other labs wanted a way to log who was coming in and out of their lab, so I figured it was a good project to take on.</p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong> </strong></p>
<p style="text-align: left;"><strong><a href="http://jesseforrest.name/wp-content/uploads/2010/04/Log-Manager-Screen-Shot-2.png"><img class="size-medium wp-image-111   aligncenter" title="Log Manager  Screen Shot" src="http://jesseforrest.name/wp-content/uploads/2010/04/Log-Manager-Screen-Shot-2-300x130.png" alt="" width="300" height="130" /></a></strong><strong><br />
Download Log Manager Version 1.3:</strong><a title="Log Manager Installer" href="http://jesseforrest.name/wp-content/uploads/2010/04/LogManagerSetup.zip" target="_blank"><br />
Installer</a> <span style="color: #c0c0c0;">|</span> <a href="http://jesseforrest.name/wp-content/uploads/2010/04/LogManagerSource.zip">VB 6 Source Code</a><strong></p>
<p></strong><strong>Log Files:</strong><br />
A new log file is created each day. Log Manager writes the log information to text files in the specified <em>Log Destination</em>.  It&#8217;s capable of saving the log files to a certain folder on a server if  necessary. By default <em>Log Destination</em> is set to &#8220;C:\<em>INSTALL_PATH</em>\LogDestination\&#8221;. Here is an example of the automatic file creation:</p>
<p><a href="http://jesseforrest.name/wp-content/uploads/2010/04/Log-Manager-Folder.png"></a><img class="aligncenter size-full wp-image-124" style="border: 0pt none;" title="Log Manager Folder" src="http://jesseforrest.name/wp-content/uploads/2010/04/Log-Manager-Folder1.png" alt="" width="311" height="199" /></p>
<p>Below is an example of the contents of a log file.  It is a comma delimited file,  so it can easily be opened in Excel or similar program.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-125" style="border: 0pt none;" title="Log Manager Example Log" src="http://jesseforrest.name/wp-content/uploads/2010/04/Log-Manager-Example-Log.png" alt="" width="480" height="132" /></p>
<p>The post <a href="http://jesseforrest.name/log-manager-com-port-card-logging-com-port-reader/109">Log Manager: COM Port Card Logging Software Written in Visual Basic</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/log-manager-com-port-card-logging-com-port-reader/109/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Original Thoughts, Before Joimo Came Along</title>
		<link>http://jesseforrest.name/my-original-thoughts-before-joimo-came-along/105</link>
		<comments>http://jesseforrest.name/my-original-thoughts-before-joimo-came-along/105#comments</comments>
		<pubDate>Fri, 09 Apr 2010 17:32:12 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[designs]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Joimo]]></category>
		<category><![CDATA[joinie]]></category>
		<category><![CDATA[WeWink]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=105</guid>
		<description><![CDATA[<p>Before Joimo.com came to be, here were a couple of my other concepts..</p><p>The post <a href="http://jesseforrest.name/my-original-thoughts-before-joimo-came-along/105">My Original Thoughts, Before Joimo Came Along</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Before <a title="Joimo" href="http://www.joimo.com" target="_blank">Joimo.com</a> came to be, here were a couple of my other concepts..
<a href='http://jesseforrest.name/my-original-thoughts-before-joimo-came-along/105/joinie' title='joinie'><img width="150" height="150" src="http://jesseforrest.name/wp-content/uploads/2010/04/joinie-150x150.png" class="attachment-thumbnail" alt="joinie" /></a>
<a href='http://jesseforrest.name/my-original-thoughts-before-joimo-came-along/105/we-wink' title='WeWink'><img width="150" height="150" src="http://jesseforrest.name/wp-content/uploads/2010/04/we-wink-150x150.png" class="attachment-thumbnail" alt="WeWink" /></a>
</p>
<p>The post <a href="http://jesseforrest.name/my-original-thoughts-before-joimo-came-along/105">My Original Thoughts, Before Joimo Came Along</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/my-original-thoughts-before-joimo-came-along/105/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Convert URL&#8217;s in Text to Links Using PHP</title>
		<link>http://jesseforrest.name/how-to-convert-urls-in-text-to-links-using-php/85</link>
		<comments>http://jesseforrest.name/how-to-convert-urls-in-text-to-links-using-php/85#comments</comments>
		<pubDate>Wed, 07 Apr 2010 03:39:49 +0000</pubDate>
		<dc:creator>Jesse Forrest</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[preg_replace_callback]]></category>
		<category><![CDATA[Text]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://jesseforrest.name/?p=85</guid>
		<description><![CDATA[<p>The function below takes in a string of text and converts all URL&#8217;s that start with &#34;http://&#34; to an HTML link. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19&#8230;</p><p>The post <a href="http://jesseforrest.name/how-to-convert-urls-in-text-to-links-using-php/85">How to Convert URL&#8217;s in Text to Links Using PHP</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>The function below takes in a string of text and converts all URL&#8217;s that start with &quot;http://&quot; to an HTML link.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Returns the string with URL's replaced with actual HTML link tags
 * @param string $string The string to parse for URL's
 * @param boolean $noFollow Whether or not to add the rel=&quot;nofollow&quot; 
 * attribute to the tag
 * @param boolean $newWindow Whether or not to make the link open in a new
 * window
 * @return string
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> getStringWithUrlLinks<span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #339933;">,</span> <span style="color: #000088;">$noFollow</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$newWindow</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/(http:\/\/[^\s]+)/'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace_callback</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">create_function</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'$matches'</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'return \'&lt;a href=&quot;\'.$matches[0].\'&quot; '</span>
			<span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$noFollow</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">' rel=&quot;nofollow&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span>
			<span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$newWindow</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">' target=&quot;_blank&quot;'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span>
			<span style="color: #339933;">.</span> <span style="color: #0000ff;">'&gt;\'.$matches[0].\'&lt;/a&gt;\';'</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Here is an example usage:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>21
22
23
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'This is my website: http://jesseforrest.name/'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$stringHtml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">nl2br</span><span style="color: #009900;">&#40;</span>getStringWithUrlLinks<span style="color: #009900;">&#40;</span><span style="color: #990000;">htmlentities</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$stringHtml</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>The example above would output:</strong><br />
This is my website: <a href="http://jesseforrest.name/">http://jesseforrest.name/</a></p>
<p>The post <a href="http://jesseforrest.name/how-to-convert-urls-in-text-to-links-using-php/85">How to Convert URL&#8217;s in Text to Links Using PHP</a> appeared first on <a href="http://jesseforrest.name">Jesse Forrest</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jesseforrest.name/how-to-convert-urls-in-text-to-links-using-php/85/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
