<?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>Michael Helm&#039;s Technology Blog &#187; Cpanel</title>
	<atom:link href="http://www.ihelm.org.uk/category/server-administration/cpanel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ihelm.org.uk</link>
	<description>Linux Servers, Cpanel and Mysql along with my own tech thoughts</description>
	<lastBuildDate>Thu, 29 Sep 2011 22:19:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Password protecting a directory with .htaccess and wordpress</title>
		<link>http://www.ihelm.org.uk/2011/09/password-protecting-a-directory-with-htaccess-and-wordpress/</link>
		<comments>http://www.ihelm.org.uk/2011/09/password-protecting-a-directory-with-htaccess-and-wordpress/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 22:19:07 +0000</pubDate>
		<dc:creator>mhelm</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=198</guid>
		<description><![CDATA[I&#8217;ve come across this problem a number of times, of course each time I think &#8220;this will be fixed next time&#8221;.  Unfortunately it&#8217;s not the case.  What&#8217;s the problem then? You have a directory that you want to password protect, lets call it &#8220;secrets&#8221;.  It resides in /home/mysite/public_html/secrets/ on the server.  Now fortunately you are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come across this problem a number of times, of course each time I think &#8220;this will be fixed next time&#8221;.  Unfortunately it&#8217;s not the case.  What&#8217;s the problem then?</p>
<p>You have a directory that you want to password protect, lets call it &#8220;secrets&#8221;.  It resides in /home/mysite/public_html/secrets/ on the server.  Now fortunately you are using a hosting control panel like cpanel and you&#8217;ve password protected directories before (if not then have a hunt on this site or on google!).</p>
<p>Before you activate the protection you can view the contents fine, so you activate protection &#8211; driven by a .htaccess file&#8230; and then rather than being asked for your username and password, you get a 404 or a 403 message from wordpress &#8220;Sorry the page you are looking for cannot be found&#8221;.</p>
<p>Intrepid system administrators hunt through error logs, and sure enough the access log is recording a 404&#8230; however the error log is recording something different.</p>
<pre>Permission denied: /home/mysite/public_html/secret/.<strong>htaccess</strong> pcfg_openfile: unable to check <strong>htaccess</strong> file, ensure it is readable</pre>
<p>This error message has had a number of solutions in the past, including the infamous &#8220;reinstall frontpage extensions&#8221;, except these are long gone &#8211; not supported and never will be again, please don&#8217;t go installing them just to get past this problem! &#8211; It will end in tears.</p>
<p>Instead you just need to add a couple of lines to the wordpress .htaccess file in the root of your site (e.g. /home/mysite/public_html/.htacess). Go to the file and just before the main WordPress part</p>
<p>#BEGIN wordpress &#8211; add the following</p>
<pre>ErrorDocument 401 /%{REQUEST_URI}/errors.html
ErrorDocument 403 /%{REQUEST_URI}/errors.html</pre>
<p>This should set the site to working, now why does this work?</p>
<p>Simply put wordpress is often run with a pretty url mode (permalinks) where the addresses for posts are made to look more pretty.  When you request your secret directory the server tries to access it, looks at the .htaccess file and promptly tries to do a redirect, this invariably ends up at a page wordpress cannot access &#8211; this doesn&#8217;t happen without the .htaccess as wordpress allows access to existing real files, but the htaccess security says the file doesn&#8217;t exist until the password is entered and so it intercepted.</p>
<p>It&#8217;s all a bit confusing, however adding these lines essentially means wordpress can get out of the way when those errors occur, 401 and 403 are authorisation required or failure codes, so wordpress will ignore and the htaccess can safely challenge your.</p>
<p>&nbsp;</p>
<p>Hopefully this will help if you come across this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2011/09/password-protecting-a-directory-with-htaccess-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable mod_deflate for all sites (entire server) in cPanel/WHM</title>
		<link>http://www.ihelm.org.uk/2011/02/how-to-enable-mod_deflate-for-all-sites-entire-server-in-cpanelwhm/</link>
		<comments>http://www.ihelm.org.uk/2011/02/how-to-enable-mod_deflate-for-all-sites-entire-server-in-cpanelwhm/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 22:17:35 +0000</pubDate>
		<dc:creator>mhelm</dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[deflate]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_deflate]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=175</guid>
		<description><![CDATA[Mod Deflate is essential nowadays for sites, it speeds up the transfer of html pages &#38; other files (such as stylesheets) by compressing them first. Now that servers today are so powerful there is very little reason not to use this, especailly since so many &#8220;speed up&#8221; tests will not pass without this being enabled. [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Mod Deflate is essential nowadays for sites, it speeds up the transfer of html pages &amp; other files (such as stylesheets) by compressing them first. Now that servers today are so powerful there is very little reason not to use this, especailly since so many &#8220;speed up&#8221; tests will not pass without this being enabled.</p>
<p>However whilst you can enable it site-by-site, however for shared hosts with many sites this is not the best way, but you can enable it globally.</p>
<ol>
<li>First ensure it&#8217;s installed, you can do this by using EasyApache and ensuring that mod_deflate is selected (it may be already),once apache has been compiled deflate is now enabled.</li>
<li>If you want to enable the functionality site-by-site then in each sites control panel a new option is now available.  under Software/Services the user can now choose to optimise their website, this essentially allows deflate to be turned on and off.</li>
<li>If you want to do this globally (why not it cuts bandwidth and keeps your users happier) then  simply follow the following:</li>
</ol>
<ul>
<li>Under <strong>Services Configuration / Apache Configuration / Include Editor / Post Virtual Include</strong></li>
<li>Select <strong>All Versions </strong> (no point in not doing all versions)</li>
<li>Paste the following into the file and then click Update.</li>
</ul>
</blockquote>
<blockquote>
<pre>&lt;IfModule mod_deflate.c&gt;
SetOutputFilter DEFLATE
&lt;IfModule mod_setenvif.c&gt;
# Don’t compress images its a bit pointless
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
&lt;/IfModule&gt;
&lt;IfModule mod_headers.c&gt;
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
&lt;/IfModule&gt;
#maximum compression - why not we have spare cpu
DeflateCompressionLevel 9
&lt;/IfModule&gt;</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2011/02/how-to-enable-mod_deflate-for-all-sites-entire-server-in-cpanelwhm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webmail not working in Cpanel</title>
		<link>http://www.ihelm.org.uk/2010/05/webmail-not-working-in-cpanel/</link>
		<comments>http://www.ihelm.org.uk/2010/05/webmail-not-working-in-cpanel/#comments</comments>
		<pubDate>Mon, 10 May 2010 20:59:04 +0000</pubDate>
		<dc:creator>mhelm</dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[CSF]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=130</guid>
		<description><![CDATA[Had a problem earlier this week, webmail couldn't always send e-mail.  It was coming back with the following error:

SMTP Error: SMTP error: Connection failed: Failed to connect socket: Connection timed out.]]></description>
			<content:encoded><![CDATA[<p>Had a problem earlier this week, webmail couldn&#8217;t always send e-mail.  It was coming back with the following error:</p>
<p>SMTP Error: SMTP error: Connection failed: Failed to connect socket: Connection timed out.</p>
<p>After reading a few things  I turned on the SMTP tweak..  things appeared to work for a few hours, then it started failing again.</p>
<p>Searching online said to trying telnet on the command line &#8211; so did that, connected to port 25 &#8211; all fine&#8230; hmm odd &#8211; tried webmail again &#8211; failed&#8230;..</p>
<p>After a more indepth search I found a forum which gave me a hint &#8211; apparently other people have had the same problem when using the firewall for cpanel &#8211; CSF.  CSF is definately one of the best firewalls around for linux and works really well with Cpanel &#8211; however every now and again the amount of options can cause you to miss out something obvious:</p>
<p># If SMTP_BLOCK is enabled but you want to allow local connections to port 25<br />
# on the server (e.g. for webmail or web scripts) then enable this option to<br />
# allow outgoing SMTP connections to 127.0.0.1<br />
SMTP_ALLOWLOCAL = 0</p>
<p>The SMTP_ALLOWLOCAL set to 0 stops webmail etc&#8230; not sure when this appeared (the server has been working fine for about 4 months) but change it to 1 &#8211; restart CSF and there we go it&#8217;s working fine <img src='http://www.ihelm.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/05/webmail-not-working-in-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating Cpanel accounts to  new Cpanel Server &#8211; by command line.</title>
		<link>http://www.ihelm.org.uk/2010/03/migrating-cpanel-accounts-to-new-cpanel-server-by-command-line/</link>
		<comments>http://www.ihelm.org.uk/2010/03/migrating-cpanel-accounts-to-new-cpanel-server-by-command-line/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 21:26:46 +0000</pubDate>
		<dc:creator>mhelm</dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.ihelm.org.uk/?p=112</guid>
		<description><![CDATA[The Cpanel system has a feature to migrate accounts from another server - be it Cpanel or another webhosting panel - this often works, recently though I've had a problem with using it for Cpanel to Cpanel where it would connect but fail to transfer the backup file.]]></description>
			<content:encoded><![CDATA[<p>Cpanel is a good system for administrating a server with many sites on it, i&#8217;ve used ensim, webmin and a couple of others in years gone by (Plesk and parallels were disasters for me!).  However occasionally something that you think should work just doesn&#8217;t and for no obvious reason.</p>
<p>The Cpanel system has a feature to migrate accounts from another server &#8211; be it Cpanel or another webhosting panel &#8211; this often works, recently though I&#8217;ve had a problem with using it for Cpanel to Cpanel where it would connect but fail to transfer the backup file.</p>
<p>Fortunately it&#8217;s really easy to use the commandline with cpanel and you can do it manually (actually it&#8217;s easier than the wizard!)</p>
<p>On the server you are migrating from just type (while logged in as root!)</p>
<p><strong>/scripts/pkgacct <em><span style="text-decoration: underline;">username</span></em></strong></p>
<p>This will create a tar.gz in the /home directory on the server &#8211; just copy this to the new server (it could take a while &#8211; it has everything from the account you are copying).</p>
<p>On the destination server just type in</p>
<p><strong>/scripts/restorepkg </strong><em><span style="text-decoration: underline;"><strong>username</strong></span></em></p>
<p>This creates (or overwrites the account!) on the server &#8211; and your done!.  But what if you have a dedicated IP (due to SSL?)</p>
<p>Easy just use this instead</p>
<p><strong>/scripts/restorepkg &#8211;ip=y <em><span style="text-decoration: underline;">username</span></em></strong></p>
<p>This gives it the next free dedicated IP address (make sure you have one free!)</p>
<p>And that&#8217;s it &#8211; it is honestly easier than the wizard which requires you to add more info to establish the transfer link.</p>
<p>One thing to note is that you should ensure that the versions of cpanel are as near as you can get &#8211; otherwise it might fail or do things a little weird.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ihelm.org.uk/2010/03/migrating-cpanel-accounts-to-new-cpanel-server-by-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

