<?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>Jerry Bell's World &#187; hosting</title>
	<atom:link href="http://www.jerry-bell.com/tag/hosting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jerry-bell.com</link>
	<description>Intelligent discussion on politics, technology, and security. 100% less ads than the competition.</description>
	<lastBuildDate>Mon, 27 Apr 2009 13:40:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WordPress backup script</title>
		<link>http://www.jerry-bell.com/wordpress-backup-script/</link>
		<comments>http://www.jerry-bell.com/wordpress-backup-script/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 23:18:07 +0000</pubDate>
		<dc:creator>jerry</dc:creator>
				<category><![CDATA[automate]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.jerry-bell.com/?p=50</guid>
		<description><![CDATA[I was looking to upgrade wordpress today, and realized that there MUST be a better way.  So, I hit google up for a &#8220;wordpress upgrade script&#8221;.  Sure enough, I found a great script at http://pthree.org/2007/03/02/wordpress-upgrade-script/.  I played with it, but it still required a lot of work &#8211; looking up database usernames and whatnot.  I figured that [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking to upgrade wordpress today, and realized that there MUST be a better way.  So, I hit google up for a &#8220;wordpress upgrade script&#8221;.  Sure enough, I found a great script at <a href="http://pthree.org/2007/03/02/wordpress-upgrade-script/">http://pthree.org/2007/03/02/wordpress-upgrade-script/</a>.  I played with it, but it still required a lot of work &#8211; looking up database usernames and whatnot.  I figured that I could pull the username, database name and password out of the wp-config.php file. And I could.</p>
<p>So, now the script just pauses to remind you to deactivate your plugins.  I tried to find a way to automate that, but have struck out so far.  If you know how, let me know!  I&#8217;ll give you credit.</p>
<p><span id="more-50"></span></p>
<p>Script follows:</p>
<pre>#!/bin/bash</pre>
<pre># Updated by: Jerry Bell
# License remains intact
# Changes:
# - Added a backup directory that is outside the document root. The previous script left copies of the database accessible
# - Added code to automatically determine the database name, database username, and database password from the wp-config.php file.</pre>
<pre># - Removed "read" prompts - they're not really needed any more</pre>
<pre># - Set tar to send the archive to the backup directory instead of document root.
#
# This program upgrades your existing WordPress installations that you are running on your server.
#
# You need to make the necessary adjustments to this script as needed for your situation.
#
# Make this script executable: 'chmod 777 wp_upgrade.sh'
# Run the script: './wp_upgrade.sh'
#
# Author: Aaron Toponce
# License: GPL v2
# Version: 0.1.2</pre>
<pre># =================== Start of Script =================== #</pre>
<pre># Provide the necessary directories to what WordPress installations need to be backed up space delimited
# Change as necessary and uncomment
# For example, if you had 3 sites in /var/www/site1, /var/www/site2 and /var/www/site3
# then it would look like below (do not add the trailing slash):
# directories=(/var/www/site1 /var/www/site2 /var/www/site3)
backupdir=/var/tmp
number=${#directories[@]}
# Testing that all directories specified above are valid before beginning
for (( i = 0 ; i &lt; number ; i++ )); do
        if [[ ! -d ${directories[$i]} ]]; then
                echo "Directory ${$directories[$i]} does not exist."
                return 1
        fi
done</pre>
<pre># First, we need to get the necessary file
cd ~</pre>
<pre>if [[ -f wordpress.tar.gz ]]; then
        echo "wordpress.tar.gz exists.  Please take notice to this upgrade before continuing."
        return 1
fi</pre>
<pre>wget -O latest.tar.gz <a href="http://wordpress.org/latest.tar.gz">http://wordpress.org/latest.tar.gz</a></pre>
<pre>echo "First disable all plugins on all installations before continuing."
echo "Press ENTER to continue..."
read blah</pre>
<pre>for (( i = 0 ; i &lt; number ; i++ )); do
        clear
        cd ${directories[$i]}
        back_ts=$(date +%s)
        mkdir ${backupdir}/backup_${back_ts}
        echo "We are backing up the full directory, in case anything goes wrong. Press ENTER..."
        read blah
        tar -cvvf ${backupdir}/backup_${back_ts}/backup.tar ${directories[$i]}
        gzip  ${backupdir}/backup_${back_ts}/backup.tar</pre>
<pre>        # Timestamp in unix epoch format to create unique backup directories</pre>
<pre>        echo "backing up database for ${directories[$i]}:"
        # Backing up the necessary WordPress database
        wp_db=`grep DB_NAME ${directories[$i]}/wp-config.php | cut -f 4 -d "'"`
        wp_user=`grep DB_USER ${directories[$i]}/wp-config.php | cut -f 4 -d "'"`
        wp_pass=`grep DB_PASSWORD ${directories[$i]}/wp-config.php | cut -f 4 -d "'"`
        mysqldump --add-drop-table -u ${wp_user} -p${wp_pass} ${wp_db} &gt; ${backupdir}/backup_${back_ts}/${wp_db}.sql
        # Make the necessary changes for what to backup.  This is the default as provided by WordPress.
        echo "Backing up the important files. Press ENTER..."
        read blah
        cp .htaccess wp-config.php ${backupdir}/backup_${back_ts}
        cp -r wp-content wp-images wp-includes/languages ${backupdir}/backup_${back_ts}</pre>
<pre>        # Time to copy the latest wordpress that we downloaded and overwrite all files
        echo "Getting the latest cp of wordpress. Press ENTER..."
        read blah
        cp ~/latest.tar.gz ./wordpress.tar.gz
        tar -zxvf wordpress.tar.gz</pre>
<pre>        # Overwrite all files
        echo "Overwriting all old WordPress files with the new."
        cd wordpress
        cp -rf * ../</pre>
<pre>        # Copy the files that we backed up back
        echo "Coping the important backed up files back in."

        cp -rf  ${backupdir}/backup_${back_ts}/.htaccess ${directories[$i]}
        cp -rf  ${backupdir}/backup_${back_ts}/wp-config.php ${directories[$i]}
        cp -rf  ${backupdir}/backup_${back_ts}/wp-content ${directories[$i]}/wp-content
        cp -rf  ${backupdir}/backup_${back_ts}/wp-images ${directories[$i]}/wp-images
        cp -rf  ${backupdir}/backup_${back_ts}/wp-includes/languages ${directories[$i]}/wp-includes/languages</pre>
<pre>        echo "Point your browser to the necessary site and run the upgrade script."
        echo "EG: <a href="http://example.com/wp-admin/upgrade.php">http://example.com/wp-admin/upgrade.php</a>"
        echo "Update your permalinks and .htaccess."
        echo "Install updated plugins and themes"
        echo "Reactivate plugins"
        echo "Press ENTER to continue..."
        read blah
done</pre>
<pre>clear
echo "Congratulations! You have successfully upgraded your WordPress."
echo "Please review that your browser resolves your site."
echo "Enjoy!"</pre>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jerry-bell.com/wordpress-backup-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Site Security Guide</title>
		<link>http://www.jerry-bell.com/22/</link>
		<comments>http://www.jerry-bell.com/22/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 21:40:28 +0000</pubDate>
		<dc:creator>jerry</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web site]]></category>

		<guid isPermaLink="false">http://www.jerry-bell.com/2007/11/09/22/</guid>
		<description><![CDATA[So, in the aftermath of my little incident, I decided to write an article for NetworkStrike on how to keep your website secure.  I&#8217;ve included it below:  Background The “cost of entry” to run a website is very low now, and we have seen an explosion of small sites on the Internet. Supporting this trend has been the [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="font-size: 9.5pt">So, in the aftermath of my little incident, I decided to write an article for <a target="_blank" href="http://www.networkstrike.com">NetworkStrike </a>on how to keep your website secure.  I&#8217;ve included it below: </span></h1>
<h1><span style="font-size: 9.5pt"></span></h1>
<h1><span style="font-size: 9.5pt">Background</span></h1>
<hr />
<p style="margin: 0in 0in 0pt"><span style="font-size: 9.5pt">The “cost of entry” to run a website is very low now, and we have seen an explosion of small sites on the Internet. Supporting this trend has been the availability of free and open source applications that allow site owners to do nearly anything they want, from blogs to wikis to forums. </span></p>
<p style="margin: 0in 0in 0pt"><span style="font-size: 9.5pt">Unfortunately, nearly all of the software has inherent bugs that can be exploited by bad people. The exploitation of such bugs has matured in a similar fashion to the applications themselves.  Compromised web sites are a foundation to many threats currently on the Internet. Site owners are unknowingly supporting illegal activities such as:</span></p>
<ul>
<li><span style="font-size: 9.5pt">Hosting warez</span></li>
<li><span style="font-size: 9.5pt">Hosting copyrighted files</span></li>
<li><span style="font-size: 9.5pt">Hosting tools to compromise other sites</span></li>
<li><span style="font-size: 9.5pt">Sending massive amounts of spam</span></li>
<li><span style="font-size: 9.5pt">Host phishing sites to steal money </span></li>
<li><span style="font-size: 9.5pt">Become part of command and control for botnets</span></li>
</ul>
<p style="margin: 0in 0in 0pt"><span style="font-size: 9.5pt">Running a web site properly is truly becoming a social responsibility. If you are not part of the solution, you are likely part of the problem. </span></p>
<p style="margin: 0in 0in 0pt"><span style="font-size: 9.5pt">This guide outlines some general and basic security measures that you MUST take if you want to make sure your site is not defaced or otherwise compromised.</span></p>
<h2><span style="font-size: 9.5pt">Key elements needed in a web hosting platform</span></h2>
<hr /><strong> <span style="font-size: 9.5pt">Use a host that uses suphp</span></strong></p>
<p style="margin-left: 40px"><span style="font-size: 9.5pt">Try as you might, if another site on the server you share does not follow prudent security measures, then your site it still vulnerable. Suphp executes php scripts as the user-id and group-id of the account – not the userid/group id of the web server.</span></p>
<p style="margin: 0in 0in 0pt 40px"><span style="font-size: 9.5pt">This will allow more restrictive permissions on your directories and will prevent an attacked from being able to read your php files.</span></p>
<p style="margin: 0in 0in 0pt 40px"><span style="font-size: 9.5pt">Some hosts will not want to use suphp, as it can cause performance problems.</span></p>
<p style="margin: 0in 0in 0pt"><strong><span style="font-size: 9.5pt">Build a relationship with provider on dealing with security issues</span></strong></p>
<p style="margin: 0in 0in 0pt"><strong><span style="font-size: 9.5pt">Firewall outbound connections</span></strong></p>
<p style="margin: 0in 0in 0pt 40px"> <span style="font-size: 9.5pt">This is not always practical or possible, but firewalling traffic originating from the server – other than what is expected – can prevent backdoor tools from phoning home.</span></p>
<p style="margin: 0in 0in 0pt"><strong><span style="font-size: 9.5pt">Run suhosin patch for php</span></strong></p>
<p style="margin: 0in 0in 0pt 40px"><span style="font-size: 9.5pt">Suhosin can stop the exploitation of many different types of coding weaknesses and some vulnerabilities in php itself.</span></p>
<p style="margin-top: 0in; margin-bottom: 0pt; margin-right: 0in"><strong><span style="font-size: 9.5pt">Keeping up with the web software you use</span></strong></p>
<hr />
<ul>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Subscribe to mailing list for any application software used as part of your site.  Nearly all such applications have an &#8220;announcement&#8221; list that is low traffic.</span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Attempt to participate regularly in the forums or discussion lists for the software you use. You will often get advanced warning of security issues and interim fixes.  You will also know if the software is at risk of being abandoned and not updated.</span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial"><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Upgrade after a security fix release within 3 days.  Vulnerabilities are often exploited soon after they are discovered.</span></span></span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial"><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">If an application you use becomes abandon, plan to migrate your site to a new tool as fast as possible.</span></span></span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Try not to customize software.  This will slow down your ability to patch or upgrade, because you&#8217;ll have to rewrite code, test, etc, and that can be difficult to do when it&#8217;s not on your timeline.</span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial"><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Attempt to remove &#8216;powered by&#8217; and version number references.  <span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Nearly all open source web applications proudly, but this has turned out to be an extrodinarily efficient way to systematically identify sites running vulnerable software. <br />
</span></span></span></span></span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Create a file with a random name in your html directory. Do not reference the file in your site. Grep your web logs daily for the file being accessed. Any hits may indicate that your site has been compromised.<br />
</span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Scan for file differences and notify of differences<br />
</span></span></li>
</ul>
<p><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial"><span style="font-size: 9.5pt"><strong>Your responsibilities as a site owner</strong></span></span></span></p>
<hr />
<ul>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Perform frequent off-site backups.  Even if you have a local backup strategy, such as to another server, it is imperative to maintain an offsite backup.  While it doesn&#8217;t happen often, datacenters are broken into and servers are phyically stolen.</span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Do not store sensitive data like credit card numbers.  Just don&#8217;t do it.</span></span></li>
<li><span style="font-size: 9.5pt"><span style="font-size: 9.5pt; font-family: Arial">Change account passwords regularly</span></span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jerry-bell.com/22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
