<?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>Simon Whatley &#187; MySQL</title>
	<atom:link href="http://www.simonwhatley.co.uk/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simonwhatley.co.uk</link>
	<description>The opposite of every great idea is another great idea</description>
	<lastBuildDate>Wed, 02 Nov 2011 09:28:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Secure Your WordPress Installation</title>
		<link>http://www.simonwhatley.co.uk/secure-your-wordpress-installation</link>
		<comments>http://www.simonwhatley.co.uk/secure-your-wordpress-installation#comments</comments>
		<pubDate>Wed, 11 Aug 2010 09:49:30 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[secret key]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=3731</guid>
		<description><![CDATA[Security is often an overlooked aspect of blogging, but a few minutes making sure things are secure can save you hours and hours of 'fixing' if someone decides to mess with your site.]]></description>
			<content:encoded><![CDATA[<p>Security is often an overlooked aspect of blogging, but a few minutes making sure things are secure can save you hours and hours of &#8216;fixing&#8217; if someone decides to mess with your site.</p>
<p>Here are some relatively simple steps that should help &#8216;toughen up&#8217; your WordPress installation:</p>
<h3>Don&#8217;t use the &#8220;admin&#8221; account.</h3>
<p>Either change the username via MySQL</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">UPDATE wp_users SET user_login = 'username' WHERE user_login = 'admin'</pre></div></div>

<p>*where &#8220;username&#8221; is whatever you want to call it.</p>
<p>Or, create a new/unique account with administrator privileges and delete the original admin account.</p>
<p>From WordPress 3.0 you can set the administrator username and password during the installation process, which is a good step forward.</p>
<h3>Use secure passwords.</h3>
<p>Use strong passwords to protect your website from dictionary attacks. WordPress will tell you when your password is strong (the admin interface for users has a password strength indicator).</p>
<p><a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2010/08/password-strength.png"><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2010/08/password-strength.png" alt="" title="WordPress Password Strength Meter" width="618" height="52" class="aligncenter size-full wp-image-3758" /></a></p>
<p>Don&#8217;t restrict your strong passwords to the WordPress installation, do the same for <abbr title="File Transfer Protocol">FTP</abbr>, <abbr title="Secure Shell">SSH</abbr> and MySQL as well.</p>
<h3>Update the folder permissions on your WordPress files.</h3>
<p>A good rule of thumb is to set the following permissions:</p>
<p>Files should be set to 644<br />
Folders should be set to 755</p>
<p>If these settings are too restrictive, i.e. you can&#8217;t upload files, change the permissions to increase the privileges (e.g. 775 or even 777).</p>
<p>Remember, permission levels vary depending on your specific server configuration, but you can generally set them to the desired level quite easily via <abbr title="File Transfer Protocol">FTP</abbr> or <abbr title="Secure Shell">SSH</abbr> clients.</p>
<p>For example, with SSH:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">find [your path] -type f -exec chmod 644 {} \;
find [your path] -type d -exec chmod 755 {} \;</pre></div></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Move the configuration file (wp-config.php).</h3>
<p>From WordPress 2.6 it became possible to move the configuration file up a directory and out of the WordPress root folder.</p>
<p>For example, if WordPress is located in the following directory:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">public_html/wordpress/wp-config.php</pre></div></div>

<p>You can move it to the following directory:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">public_html/wp-config.php</pre></div></div>

<p>WordPress automatically checks the parent directory if the configuration file is not found in your website&#8217;s root directory.</p>
<p>This makes it nearly impossible for anyone to access your configuration file as it now resides outside the website&#8217;s root directory.</p>
<h3>Move the wp-content directory.</h3>
<p>Like the configuration file, WordPress 2.6 added the ability to move the wp-content directory to another location.</p>
<p>Once moved, make two additions to the configuration file to identify the new location:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content');
define('WP_CONTENT_URL','http://domain.com/blog/wp-content');</pre></div></div>

<p>You may also need to define the new location for plugins:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/blog/wp-content/plugins');
define('WP_PLUGIN_URL','http://domain.com/blog/wp-content/plugins');</pre></div></div>

<p>If hackers can&#8217;t find your wp-content folder&#8217;s location, clearly it becomes far more difficult for them to hack it.</p>
<h3>Stay current with all updates.</h3>
<p>The main WordPress installation files,  plugins and themes can be updated easily via the admin interface. Make sure you do so each time a new version of either are released.</p>
<p>For plugins, the plugin change log makes it easy to see what has changed and therefore ensure compatibility with your version of WordPress.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Remove the WordPress version information from your header.</h3>
<p>Viewing source on most WordPress websites will reveal what version of WordPress the website is running.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;meta name=&quot;generator&quot; content=&quot;WordPress 3.0.1&quot; /&gt;&lt;!-- leave this for stats --&gt;</pre></div></div>

<p>This helps hackers find vulnerable blogs or determine ways to hack a particular version.</p>
<p>To remove, find the code shown below in your header.php file and delete it:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;meta name=&quot;generator&quot; content=&quot;WordPress &lt;?php bloginfo('version'); ?&gt;&quot; /&gt;&lt;!-- leave this for stats --&gt;</pre></div></div>

<p>The wp_head function also includes the WordPress version in your header. To remove, include the following line of code in your theme&#8217;s functions.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">remove_action('wp_head','wp_generator');</pre></div></div>

<h3>Use secret keys.</h3>
<p>A secret key is a hashing salt, which makes your website harder to hack by adding random elements to the password. These secret keys are found in the WordPress configuration (wp-config.php) file.</p>
<p>Visit the following URL to get the secret keys: <a href="https://api.wordpress.org/secret-key/1.1/salt/" title="WordPress secret key generator" target="_blank" rel="nofollow">https://api.wordpress.org/secret-key/1.1/salt/</a></p>
<p>Replace the following in the configuration file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('AUTH_KEY','put your unique phrase here');
define('SECURE_AUTH_KEY','put your unique phrase here');
define('LOGGED_IN_KEY','put your unique phrase here');
define('NONCE_KEY','put your unique phrase here');
define('AUTH_SALT','put your unique phrase here');
define('SECURE_AUTH_SALT','put your unique phrase here');
define('LOGGED_IN_SALT','put your unique phrase here');
define('NONCE_SALT','put your unique phrase here');</pre></div></div>

<p>With the generated keys (example only):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('AUTH_KEY','*QCT0a,T+3hxeg)ti7k}#~&lt;AQSmm&amp;x+ff=*$d:)&lt;-;+!a?yS{ArmuR-#*GyLCgI)');
define('SECURE_AUTH_KEY','[)|y._i~B5js,h3@4%M[&lt;l:DJ&amp;]Ou$2|n(e?DJ`+R4pk6um/6zS%6@@i{^N-6(4]');
define('LOGGED_IN_KEY','@+l2X{3wvy/1K[zRm|P_r;WixJ:,&gt;V&amp;JL![gyJq ?b[Wf.W|U_MKutdrL*$l][-S');
define('NONCE_KEY','T$R&gt;#*2)2kO?NIr&amp;o|&gt;[L&gt;T5%YGd^yJ+eE$7wkcL-?1v]-X*{f`Pg)NZqKU}^e8R');
define('AUTH_SALT','&lt;8JD%+O!t.F%]6RaO9L_MI&lt;w2Lw_-Bc5u_(WDdPoO0D;j9zwu*?1i{%nH/RBjF6J');
define('SECURE_AUTH_SALT','oS|EP&amp;Pm`bf8iG!C&lt;X8#yFG%8J)x G+3M`wRBtp#]7)&amp;hj}ZV/p&gt; yh-BtbBRbTk');
define('LOGGED_IN_SALT','tW4|J/m|habEJ+BTvF0PfpuiOgf-6,dIav-5K|FTM$&amp;Agy;FqDjp|5Ci7&gt;nJFD/#');
define('NONCE_SALT','T-v&amp;f++w!c%5zs2t8qH?,n,/WE&amp;uWd--o4t{FL49/4e~|e+HV+.~A?JYZ1Ev&lt;5)u');</pre></div></div>

<p>You can add or amend the secret keys at anytime. This will invalidate all existing cookies and require users to login again.</p>
<h3>Change the WordPress table prefix.</h3>
<p>You can define the WordPress database table prefix in the WordPress configuration file. By default, the prefix is set to:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$table_prefix = 'wp_';</pre></div></div>

<p>Change this to whatever you prefer.</p>
<p>If you already have a version of WordPress installed, you will need to manually amend the database table names in MySQL, or do a clean install and data import.</p>
<h3>Force <abbr title="Secure Sockets Layer">SSL</abbr> on login and admin access.</h3>
<p>Set the following option in the WordPress configuration file to force <abbr title="Secure Sockets Layer">SSL</abbr> (<abbr title="Secure HyperText Transfer Protocol">HTTPS</abbr>) on the login and admin screens.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define('FORCE_SSL_LOGIN',true);
define('FORCE_SSL_ADMIN',true);</pre></div></div>

<h3>Use <abbr title="Internet Protocol">IP</abbr> lockdown on the wp-admin directory.</h3>
<p>Create an <code>.htaccess</code> file in your wp-admin directory with the following lines of code:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName &quot;Access Control&quot;
AuthType Basic
order deny, allow
deny from all
#IP whitelist
allow from 72.14.207.99
allow from 216.239.51.99</pre></div></div>

<p>Where the <abbr title="Internet Protocol">IP</abbr> address lines are whatever your chosen <abbr title="Internet Protocol">IP</abbr> addresses are. Only users with these <abbr title="Internet Protocol">IP</abbr> addresses will have access to the wp-admin folder and hence the admin part of the blog.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><strong>Resources:</strong></p>
<ul>
<li><a href="http://codex.wordpress.org/Hardening_WordPress" title="WordPress Codex: Hardening WordPress" target="_blank" rel="nofollow">http://codex.wordpress.org/Hardening_WordPress</a></li>
<li><a href="http://codex.wordpress.org/Changing_File_Permissions" title="WordPress Codex: Changing File Permissions" target="_blank" rel="nofollow">http://codex.wordpress.org/Changing_File_Permissions</a></li>
<li><a href="http://codex.wordpress.org/Editing_wp-config.php" title="WordPress Codex: Editing the WordPress Configuration File" target="_blank" rel="nofollow">http://codex.wordpress.org/Editing_wp-config.php</a></li>
<li><a href="http://codex.wordpress.org/htaccess_for_subdirectories" title="WordPress Codex: Htaccess for Subdirectories" target="_blank" rel="nofollow">http://codex.wordpress.org/htaccess_for_subdirectories</a></li>
</ul>
<p>If you have any more suggestions, that don&#8217;t necessitate plugins, feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/secure-your-wordpress-installation/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Installing MySQL on Mac OSX 10.6 (Snow Leopard)</title>
		<link>http://www.simonwhatley.co.uk/installing-mysql-on-mac-osx-10-6-snow-leopard</link>
		<comments>http://www.simonwhatley.co.uk/installing-mysql-on-mac-osx-10-6-snow-leopard#comments</comments>
		<pubDate>Wed, 31 Mar 2010 22:20:42 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=2194</guid>
		<description><![CDATA[If you’re comfortable with installing applications on your Mac and are reasonably familiar with MySQL, installing MySQL on Snow Leopard should be relatively simple. Here are the simple steps you need to do to get MySQL up and running on your local machine.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re comfortable with installing applications on your Mac and are reasonably familiar with MySQL, installing MySQL on Snow Leopard should be relatively simple.</p>
<ol>
<li>Download the Mac OSX disk image from the MySQL website:
<p><a href="http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg" title="MySQL package for Mac OSX" target="_blank" rel="nofollow">http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg</a></p>
<p>I used the <strong>mysql-5.1.42-osx10.5-x86_64.dmg</strong> disk image, which seems to work fine. The image contains 4 files including a ReadMe file.</li>
<li>Install the following packages found in the disk image to the default location and with the default options:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql-5.1.42-osx10.5-x86_64.pkg
MySQLStartupItem.pkg</pre></div></div>

</li>
<li>Install the following profile found in the disk image to the default location and with the default options:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">MySQL.prefPanel</pre></div></div>

</li>
<li>Start the MySQL service in the System Preferences panel and check the <em>Automatically Start the MySQL Service on Startup</em> option.</li>
</ol>
<p>That is all you need to do. However, if you&#8217;re working with PHP, you will need to correctly reference the <code>mysql.sock</code> file in your <code>php.ini</code> file. To do this, find the following line and ensure the reference is correct:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mysql.default_socket = /tmp/mysql.sock</pre></div></div>

<p>(Remember to restart Apache if you make changes to your <code>php.ini</code> file.)</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/installing-mysql-on-mac-osx-10-6-snow-leopard/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>PHP.ini Permission Problems on Windows Vista</title>
		<link>http://www.simonwhatley.co.uk/phpini-permission-problems-on-windows-vista</link>
		<comments>http://www.simonwhatley.co.uk/phpini-permission-problems-on-windows-vista#comments</comments>
		<pubDate>Sun, 17 Feb 2008 22:28:41 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[configuring]]></category>
		<category><![CDATA[difficulties]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Microsoft Vista]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[paths]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[Rob Douglas]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[solutions]]></category>
		<category><![CDATA[solving]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=398</guid>
		<description><![CDATA[Installing PHP is a relatively simple task one would think. Indeed it is simple, but configuring the php.ini isn't; at least not so on Windows Vista! It is infuriating when such a relatively simple task is made inordinately complicated because of the nuances of Vista permissions. What started out as a 5 minute task took a significant number of hours searching for a suitable answer on Google, and not only by myself.]]></description>
			<content:encoded><![CDATA[<p>Installing PHP is a relatively simple task one would think. Indeed it is simple, but configuring the php.ini isn&#8217;t; at least not so on Windows Vista! It is infuriating when such a relatively simple task is made inordinately complicated because of the nuances of Vista permissions. What started out as a 5 minute task took a significant number of hours searching for a suitable answer on Google, and not only by myself.</p>
<p>The task I was trying to achieve was the installation of development versions of <a href="http://wordpress.org" title="WordPress" rel="nofollow">WordPress</a>, <a href="http://drupal.org" title="Drupal" rel="nofollow">Drupal</a>, <a href="http://www.mediawiki.org" title="MediaWiki" rel="nofollow">MediaWiki</a> and <a href="http://moodle.org" title="Moodle" rel="nofollow">Moodle</a>, all of which would require a MySQL database. Trying to load the MySQL extension should have been a simple case of uncommenting the line in the php.ini and restarting the Apache service. With Vista, this was certainly not the case.</p>
<p>I set up a very simple page detailing the <acronym title="PHP: Hypertext Preprocessor">php</acronym> configuration in an index.php file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This showed me the default configuration path of my php.ini and extensions directory, amongst a whole host of other information.</p>
<p>In both cases the paths were incorrect. First and foremost the configuration file path stated <code>C:\Windows</code> when in fact I had installed it in the root (<code>C:\PHP5</code>). So, although I was amending the php.ini file with the correct detail, Vista was using the default values. If there is no php.ini file in Windows, then you&#8217;ll continue banging your head against a brick wall.</p>
<p>The problems didn&#8217;t stop there. Moving the php.ini file to the Windows directory under Vista isn&#8217;t a simple copy and paste task. You need to be administrator. But Vista&#8217;s administrator priviledges are more pseudo than actual! In order to amend and save the php.ini file in the Windows directory, you must run Notepad as administrator and save the file as such. Voila! Everything then works. The <code>phpinfo()</code> function returned the correct installation detail and I could continue with the job I was meant to be doing.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>PS. Thanks to <a href="http://www.anucreative.com" title="Rob Douglas" rel="nofollow">Rob Douglas</a> for his help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/phpini-permission-problems-on-windows-vista/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

