<?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>Uncorrupted Hosting &#187; Technical Articles</title>
	<atom:link href="http://uncorrupted.net/blog/technical-articles/feed/" rel="self" type="application/rss+xml" />
	<link>http://uncorrupted.net</link>
	<description>Your High Performance Web Host!</description>
	<lastBuildDate>Tue, 18 May 2010 15:30:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Playing with snort and pfSense</title>
		<link>http://uncorrupted.net/technical-articles/remove-snort-ip-blocks-in-pfsense/</link>
		<comments>http://uncorrupted.net/technical-articles/remove-snort-ip-blocks-in-pfsense/#comments</comments>
		<pubDate>Tue, 18 May 2010 15:30:58 +0000</pubDate>
		<dc:creator>Uncorrupted-Michael</dc:creator>
				<category><![CDATA[Technical Articles]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[pfsense]]></category>

		<guid isPermaLink="false">http://v4.uncorrupted.net/?p=874</guid>
		<description><![CDATA[We&#8217;ve been having a blast with some new intel atom based pfSense firewalls here in the office. The d510 boards perform amazingly well, even with a slew of snort rules loaded up. We just replaced one of our Juniper SRX series firewalls with one of these little pfSense boxes and wouldn&#8217;t you know one of [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been having a blast with some new intel atom based pfSense firewalls here in the office.  The d510 boards perform amazingly well, even with a slew of snort rules loaded up.</p>
<p>We just replaced one of our Juniper SRX series firewalls with one of these little pfSense boxes and wouldn&#8217;t you know one of our own snort rules blocked us.  Here&#8217;s how we got back in:</p>
<p>Gain access to the pfSense shell.  We could have walked over to the box but that involved standing up, placing one foot infront of the other and repeating again and again.  Bah, who needs all that.</p>
<p>We SSHd to another machine, and from that machine we SSHd to a machine behind our firewall, and from that we SSHd to the LAN IP associated with our firewall. We logged in, chose option 8 (Local Shell), and did the following:</p>
<pre class="brush: bash;">
pfctl -t snort2c -T show</pre>
<p>This will show you all the IPs that have been blocked by triggering a snort rule</p>
<p>Then run this to remove you IP</p>
<pre class="brush: bash;">
pfctl -t snort2c -T delete xxx.xxx.xxx.xxx</pre>
<p>You should add your own IPs to the whitelist to prevent this from happening again.  <img src='http://uncorrupted.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://uncorrupted.net/technical-articles/remove-snort-ip-blocks-in-pfsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx Hotlink Protection</title>
		<link>http://uncorrupted.net/technical-articles/nginx-hotlink-protection/</link>
		<comments>http://uncorrupted.net/technical-articles/nginx-hotlink-protection/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 15:32:56 +0000</pubDate>
		<dc:creator>Uncorrupted-Michael</dc:creator>
				<category><![CDATA[Technical Articles]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://v4.uncorrupted.net/?p=745</guid>
		<description><![CDATA[A few clients have recently complained about other blogs linking to their images and leeching off their bandwidth. Bandwidth is expensive and should be protected. Here&#8217;s a working solution: location ~ \.(jpg&#124;jpeg&#124;bmp&#124;jif&#124;bmp&#124;gif&#124;png)$ { root /path/to/public_html/; valid_referers server_names none blocked; if ($invalid_referer) { return 403; } } Some sites will need to allow some other sites [...]]]></description>
			<content:encoded><![CDATA[<p>A few clients have recently complained about other blogs linking to their images and leeching off their bandwidth.  Bandwidth is expensive and should be protected.</p>
<p>Here&#8217;s a working solution:</p>
<pre class="brush: bash;">
location ~ \.(jpg|jpeg|bmp|jif|bmp|gif|png)$ {
                root   /path/to/public_html/;
                valid_referers server_names none blocked;
                if ($invalid_referer) {
                return 403;
                }
            }
</pre>
<p>Some sites will need to allow some other sites to link to their images. If this is the case you can use the following rewrites &#8211; just modify and add domains as required</p>
<pre class="brush: bash;">
location ~ \.(jpg|jpeg|bmp|jif|bmp|gif|png)$ {
                root   /path/to/public_html/;
                valid_referers server_names none blocked www.theothersite.com *.theothersite.com;
                if ($invalid_referer) {
                return 403;
                }
            }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://uncorrupted.net/technical-articles/nginx-hotlink-protection/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WHMCS Rewrite Rules for Nginx</title>
		<link>http://uncorrupted.net/technical-articles/whmcs-rewrite-rules-for-nginx/</link>
		<comments>http://uncorrupted.net/technical-articles/whmcs-rewrite-rules-for-nginx/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 18:20:57 +0000</pubDate>
		<dc:creator>Uncorrupted-Michael</dc:creator>
				<category><![CDATA[Technical Articles]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[whmcs]]></category>

		<guid isPermaLink="false">http://v4.uncorrupted.net/?p=550</guid>
		<description><![CDATA[WHMCS is a very popular client management package with a slew of billing, support, and product management options. We use it here and have just recently moved our WHMCS site over to an nginx powered web server. The rewrites have all been worked out and since there&#8217;s nothing to be found on the subject via [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://uncorrupted.net/wp-content/uploads/2009/10/nginx_logo.png" alt="nginx_logo" title="nginx_logo" width="320" height="119" class="size-full wp-image-553" /><br />
WHMCS is a very popular client management package with a slew of billing, support, and product management options.  We use it here and have just recently moved our WHMCS site over to an nginx powered web server.  The rewrites have all been worked out and since there&#8217;s nothing to be found on the subject via google we decided to share.  <img src='http://uncorrupted.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: bash;">
server {
            listen   80;
            server_name  my.uncorrupted.net;
            rewrite ^/(.*) https://my.uncorrupted.net/$1 permanent;
       }

server {
            listen   443;
            server_name my.uncorrupted.net;
            access_log /xxx/xxx/xxx/logs/access.log;
            error_log /xxx/xxx/xxx/logs/error.log;
	    	ssl on;
	    	ssl_certificate /xxx/xxx/xxx/.ssl/cert.pem;
	    	ssl_certificate_key /xxx/xxx/xxx/.ssl/key.pem;

            location /  {
                        root   /xxx/xxx/xxx/public_html/;
                        index  index.html index.php;
		    }

			location = /announcements {
        				rewrite ^  /announcements.php  last;
    		}

    		location /announcements/ {
        				rewrite  ^/announcements/([0-9]+)/[A-Za-z0-9_-]+\.html$ /announcements.php?id=$1 last;
    		}

    		location = /downloads {
        				rewrite ^  /downloads.php  last;
    		}

    		location /downloads/ {
        				rewrite ^/downloads/([0-9]+)/([^/]*)$ /downloads.php?action=displaycat&amp;catid=$1 last;
    		}
			location = /knowledgebase {
       					rewrite ^  /knowledgebase.php  last;
    		}
			location /knowledgebase/ {
        				rewrite  ^/knowledgebase/([0-9]+)/[A-Za-z0-9_-]+\.html$ /knowledgebase.php?action=displayarticle&amp;id=$1 last;
        				rewrite  ^/knowledgebase/([0-9]+)/([^/]*)$ /knowledgebase.php?action=displaycat&amp;catid=$1 last;
    		}

            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            location ~ \.php$ {
            			fastcgi_pass 127.0.0.1:9000;
            			fastcgi_index index.php;
            			include /usr/local/nginx/conf/fastcgi_params;
            			fastcgi_param SCRIPT_FILENAME /xxx/xxx/xxx/public_html/$fastcgi_script_name;
            }
}
</pre>
<p>Gest of luck &#8211; if you run into any issues write us a comment and we&#8217;ll see if we can help you work it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://uncorrupted.net/technical-articles/whmcs-rewrite-rules-for-nginx/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Move WordPress With No Down Time</title>
		<link>http://uncorrupted.net/technical-articles/move-wordpress-with-no-down-time/</link>
		<comments>http://uncorrupted.net/technical-articles/move-wordpress-with-no-down-time/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 13:26:41 +0000</pubDate>
		<dc:creator>Uncorrupted-Michael</dc:creator>
				<category><![CDATA[Technical Articles]]></category>

		<guid isPermaLink="false">http://www.uncorrupted.net/?p=101</guid>
		<description><![CDATA[The goal here is to transfer your WordPress website off your current host's server and (hopefully) onto one of the Uncorrupted Servers.   There are other ways of performing the migration, but I've found this to be the easiest. This guide assumes you have a basic understanding of terminal commands and that you can find your public_html directory on your current host's server.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-384" title="pathing" src="http://www.uncorrupted.net/wp-content/uploads/2009/03/pathing.png" alt="pathing" width="128" height="128" />I&#8217;ve moved about 50 WordPress installations from various servers over the years and have found, what I consider, the &#8220;best practices&#8221;.   The goal here is to transfer your WordPress website off your current host&#8217;s server and (hopefully) onto one of the Uncorrupted Servers.   <span id="more-101"></span> There are other ways of performing the migration, but I&#8217;ve found this to be the easiest.  This guide assumes you have a basic understanding of terminal commands and that you can find your public_html directory on your current host&#8217;s server.</p>
<p>Requirements:</p>
<ul>
<li>Terminal (SSH) access to your new and old web servers</li>
<li>An SSH client (I recommend <a href="http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe" target="_blank">Putty</a>)</li>
<li>A text editor for modifying the dump.sql file we&#8217;re going to create (I recommend <a href="http://www.aptana.com/">Aptana Stuido</a> because it performs well when opening large (20+MB) text files)</li>
</ul>
<p>During the migration process you&#8217;ll be copying/pasting paths a lot, so open up a new text document in Aptana and paste the following into it:</p>
<pre lang="text">Old Server Info:
Path to public_html = /replace/with/real/path/
Wordpress DB Name = replace_Me
Wordpress DB User Name = replace_MeToo
Wordpress DB Password = NewSecretPassword

New Server Info:
Path to public_html = /home//domains/example.com/public_html/
Wordpress DB Name = replace_Me
Wordpress DB User Name = replace_MeToo
Wordpress DB Password = NewSecretPassword</pre>
<p>Now open Putty and make a connection to your old server. Once you&#8217;re logged in, cd (change directory) into the public_html directory.<br />
Type:</p>
<pre class="brush: bash;">pwd</pre>
<p>Paste the output into your text file.  This is the path to public_html on the <strong>old</strong> server.</p>
<p>Log into your control panel and create a new database, copy the DB Name, User Name, &amp; Password and paste it into your text document.</p>
<p>Back to Putty&#8230; you should still be inside your old hosts public_html directory.  Type these commands:</p>
<pre class="brush: bash;">cd ..
tar cvzf backup.tgz public_html
mv backup.tgz public_html</pre>
<p>So, we moved up one directory and created a gzipped tar archive of your entire public_html folder.  I choose to gzip the entire folder because if you&#8217;re in the directory and pass it the * operator it will skip hidden files (like .htaccess files), which we definitely want to leave in place. We also moved the backup file into your public_html folder so we can download it from the new server.</p>
<p>Open up another putty window and connect to your new server.  cd into your public_html directory (@ Uncorrupted it is ~/domains/example.com/public_html/)<br />
Let&#8217;s do some cleanup:</p>
<pre class="brush: bash;"> rm -f index.html logo.jpg</pre>
<p>Download and extract the backup file:</p>
<pre class="brush: bash;">wget http://example.com/backup.tgz
tar zxvf backup.tgz
cd public_html
mv * ..</pre>
<p>So, we downloaded the backup, extracted it, moved into the folder it created (public_html) and moved all the files out.  We still need to move any relevant hidden files, so:</p>
<pre class="brush: bash;">ls -la
mv .htaccess ..
mv
cd ..
rm -rf public_html</pre>
<p>So now you&#8217;re back inside the real public_html directory on the new host. Grab the path and add it to your text file:</p>
<pre class="brush: bash;">pwd</pre>
<p>Lets tell WordPress which database to use and the username/password combo needed to open it:</p>
<pre class="brush: bash;">nano wp-config.php</pre>
<p>Find:  define(&#8216;DB_NAME&#8217;, &#8216;&#8230;&#8217;); Replace &#8230; with the DB Name in your text document<br />
Find   define(&#8216;DB_USER&#8217;, &#8216;&#8230;&#8217;);  Replace &#8230; with the User Name in your text document<br />
Find   define(&#8216;DB_PASSWORD&#8217;, &#8216;&#8230;&#8217;); Replace &#8230; with the Password in your text document</p>
<p>Once you&#8217;re done editing the file, press  + o to save the changes and  + x to exit.</p>
<p>Let&#8217;s go back the the other Putty window (your old host)  and dump the MySQL database &#8211; replace the DB info with the DB info from your text document.</p>
<pre class="brush: bash;">cd public_html
mysqldump -u -p  &amp;gt; dump.txt</pre>
<p>Download the text file to your computer and open it up with Aptana.  We need to replace the path info throughout the database so click on Edit -&gt; Find/Replace<br />
In the find block, paste your old path to public_html and in the new block paste your new path to public_html.  Make sure the Wrap Search check box is checked and click Replace All.  Save the text document and upload it into your public_html directory on the new server.</p>
<p>Import the text file into your new MySQL DB:</p>
<pre class="brush: bash;">mysql -u -p  &amp;lt; dump.txt</pre>
<p>At this point, WordPress should be working.  All of your posts, comments, media, etc should be working just as they were on your old host.  You can test everything by editing the hosts file on your PC</p>
<p>Go to: C:\Windows\System32\drivers\etc and open up the hosts file with a text editor, go to the end of the file and type the IP address of your new server, press tab &amp; type your domain name, save the document, close your web browser, and clean your DNS cache (click start, click run type ipconfig /flushdns &amp; press enter). Next, open your browser and go to your site &#8211; everything should work. When you&#8217;re done testing, delete the lines you added to your hosts file and then save/close it.</p>
<p>At this point, all that&#8217;s left to do is change the DNS servers for your site and point them at the DNS servers provided by your new host.  Some folks will continue to hit your old site and some will start hitting your new site.  Within a couple days all your visitors will be hitting the new one.  Keep in mind that it may be a while before you hit the new server too &#8211; that&#8217;s just the way DNS works.  If you want to hit it instantly, check out my <a href="http://www.uncorrupted.net/useful-resources/opendns-a-great-tool-for-website-migration/">post about OpenDNS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://uncorrupted.net/technical-articles/move-wordpress-with-no-down-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
