<?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>Life and tech</title>
	<atom:link href="http://blog.andyhunt.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.andyhunt.info</link>
	<description></description>
	<lastBuildDate>Tue, 02 Apr 2013 09:59:17 +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>Using syslog for your PHP application logging</title>
		<link>http://blog.andyhunt.info/2012/10/05/using-syslog-for-your-php-application-logging/</link>
		<comments>http://blog.andyhunt.info/2012/10/05/using-syslog-for-your-php-application-logging/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 14:29:14 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=147</guid>
		<description><![CDATA[In the past I have created custom log files for my PHP applications, mainly because I'd never bothered to read up on syslog and I wasn't using it for major stuff. This time I decided to do the reading and syslog really does have lots of benefits and is just as quick to set up [...]]]></description>
				<content:encoded><![CDATA[<p>In the past I have created custom log files for my PHP applications, mainly because I'd never bothered to read up on syslog and I wasn't using it for major stuff.</p>
<p>This time I decided to do the reading and syslog really does have lots of benefits and is just as quick to set up as custom logging.</p>
<p>Anyway, I found this nice overview and examples of how you can use syslog with your application.</p>
<p>Check it out - <a href="http://www.adayinthelifeof.nl/2011/01/12/using-syslog-for-your-php-applications/" title="Using syslog for your php applications" target="_blank">Using syslog for your php applications</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2012/10/05/using-syslog-for-your-php-application-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking back</title>
		<link>http://blog.andyhunt.info/2012/07/20/looking-back/</link>
		<comments>http://blog.andyhunt.info/2012/07/20/looking-back/#comments</comments>
		<pubDate>Fri, 20 Jul 2012 20:52:54 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=138</guid>
		<description><![CDATA[It's been a good while since my last post and as I look back over the posts I've made I realise that in only one post have I actually talked about coding. The post I am talking about is the one on using PHP and Curl to login to a website to download content. The [...]]]></description>
				<content:encoded><![CDATA[<p>It's been a good while since my last post and as I look back over the posts I've made I realise that in only one post have I actually talked about coding. The post I am talking about is the one on using PHP and Curl to login to a website to download content. The rest of the posts have been about troubles I've had while setting up my dev environment on OSX lion. </p>
<p>While this info has already been useful to some people and probably will continue to help people it wasn't really the reason that I set up the blog. As I learnt new things I wanted to share them but unfortunately due to various things (one being a new role) I have been very busy and haven't had the time or the content to post. </p>
<p>As a newly appointed development manager I feel that this blog might end up going a different direction to the original plan.</p>
<p>One post I do hope to make soon is related to recruitment of PHP developers. This seemingly simple task has proved challenging and I feel I have some advice to give anyone going through the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2012/07/20/looking-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP memcached on OSX Lion</title>
		<link>http://blog.andyhunt.info/2012/02/22/php-memcached-on-osx-lion/</link>
		<comments>http://blog.andyhunt.info/2012/02/22/php-memcached-on-osx-lion/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 13:30:01 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=131</guid>
		<description><![CDATA[Having set up the PHP memcache extension on my mac yesterday I now need the PECL memcached extension to use with Zend_Cache. This one was a little more involved than yesterday so here is a quick list of things you'll need to do. My first instinct was to use PECL to get the extension but [...]]]></description>
				<content:encoded><![CDATA[<p>Having set up the PHP memcache extension on my mac yesterday I now need the PECL memcached extension to use with Zend_Cache. This one was a little more involved than yesterday so here is a quick list of things you'll need to do.</p>
<p>My first instinct was to use PECL to get the extension but doing that told me that there was an unmet dependancy so it couldn't be installed. The missing dependancy was libmemcached, here's what you need to do to get libmemcached setup:</p>
<p>First go to <a href="https://launchpad.net/libmemcached/+download" target="_blank">https://launchpad.net/libmemcached/+download</a> and download the latest libmemcached (1.0.4 at the time of writing), once downloaded extract the archive and then open up a terminal window and <tt>cd</tt> to the new <tt>libmemcached-1.x.x</tt> directory. Now enter the commands below into the terminal window one at a time.</p><pre class="crayon-plain-tag">./configure
make
sudo make install</pre><p></p>
<p>These commands will each take some time to run and while they are running you will see lots of output in the terminal window. What these commands do are <tt>./configure</tt> configures the package for your system, <tt>make</tt> compiles the code into a binary that is usable by the system and <tt>sudo make install</tt> installs the built files onto your system (which in this case is moving the libmemcached library into place on your system).</p>
<p>Now that we have solved the dependancy issue we can now run PECL again:</p><pre class="crayon-plain-tag">sudo pecl install memcached</pre><p></p>
<p>At the end of this process the script will remind you to configure PHP to use the new extension, if you are unsure on how to do this you can follow the end of <a href="http://blog.andyhunt.info/2012/02/21/php-memcache-extension-on-osx-lion/" title="PHP memcache extension on OSX Lion">yesterdays post</a> - but dont forget to use memcache<strong>d</strong> instead of memcache.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2012/02/22/php-memcached-on-osx-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP memcache extension on OSX Lion</title>
		<link>http://blog.andyhunt.info/2012/02/21/php-memcache-extension-on-osx-lion/</link>
		<comments>http://blog.andyhunt.info/2012/02/21/php-memcache-extension-on-osx-lion/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 17:22:04 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=123</guid>
		<description><![CDATA[Today I needed the PHP memcache extension on my Mac OSX Lion 10.7.3 development machine for a project I'm working on. I was pleased to find out that this was a nice and easy one to get up and running. Open up a terminal window and run the command below, this will tell PECL to [...]]]></description>
				<content:encoded><![CDATA[<p>Today I needed the PHP memcache extension on my Mac OSX Lion 10.7.3 development machine for a project I'm working on. I was pleased to find out that this was a nice and easy one to get up and running.</p>
<p>Open up a terminal window and run the command below, this will tell PECL to download, build and install the extension.</p><pre class="crayon-plain-tag">sudo pecl install memcache</pre><p>Now that the extension is installed on your system, you need to enable it in your PHP configuration file. On a standard system the php.ini file can be found at <tt>/etc/php.ini</tt>. Open the file and scroll down to the extensions section, at the bottom of this section add the line <tt>extension=memcache.so</tt> and then save and close the file.</p>
<p>After that, all that is required is for you to restart Apache and enjoy your new extension</p><pre class="crayon-plain-tag">sudo apachectl restart</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2012/02/21/php-memcache-extension-on-osx-lion/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Absinthe iPhone 4S Jailbreak &#8211; white/blank icons</title>
		<link>http://blog.andyhunt.info/2012/01/23/absinthe-iphone-4s-jailbreak-whiteblank-icons/</link>
		<comments>http://blog.andyhunt.info/2012/01/23/absinthe-iphone-4s-jailbreak-whiteblank-icons/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 16:02:15 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Jailbreak]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[A5]]></category>
		<category><![CDATA[Absinthe]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=114</guid>
		<description><![CDATA[I recently jail broke my iPhone 4S, I used ChronicDev's Absinthe tool on the day it was released. The jailbreak didn't go that smoothly as I had to attempt it a few times and when it did finally complete I had a blank icon (white icon), for me the app that had the blank icon [...]]]></description>
				<content:encoded><![CDATA[<p>I recently jail broke my iPhone 4S, I used ChronicDev's Absinthe tool on the day it was released. The jailbreak didn't go that smoothly as I had to attempt it a few times and when it did finally complete I had a blank icon (white icon), for me the app that had the blank icon was the Phone app, everything still worked but it was ugly and annoying.</p>
<p>I lived with it for a few days because I was busy but eventually decided to try again with the jailbreak. A couple of days had passed and ChronicDev had released an updated version of Absinthe, version 2. I had done a bit of reading to try and find out what might have caused the blank icon issue and there wasn't much info available.</p>
<p>I decided that I would backup my device (very important), restore to stock 5.0.1 and then do the jailbreak on the clean phone before restoring from my backup. I did this and when the jail break finished this time I had a blank Maps icon - arrrggh! One thing I had seen on twitter (and as a message on Absinthe!) was not to touch the device while the jailbreak was in progress, however each time I hadn't been able to resist unlocking the phone after the first reboot, this was because a device passcode (not SIM passcode) can cause the jailbreak to fail.</p>
<h3>3rd Time Lucky...</h3>
<p>I decided to try one last time, so I restored to stock 5.0.1 again (without loading all my stuff and settings back on to it - so no device passcode lock) and then ran Absinthe 2 again. I clicked the Jailbreak button and then stepped away and made myself a coffee, buy the time I got back Absinthe had finished and all that was left was for me to run the new Absinthe app that was on my iPhone (or go into settings and toggle on VPN). At this point I was already confident that this time was a success as none of my apps were blank so I opened the Absinthe app on my phone and after a few moments the phone rebooted and when it came back online there was the new Cydia icon on my springboard and best of all no white icons - yay!</p>
<p>After that all that was left was to load up iTunes and restore from the backup I had done earlier. The backup restore and then a sync and everything was back to normal and it was off to Cydia for some tweaking.</p>
<p>I hope this helps some of the other people that had the blank icon issue as there really was nothing useful about when I was trying to find a solution.</p>
<p><strong>Also one last thing, if you are going to follow the above and try and fix your blank icon issue then make sure you do it before Apple close the signing window on 5.0.1.</strong></p>
<p>Happy hacking....</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2012/01/23/absinthe-iphone-4s-jailbreak-whiteblank-icons/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using PHP and CURL to log in to a website</title>
		<link>http://blog.andyhunt.info/2011/12/21/using-php-and-curl-to-log-in-to-a-website/</link>
		<comments>http://blog.andyhunt.info/2011/12/21/using-php-and-curl-to-log-in-to-a-website/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 13:37:10 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cURL]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=108</guid>
		<description><![CDATA[The other day I wanted to automate some downloading from a username and password secured website. I wrote a quick script and it is working like a dream, below is the CURL part of the code that does the logging in and download. [crayon-51a15248e5500/]]]></description>
				<content:encoded><![CDATA[<p>The other day I wanted to automate some downloading from a username and password secured website. I wrote a quick script and it is working like a dream, below is the CURL part of the code that does the logging in and download.</p>
<p></p><pre class="crayon-plain-tag">$username = 'myuser';
$password = 'mypass';
$loginUrl = 'http://www.example.com/login/';

//init curl
$ch = curl_init();

//Set the URL to work with
curl_setopt($ch, CURLOPT_URL, $loginUrl);

// ENABLE HTTP POST
curl_setopt($ch, CURLOPT_POST, 1);

//Set the post parameters
curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&amp;pass='.$password);

//Handle cookies for the login
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');

//Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
//not to print out the results of its query.
//Instead, it will return the results as a string return value
//from curl_exec() instead of the usual true/false.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

//execute the request (the login)
$store = curl_exec($ch);

//the login is now done and you can continue to get the
//protected content.

//set the URL to the protected file
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/protected/download.zip');

//execute the request
$content = curl_exec($ch);

//save the data to disk
file_put_contents('~/download.zip', $content);</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2011/12/21/using-php-and-curl-to-log-in-to-a-website/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PECL UUID extension on Mac OSX</title>
		<link>http://blog.andyhunt.info/2011/12/01/pecl-uuid-extension-on-mac-osx/</link>
		<comments>http://blog.andyhunt.info/2011/12/01/pecl-uuid-extension-on-mac-osx/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 15:20:05 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[10.7]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[PHP UUID module]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=104</guid>
		<description><![CDATA[Today I needed to set up the PECL UUID PHP module on my Mac OSX 10.7 Lion development machine, I needed it for a project that I'm working on. My first reaction was to fire up terminal and run sudo pecl install uuid. It all looked good for a moment but then came to a [...]]]></description>
				<content:encoded><![CDATA[<p>Today I needed to set up the PECL UUID PHP module on my Mac OSX 10.7 Lion development machine, I needed it for a project that I'm working on.</p>
<p>My first reaction was to fire up terminal and run <tt>sudo pecl install uuid</tt>. It all looked good for a moment but then came to a grinding halt when 'make' failed.</p>
<p>Here is the error for reference (and for those searching snippets of it):</p><pre class="crayon-plain-tag">cc -I. -I/private/tmp/pear/temp/uuid -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootEEpqkn/uuid-1.0.2/include -I/private/tmp/pear/temp/pear-build-rootEEpqkn/uuid-1.0.2/main -I/private/tmp/pear/temp/uuid -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/uuid/uuid.c &nbsp;-fno-common -DPIC -o .libs/uuid.o
/private/tmp/pear/temp/uuid/uuid.c: In function &lsquo;zm_startup_uuid&rsquo;:
/private/tmp/pear/temp/uuid/uuid.c:89: error: &lsquo;UUID_TYPE_DCE_TIME&rsquo; undeclared (first use in this function)
/private/tmp/pear/temp/uuid/uuid.c:89: error: (Each undeclared identifier is reported only once
/private/tmp/pear/temp/uuid/uuid.c:89: error: for each function it appears in.)
/private/tmp/pear/temp/uuid/uuid.c:90: error: &lsquo;UUID_TYPE_DCE_RANDOM&rsquo; undeclared (first use in this function)
/private/tmp/pear/temp/uuid/uuid.c: In function &lsquo;zif_uuid_create&rsquo;:
/private/tmp/pear/temp/uuid/uuid.c:168: error: &lsquo;UUID_TYPE_DCE_TIME&rsquo; undeclared (first use in this function)
/private/tmp/pear/temp/uuid/uuid.c:171: error: &lsquo;UUID_TYPE_DCE_RANDOM&rsquo; undeclared (first use in this function)
/private/tmp/pear/temp/uuid/uuid.c:181: warning: format &lsquo;%d&rsquo; expects type &lsquo;int&rsquo;, but argument 4 has type &lsquo;long int&rsquo;
make: *** [uuid.lo] Error 1
ERROR: `make' failed</pre><p>After a bit of googling I found out what the problem was and a solution to it. The full explanation and solution can be found here:</p>
<p><a href="http://unrealexpectations.com/blog/2010/04/mamp-pecluuid-module-working-on-snow-leopard/" target="_blank">http://unrealexpectations.com/blog/2010/04/mamp-pecluuid-module-working-on-snow-leopard/</a></p>
<p>I can confirm that the patch and build worked on my set up (OSX 10.7 Loin) and I hope by spreading the word it some more people out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2011/12/01/pecl-uuid-extension-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and setting up PEAR</title>
		<link>http://blog.andyhunt.info/2011/11/30/installing-and-setting-up-pear/</link>
		<comments>http://blog.andyhunt.info/2011/11/30/installing-and-setting-up-pear/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 18:28:28 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[10.7]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[PEAR]]></category>
		<category><![CDATA[PHPUnit]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=99</guid>
		<description><![CDATA[This post will help you get PEAR installed and up and running on your machine, there are two options to below, one describes an OXS Lion specific setup and the other is more generic. Installing on OSX 10.7 Lion OSX Lion already has the PEAR install bundle so there is no need to download it, open [...]]]></description>
				<content:encoded><![CDATA[<p>This post will help you get PEAR installed and up and running on your machine, there are two options to below, one describes an OXS Lion specific setup and the other is more generic.</p>
<h2>Installing on OSX 10.7 Lion</h2>
<p>OSX Lion already has the PEAR install bundle so there is no need to download it, open up a terminal window and enter the following commands:</p><pre class="crayon-plain-tag">cd /usr/lib/php
sudo php install-pear-nozlib.phar</pre><p>&nbsp;</p>
<h2>Downloading and installing</h2>
<p>Do not follow this part if you have just done the above steps. Otherwise enter the below into a terminal window:</p><pre class="crayon-plain-tag">curl http://pear.php.net/go-pear.phar &amp;gt; go-pear.php
sudo php -q go-pear.php</pre><p>It will ask you to enter a new installation base ($prefix). I recommend you use <tt>/usr/local</tt></p>
<p>&nbsp;</p>
<h2>Configuring PHP include path</h2>
<p>Edit <tt>/etc/php.ini</tt> and find the line: <tt>;include_path = ".:/php/includes"</tt>. Uncomment it (remove the ; at the beginning) and add the PEAR path to it. It should end up looking similar to the below:</p><pre class="crayon-plain-tag">include_path = &quot;.:/usr/lib/php/pear&quot;</pre><p>&nbsp;</p>
<h2>Update PEAR</h2>
<p>Now to update the install enter the 3 commands below into the terminal window:</p>
<p></p><pre class="crayon-plain-tag">sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade-all</pre><p></p>
<p>&nbsp;</p>
<h2>Install PHPUnit</h2>
<p>Just for good measure you will probably also want to install PHPUnit, if you do then execute the below command and your ready to go.</p><pre class="crayon-plain-tag">sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear install pear.phpunit.de/PHPUnit
sudo pear install phpunit/DbUnit --alldeps</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2011/11/30/installing-and-setting-up-pear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install MySQL 5.1 Server on OSX Lion</title>
		<link>http://blog.andyhunt.info/2011/11/30/install-mysql-5-1-server-on-osx-lion/</link>
		<comments>http://blog.andyhunt.info/2011/11/30/install-mysql-5-1-server-on-osx-lion/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 12:47:02 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[10.7]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=80</guid>
		<description><![CDATA[So I had to get MySQL set up on my OSX Lion MacBook Pro after the recent format and upgrade to Lion. It was easier than i expected but I thought that it was still worth a post anyway. First off, head over to the MySQL site and download the Mac pre-compiles binary of MySQL [...]]]></description>
				<content:encoded><![CDATA[<p>So I had to get MySQL set up on my OSX Lion MacBook Pro after the recent format and upgrade to Lion. It was easier than i expected but I thought that it was still worth a post anyway.</p>
<p>First off, head over to the MySQL site and download the Mac pre-compiles binary of MySQL Community Server 5.1.x (the latest download says it's for OSX 10.6 Snow Leopard but it works fine with 10.7 Lion). Download the latest DMG available, this can be found here <a title="MySQL Server 5.1 Download" href="http://dev.mysql.com/downloads/mysql/5.1.html" target="_blank">http://dev.mysql.com/downloads/mysql/5.1.html</a>.</p>
<p>When the download finishes, open the disk image and install the main package file (mysql-5.1.xx-osx10.6-x86_64.pkg), when that finishes double-click on the preferences pane (MYSQL.prefpane file) file to install that into the System Preferences menu. If you would like the database server to start on boot then you also need to install the MySQLStartupItem.pkg file.</p>
<p>Once this is done you can then open System Preferences and under the "Other" heading you will find your new MySQL preferences, from here you can start and stop the server and also enable/disable startup option.</p>
<p>Now if you are going to us mysql from terminal then you will want to add the mysql binaries path to your $PATH shell variable. To do this edit your .bash_profile file and add /usr/local/mysql/bin to the PATH variable. Your file might look like this:</p><pre class="crayon-plain-tag">export PATH=~/bin:/usr/local/bin:/usr/local/mysql/bin:$PATH</pre><p>When all the above is done you can start setting up the server. We now need to secure the server by setting some defaults and removing some test stuff, to do this open a terminal and run:</p><pre class="crayon-plain-tag">sudo /usr/local/mysql/bin/mysql_secure_installation</pre><p>It will ask for your password (because of sudo) and then will ask you some questions about changes it wishes to make. Enter a password for root and then you can accept the defaults for the rest of the questions if you are unsure.</p>
<p>One last thing, if you intend to use MySQL with PHP then you will need to update your php.ini file to change the location that is set for the mysql.sock file. Open php.ini and find and replace /var/mysql/mysql.sock with /tmp/mysql.sock. This is because the MySQL default location for the mysql.sock file is in /tmp</p>
<p>Hope it helps <img src='http://blog.andyhunt.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2011/11/30/install-mysql-5-1-server-on-osx-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache SSL on Mac OSX Lion 10.7</title>
		<link>http://blog.andyhunt.info/2011/11/26/apache-ssl-on-max-osx-lion-10-7/</link>
		<comments>http://blog.andyhunt.info/2011/11/26/apache-ssl-on-max-osx-lion-10-7/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 18:53:25 +0000</pubDate>
		<dc:creator>Andy Hunt</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[10.7]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Vhosts]]></category>

		<guid isPermaLink="false">http://blog.andyhunt.info/?p=13</guid>
		<description><![CDATA[I have recently upgraded to OSX Lion from Snow Leopard, whilst setting up my development environment I needed to configure the built in Apache server to support SSL. Below are instructions on what needed to be done. Please note that the below is based on a clean install of OSX 10.7.2 and if you did [...]]]></description>
				<content:encoded><![CDATA[<p>I have recently upgraded to OSX Lion from Snow Leopard, whilst setting up my development environment I needed to configure the built in Apache server to support SSL. Below are instructions on what needed to be done. Please note that the below is based on a clean install of OSX 10.7.2 and if you did an upgrade or are running a different version of Lion then the instructions below may need to be tweaked to suit your setup.</p>
<p>&nbsp;</p>
<h2>Generate a host key</h2>
<p>First off we'll make a home for the new SSL files. I used /private/etc/apache2/ssl. We need to change to the new directory and then run a ssh-keygen command to create the server key file. Open up a terminal window  and enter the commands below.</p><pre class="crayon-plain-tag">mkdir /private/etc/apache2/ssl
cd /private/etc/apache2/ssl
sudo ssh-keygen -f server.key</pre><p>&nbsp;</p>
<h2>Generate a certificate request file</h2>
<p>This command creates a certificate request file. A certificate request file contains information about your organisation that will be used in the SSL certificate. You will be asked various questions, fill these in as appropriate or leave blank. <strong>Please note that you shouldn't set a pass phrase on the certificate, just leave this blank when it asks for a pass phrase.</strong></p><pre class="crayon-plain-tag">sudo openssl req -new -key server.key -out request.csr</pre><p>&nbsp;</p>
<h2>Create the SSL certificate</h2>
<p>Create a self signed SSL certificate using the request file.</p><pre class="crayon-plain-tag">sudo openssl x509 -req -days 365 -in request.csr -signkey server.key -out server.crt</pre><p>&nbsp;</p>
<h2>Configure Apache</h2>
<p><strong>Create a backup of /private/etc/apache2/httpd.conf.</strong></p>
<p>In /private/etc/apache2/httpd.conf, make sure the SSL module is enabled (remove the # from the start of the line)</p><pre class="crayon-plain-tag">LoadModule ssl_module libexec/apache2/mod_ssl.so</pre><p>In the same file search for the below line and uncomment it (remove the #)</p><pre class="crayon-plain-tag">Include /private/etc/apache2/extra/httpd-ssl.conf</pre><p>Edit /private/etc/apache2/extra/httpd-ssl.conf, search for the lines that start with SSLCertificateFile, SSLCertificateKeyFile and update them to match the below:</p><pre class="crayon-plain-tag">SSLCertificateFile &quot;/private/etc/apache2/ssl/server.crt&quot;
SSLCertificateKeyFile &quot;/private/etc/apache2/ssl/server.key&quot;</pre><p>In the same file comment out (add a # to the beginning of the line) the lines that start with SSLCACertificatePath and SSLCARevocationPath</p>
<p>&nbsp;</p>
<h2>Configure the vhosts</h2>
<p>In /private/etc/apache2/httpd.conf, search for the below line and uncomment it (remove the #)</p><pre class="crayon-plain-tag">Include /private/etc/apache2/extra/httpd-vhosts.conf</pre><p>Now open /private/etc/apache2/extra/httpd-vhosts.conf and add the line below under the port 80 NameVirtualHost directive</p><pre class="crayon-plain-tag">NameVirtualHost *:443</pre><p>Now you can configure a basic SSL vhost by adding the code below to the end of the file. Please note that for the DocumentRoot you should replace it with a real path.</p><pre class="crayon-plain-tag">&lt;VirtualHost *:443&gt;
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /private/etc/apache2/ssl/server.crt
    SSLCertificateKeyFile /private/etc/apache2/ssl/server.key
    ServerName localhost
    DocumentRoot &quot;/some/website/directory/&quot;
&lt;/VirtualHost&gt;</pre><p>&nbsp;</p>
<h2>Check the config and restart Apache</h2>
<p></p><pre class="crayon-plain-tag">sudo apachectl configtest
sudo apachectl restart</pre><p>Now you can open your browser and try out your new HTTPS site</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andyhunt.info/2011/11/26/apache-ssl-on-max-osx-lion-10-7/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
		</item>
	</channel>
</rss>
