<?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>Alex Mansfield &#187; Security</title>
	<atom:link href="http://alexmansfield.com/tag/security/feed" rel="self" type="application/rss+xml" />
	<link>http://alexmansfield.com</link>
	<description>WordPress Developer</description>
	<lastBuildDate>Tue, 28 Feb 2012 23:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Installing WordPress in a Subdirectory</title>
		<link>http://alexmansfield.com/wordpress/wordpress-in-a-subdirectory</link>
		<comments>http://alexmansfield.com/wordpress/wordpress-in-a-subdirectory#comments</comments>
		<pubDate>Tue, 09 Jun 2009 03:53:53 +0000</pubDate>
		<dc:creator>alexmansfield</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://alexmansfield.com/cms/?p=103</guid>
		<description><![CDATA[There are two reasons I like to install WordPress in its own folder, rather than the  root. First, I like to keep my root folder uncluttered. I don&#8217;t like a bunch of WordPress files that I&#8217;ll never be messing with getting in my way.  That&#8217;s just a matter of personal preference though. The second reason [...]]]></description>
			<content:encoded><![CDATA[<p>There are two reasons I like to install WordPress in its own folder, rather than the  root. First, I like to keep my root folder uncluttered. I don&#8217;t like a bunch of WordPress files that I&#8217;ll never be messing with getting in my way.  That&#8217;s just a matter of personal preference though. The second reason is for security. To prevent automated site scans from easily finding my WordPress files, I simply place them in a separate directory. So&#8230; here&#8217;s how you do it. It&#8217;s actually quite simple.</p>
<h3>1. Install WordPress in a subdirectory</h3>
<p>Just follow the instructions I gave in my post <a href="http://alexmansfield.com/wordpress/installing-wordpress">Installing WordPress Manually</a>. Make sure you create a new directory and upload the WordPress installation files there (that&#8217;s step three in the post I just mentioned).</p>
<h3>2. Edit the index.php file</h3>
<p>Once WordPress is installed, download the<strong> index.php</strong> from the directory where you uploaded WordPress. You&#8217;ll need to open it up and make one small change. Find this piece of code:</p>
<pre class="brush: php; title: ; notranslate">/** Loads the WordPress Environment and Template */&lt;br /&gt;
require('./wp-blog-header.php');</pre>
<p>All you need to do is tell it how to find <strong>wp-blog-header.php</strong> in its new subdirectory. For example, here&#8217;s what the code would look like if I installed WordPress in a directory called <strong>example</strong>.</p>
<pre class="brush: php; title: ; notranslate">/** Loads the WordPress Environment and Template */&lt;br /&gt;
require('./example/wp-blog-header.php');</pre>
<p>Notice how I added <strong>/example</strong> just before <strong>/wp-blog-header.php</strong>. So just add the name of your directory in place of <strong>example</strong> and that&#8217;s all the code editing you have to do.</p>
<h3>3. Upload the new index.php file</h3>
<p>Now that you&#8217;ve made the necessary change to your index.php file, it&#8217;s time to upload it to your root directory. Make sure you delete the old <strong>index.php</strong> file in your WordPress directory.</p>
<h3>4. Tell WordPress what you did</h3>
<p>Finally, you need to let WordPress know about the change. First, log into WordPress. The login page will still be at the old URL (for example http://alexmansfield.com/example/wp-login.php not http://alexmansfield.com/wp-login.php). Go to <strong>Settings&gt;General</strong> and change the <strong>Blog Address</strong> field (for example, from http://alexmansfield.com/example/ to http://alexmansfield.com/). Save your changes and that should do it!</p>
<p>If you have any questions, please ask them in the comments section below.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmansfield.com/wordpress/wordpress-in-a-subdirectory/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Six Steps Toward Securing WordPress</title>
		<link>http://alexmansfield.com/security/securing-wordpress</link>
		<comments>http://alexmansfield.com/security/securing-wordpress#comments</comments>
		<pubDate>Mon, 08 Jun 2009 20:52:22 +0000</pubDate>
		<dc:creator>alexmansfield</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://alexmansfield.com/cms/?p=62</guid>
		<description><![CDATA[WordPress is a great publishing platform, but there a few steps that should be taken to make it more secure. Here are 6 of the best. 1. Delete the user &#8220;admin&#8221; Every WordPress installation automatically generates a user account with the username admin. I&#8217;ll admit this is a logical username, but EVERY blog having the [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress is a great publishing platform, but there a few steps that should be taken to make it more secure. Here are 6 of the best.</p>
<h3>1. Delete the user &#8220;admin&#8221;</h3>
<p>Every WordPress installation automatically generates a user account with the username <strong>admin</strong>. I&#8217;ll admit this is a logical username, but EVERY blog having the same username is not the best idea. Imagine someone trying to compromise your blog. What&#8217;s the first username they&#8217;re going to attack? That&#8217;s right, the admin. So, go to <strong>Users&gt;Add New</strong> and create a new user for yourself. Make sure to set your role to <strong>administrator</strong>. Then log out and log back in as the user you just created. Now go back to the <strong>Users</strong> page and delete the <strong>admin</strong> account. Problem solved.</p>
<h3>2. Use secret keys</h3>
<p>According to wordpress.org,</p>
<blockquote><p>In simple terms, a secret key is a password with elements that make it harder to generate enough options to break through your security barriers. A password like &#8220;password&#8221; or &#8220;test&#8221; is simple and easily broken. A random,  unpredictable password such as &#8220;88a7da62429ba6ad3cb3c76a09641fc&#8221; takes years to come up with the right combination.</p></blockquote>
<p>WordPress stores the secret keys in the wp-config.php file in your WordPress directory. You need to download a copy of your wp-config.php file in order to add your secret keys. Open the file and scroll down until you find something like this:</p>
<pre class="brush: php; title: ; notranslate">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');</pre>
<p>Now, you can come up with your own unique phrases if you&#8217;d like, but I prefer to use the WordPress secret-key generating service. You won&#8217;t ever have to remember these keys so they can be long and complicated (actually, they <strong>should</strong> be long and complicated). To use the key generating service that WordPress provides, go to <a href="https://api.wordpress.org/secret-key/1.1/">https://api.wordpress.org/secret-key/1.1/</a></p>
<p>You&#8217;ll see something that looks like this:</p>
<pre class="brush: php; title: ; notranslate">define('AUTH_KEY',        '|g_-s~&gt;*qlxC|7x&gt;~IYb180rU6u-r}D#dG&gt;Q[GHCR~ql#l.7-noM5n6=E!.~SEDs');
define('SECURE_AUTH_KEY', ':kN}%tH6,O!fBpO|(u3o3~|ve/_q4:He|7Gm@)k(IIGGb}t`qAqD3-vV t/|I+85');
define('LOGGED_IN_KEY',   ' ,%4j5%9-v6hEa6THQN,+2CjPywX-HxhLj|vYSRb*7ra.Wl7RG%-Hoy4Ln0ZhTf^');
define('NONCE_KEY',       ']{nb6+C)8u&amp;amp;amp;amp;?+e8necJSKzt)e0`x8L vQue!sV!o}d-F&lt;v%DNhZKDv7fFLRH/9]L');
</pre>
<p>Copy the entire thing and use it to replace the section in <strong>wp-config.php</strong> that needed the secret keys. Save the file and upload it back to your website in place of the old file.</p>
<p>Please note: if you logged in to your WordPress administration panel before changing they keys, you&#8217;ll have to log back in.</p>
<h3>3. Turn off directory browsing and protect the wp-config.php file</h3>
<p>Don&#8217;t let people snoop around your site where they weren&#8217;t intended to be. Use an .htaccess file to protect the portions of your website that weren&#8217;t meant for public viewing. For example, WordPress has a directory where it stores its plugins. No one needs to look at what plugins you have installed (unless they&#8217;re looking for people who are using a plugin with a known vulnerability). So to protect yourself, create a new file and name it <strong>.htaccess</strong> (yes, it starts with a period) and place the following code in it:</p>
<pre class="brush: cpp; title: ; notranslate"># turn off directory browsing
Options All -Indexes

# protect wp-config.php
&lt;files wp-config.php&gt;
Order deny,allow
deny from all
&lt;/files&gt;</pre>
<p>Upload the file to the same directory as your <strong>wp-config.php</strong> file. This protects both your directories and the <strong>wp-config.php </strong>file that holds important database details.</p>
<h3>4. Limit login attempts</h3>
<p>No matter how strong a password is, it can be guessed with enough tries. The <strong>Limit Login Attempts</strong> plugin solves this problem nicely. To protect your site, <a href="http://devel.kostdoktorn.se/limit-login-attempts/">download the Limit Login Attempts plugin</a> (the download link is at the very bottom of the page), unzip it and upload it to your plugins directory (wp-content/plugins). Now log into WordPress and go to the <strong>Plugins</strong> page. Find <strong>Limit Login Attempts</strong> and click <strong>Activate</strong> (on the far right). You can change how many login attempts are allowed and make other changes by going to <strong>Settings&gt;Limit Login Attempts</strong>.</p>
<h3>5. Encrypt your logins</h3>
<p>By default, WordPress login information (username and password) are transfered in plain text. You can use the <a href="http://wordpress.org/extend/plugins/chap-secure-login/">Chap Secure Login</a> plugin to encrypt your password for increased security. Plugin installations are pretty much all the same, so just follow the same steps as before (download, unzip, upload to plugins folder, activate from admin panel).</p>
<p>Please Note: The first time you try to login after installing this plugin, the login will fail. This is normal. After the first attempt, everything should go back to working properly. As a side note, this failed login will give you a change to see the Limited Login Attempts plugin in action (it should tell you how many tries you have left).</p>
<h3>6. Don&#8217;t display what version of WordPress you&#8217;re using</h3>
<p>If there is a known vulnerability with a certain version of WordPress, you don&#8217;t want to broadcast to the world that your site contains that vulnerability. WordPress automatically displays the version number as a comment in the header code, but we can change that quite easily. Just add this line to the functions.php file of your WordPress theme if you&#8217;re theme doesn&#8217;t suppress the version number already.</p>
<pre class="brush: php; title: ; notranslate">remove_action('wp_head', 'wp_generator');</pre>
<p>Also, if you uploaded the <strong>readme.txt</strong> file that came with WordPress, you should delete it, since it also contains the version number.</p>
<h3>Bonus: Scan you site for vulnerabilities</h3>
<p>There is a WordPress plugin developed by the guys over at <a href="http://blogsecurity.net/">blogsecurity.net</a> that will scan your site for known vulnerabilities. Do yourself a favor and <a href="http://blogsecurity.net/wordpress/tools/wp-scanner">check your blog</a>.</p>
<p>That&#8217;s it for now. Do you have any other techniques that you use to secure your WordPress sites? Please post them in the comments. Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://alexmansfield.com/security/securing-wordpress/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

