<?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>Ruy Rocha</title>
	<atom:link href="http://ruyrocha.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ruyrocha.com</link>
	<description>it&#039;s a long way to the top if you wanna rock and roll</description>
	<lastBuildDate>Thu, 01 Mar 2012 11:53:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using cPanel API On Ruby</title>
		<link>http://ruyrocha.com/using-cpanel-api-on-ruby/</link>
		<comments>http://ruyrocha.com/using-cpanel-api-on-ruby/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 11:52:18 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[cpanel api]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=574</guid>
		<description><![CDATA[There are many examples calling API1/API2 via PHP or Perl, but none simple or working using Ruby. So here it goes:First of it all, install HTTParty gem, then: require 'pp' require 'httparty' &#160; class Cpanel include HTTParty base_uri 'http://your-cpanel-server-address:2082/xml-api' &#160; def initialize&#40;u, p&#41; @auth = &#123;:username =&#62; u, :password =&#62; p&#125; end &#160; # mod [...]]]></description>
			<content:encoded><![CDATA[<p>There are many examples calling API1/API2 via PHP or Perl, but none simple or working using Ruby. So here it goes:<span id="more-574"></span>First of it all, install HTTParty gem, then:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'pp'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'httparty'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> Cpanel
  <span style="color:#9966CC; font-weight:bold;">include</span> HTTParty
  base_uri <span style="color:#996600;">'http://your-cpanel-server-address:2082/xml-api'</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>u, <span style="color:#CC0066; font-weight:bold;">p</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@auth</span> = <span style="color:#006600; font-weight:bold;">&#123;</span>:username <span style="color:#006600; font-weight:bold;">=&gt;</span> u, <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#CC0066; font-weight:bold;">p</span><span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># mod = cPanel module</span>
  <span style="color:#008000; font-style:italic;"># function = function, really!!!</span>
  <span style="color:#008000; font-style:italic;"># args = function's arguments</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> api<span style="color:#006600; font-weight:bold;">&#40;</span>mod, func, args=<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    query = <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:cpanel_xmlapi_user</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@auth</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:username</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
      <span style="color:#ff3333; font-weight:bold;">:cpanel_xmlapi_module</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> mod,
      <span style="color:#ff3333; font-weight:bold;">:cpanel_xmlapi_func</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> func,
      <span style="color:#ff3333; font-weight:bold;">:cpanel_xmlapi_apiversion</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">2</span>,
    <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
    options = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
    query.<span style="color:#9900CC;">merge</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>args<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    options.<span style="color:#9900CC;">merge</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:query</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> query, <span style="color:#ff3333; font-weight:bold;">:basic_auth</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@auth</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    result = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">post</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'/cpanel'</span>, options<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    result = result.<span style="color:#9900CC;">to_hash</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'cpanelresult'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'data'</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
    <span style="color:#0000FF; font-weight:bold;">return</span> result
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
cpanel = Cpanel.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'super_username'</span>, <span style="color:#996600;">'super_password'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
pp cpanel.<span style="color:#9900CC;">api</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'Net'</span>, <span style="color:#996600;">'dnszone'</span>, <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:host</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'google.com'</span> <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/using-cpanel-api-on-ruby/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/using-cpanel-api-on-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SEO Myth: Geographic Server Location</title>
		<link>http://ruyrocha.com/seo-myth-geographic-server-location/</link>
		<comments>http://ruyrocha.com/seo-myth-geographic-server-location/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 11:27:53 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[seo geographic server location]]></category>
		<category><![CDATA[seo myth]]></category>
		<category><![CDATA[seo server location]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=566</guid>
		<description><![CDATA[Matt Cutts have confirmed three years ago geographic server location influences on SEO rankings in this video: Well, I disagree. I have a few Brazilian websites hosted on USA which ranks better than websites for same niche hosted here in Brazil. So, final assumptions: have you ever seen a Google crawler from 200.x (&#8220;local&#8221; ip [...]]]></description>
			<content:encoded><![CDATA[<p>Matt Cutts have confirmed three years ago geographic server location influences on SEO rankings in this video:<br />
<span id="more-566"></span></p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/keIzr3eWK8I?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Well, I disagree. I have a few Brazilian websites hosted on USA which ranks better than websites for same niche hosted here in Brazil. So, final assumptions:</p>
<ol>
<li>have you ever seen a Google crawler from 200.x (&#8220;local&#8221; ip address)?!</li>
<li>we are not talking about domain names, and local TLD&#8217;s will rank better. For example, Google.com.br will always be more friendly to .com.br domain names, but</li>
<li><strong>focus on website speed</strong> because it improves user experience -  Google loves that! This is the reason we&#8217;ve moved to a new server: four weeks ago my name dropped to 5th page on Google results, but now everything is right: first page, first spot<del>, and will always be there</del></li>
</ol>
<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/seo-myth-geographic-server-location/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/seo-myth-geographic-server-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Business Process Reengineering</title>
		<link>http://ruyrocha.com/business-process-reengineering/</link>
		<comments>http://ruyrocha.com/business-process-reengineering/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 14:39:09 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[bpr]]></category>
		<category><![CDATA[business process reenginering]]></category>
		<category><![CDATA[support system]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=539</guid>
		<description><![CDATA[I&#8217;ve researched at least twice to get better term for what I&#8217;m trying to describe and BPR fits good here. Business Process Re-Engineering focuses on improve customer services and cut operational costs. The reason behind doing this is really because the particular intention to create main improvements within a set of sub processes. Techniques that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve researched at least twice to get better term for what I&#8217;m trying to describe and BPR fits good here. Business Process Re-Engineering focuses on <strong>improve customer services </strong>and <strong>cut operational costs</strong>. The reason behind doing this is really because the particular intention to create main improvements within a set of sub processes. Techniques that have been created and many most likely extended throughout their everyday life might need to end up being reviewed, looked into as well as re-built, because they reduce effectiveness.<span id="more-539"></span></p>
<p>Given you have this scenario:</p>
<p><a href="http://ruyrocha.com/wp-content/uploads/2012/01/Screenshot-4.png"><img class="alignnone size-medium wp-image-546" title="Screenshot-4" src="http://ruyrocha.com/wp-content/uploads/2012/01/Screenshot-4-300x103.png" alt="Screenshot 4 300x103 Business Process Reengineering" width="300" height="103" /></a></p>
<p>Let me explain&#8230; Customers will always <strong>go for support system when they have problems</strong> and almost no one will <em>loose time</em> to say &#8220;thank you! all my services are up and running and you over delivered what I&#8217;ve paid for&#8221;. Some may scale a ticket only when troubles  are not solved immediately &#8211; because they don&#8217;t know how to solve it or don&#8217;t have enough access to make needed modifications.</p>
<p><a href="http://ruyrocha.com/wp-content/uploads/2012/01/Screenshot-5.png"><img class="alignnone size-medium wp-image-552" title="Screenshot-5" src="http://ruyrocha.com/wp-content/uploads/2012/01/Screenshot-5-300x60.png" alt="Screenshot 5 300x60 Business Process Reengineering" width="300" height="60" /></a></p>
<p>WDCP means <em>World Domination Control Panel</em>, and personally I think it&#8217;s the biggest project I&#8217;ve worked on until now. Solve all your problems from only one point with a few clicks, bypass any access restriction &#8211; so you  don&#8217;t have to scale anything because you don&#8217;t have access. Will be great to integrate some kind of wiki/knowledgebase too.</p>
<p>I&#8217;d like to write everything about WDCP but cannot do it right now. Finally, I need to say thank you for <strong>Jimmy Lu</strong>, BLABLABLA&#8217;s <em>Director of Operations -</em> I&#8217;ve bought a cheap VPS to write WDCP (something around five bucks) and they lost all my data twice.</p>
<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/business-process-reengineering/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/business-process-reengineering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel License and Dynamic IP Address</title>
		<link>http://ruyrocha.com/cpanel-license-and-dynamic-ip-address/</link>
		<comments>http://ruyrocha.com/cpanel-license-and-dynamic-ip-address/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 02:17:28 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[cpanel license]]></category>
		<category><![CDATA[cpanel license dynamic ip address]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=555</guid>
		<description><![CDATA[Quoting cPanel staff: Because cPanel is designed for commercial hosting, we only license publicly-visible, static IP addresses. We do not license dynamic, sticky, or internal IP addresses, until now. I&#8217;ll only develop my applications locally since last data loss using some cheap virtual server provider &#8211; I&#8217;ve lost all my data twice with this provider. So [...]]]></description>
			<content:encoded><![CDATA[<p>Quoting cPanel staff: <em>Because cPanel is designed for commercial hosting, we only license publicly-visible, static IP addresses. We do not license dynamic, sticky, or internal IP addresses</em>, <strong>until now</strong>.<span id="more-555"></span></p>
<p>I&#8217;ll only develop my applications locally since last data loss using some cheap virtual server provider &#8211; I&#8217;ve lost all my data twice with this provider. So I went ahead and created a local server for cPanel but its license was disabled today, and now it shows there is no license for my address:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>opsbox <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># /usr/local/cpanel/cpkeyclt</span>
Updating cPanel license...Done. Update Failed<span style="color: #000000; font-weight: bold;">!</span>
Error message:
The cPanel license server said that there was no license <span style="color: #000000; font-weight: bold;">for</span> your IP address.
For <span style="color: #c20cb9; font-weight: bold;">more</span> information visit: http:<span style="color: #000000; font-weight: bold;">//</span>www.cpanel.net<span style="color: #000000; font-weight: bold;">/</span>lic.html
&nbsp;
The exact message was: No license entry found <span style="color: #000000; font-weight: bold;">for</span> your machine <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">187</span>.x.x.x<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
Building global cache <span style="color: #000000; font-weight: bold;">for</span> cpanel...Done</pre></div></div>

<p>I&#8217;ve bought a valid license on www.buycpanel.com for some random server with static/valid ip address and downloaded <strong>tsocks</strong> from repoforge.org. To get my licensed activated, I must log into validserver (ssh session will acts as socks server):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">perseverance ~ $ <span style="color: #c20cb9; font-weight: bold;">ssh</span> validserver <span style="color: #660033;">-D</span> <span style="color: #000000;">31313</span>
...</pre></div></div>

<p>Instruct tsocks on opsbox to use this socks proxy:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>opsbox <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cat /etc/tsocks.conf </span>
<span style="color: #7a0874; font-weight: bold;">local</span> = <span style="color: #000000;">10</span>.x.x.x<span style="color: #000000; font-weight: bold;">/</span>255.255.255.255
server = <span style="color: #000000;">10</span>.x.x.x
server_type = <span style="color: #000000;">5</span>
server_port = <span style="color: #000000;">31313</span></pre></div></div>

<p>And update my license information:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>opsbox <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># /usr/local/cpanel/cpkeyclt</span>
Updating cPanel license...Done. Update Failed<span style="color: #000000; font-weight: bold;">!</span>
Error message:
The cPanel license server said that your license has been expired.
For <span style="color: #c20cb9; font-weight: bold;">more</span> information visit: http:<span style="color: #000000; font-weight: bold;">//</span>www.cpanel.net<span style="color: #000000; font-weight: bold;">/</span>lic.html
&nbsp;
The exact message was: The license is expired. <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">187</span>.x.x.x<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
Building global cache <span style="color: #000000; font-weight: bold;">for</span> cpanel...Done
root<span style="color: #000000; font-weight: bold;">@</span>opsbox <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># tsocks /usr/local/cpanel/cpkeyclt</span>
Updating cPanel license...Done. Update succeeded.
Building global cache <span style="color: #000000; font-weight: bold;">for</span> cpanel...Done
root<span style="color: #000000; font-weight: bold;">@</span>opsbox <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># tsocks lynx -dump http://www.cpanel.net/showip.cgi</span>
00:<span style="color: #000000;">13</span>:00 libtsocks<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17585</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: Call to connect received on completed request <span style="color: #000000;">3</span>
&nbsp;
   <span style="color: #000000;">69</span>.x.x.x</pre></div></div>

<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/cpanel-license-and-dynamic-ip-address/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/cpanel-license-and-dynamic-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gotta Go</title>
		<link>http://ruyrocha.com/gotta-go/</link>
		<comments>http://ruyrocha.com/gotta-go/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 16:00:11 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[internet business]]></category>
		<category><![CDATA[internet marketing]]></category>
		<category><![CDATA[success]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=523</guid>
		<description><![CDATA[No one fails in internet business but many quit before they achieve the success. There are lots of buzz and miracle formulas but success takes time and perseverance. If you did not hit anything, double your efforts, be patient and persist. Only yourself can describe your success but it&#8217;s not time to quit if you [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>No one fails in internet business but many quit before they achieve the success.</strong> <span id="more-523"></span><em>There are lots of buzz and miracle formulas but success takes <strong>time</strong> and perseverance. If you did not hit anything, double your efforts, be patient and <strong>persist</strong>. Only yourself can describe your success but it&#8217;s not time to quit if you did not hit anything. </em>Read that at least five times and see you are not a looser by birth &#8211; trust me! Internet business allows you to work some minutes a week and obtain some figures in bank. When you hit some point it&#8217;s time to scale and double this kind of (love this term) residual income. Residual income can be used to pay bills, parties, a new car and almost everything you want or need. Listen me: do not spend this money in foolish things. </em></p>
<p><em>It&#8217;s time to re-invest and scale things up.</em></p>
<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/gotta-go/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/gotta-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel &#8211; Restrict Root Login</title>
		<link>http://ruyrocha.com/cpanel-restrict-root-login/</link>
		<comments>http://ruyrocha.com/cpanel-restrict-root-login/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 16:04:15 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[restrict root login]]></category>
		<category><![CDATA[security policy]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=510</guid>
		<description><![CDATA[Recently I&#8217;ve talked about the new cPanel feature &#8211; Security Policies &#8211; and there is no way to restrict root logins only to valid or allowed ip addresses until now. The cPanel&#8217;s Security Policy is a framework which let you improve you security or practices. For example take the test server tnt.ruyrocha.com and its root [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve talked about the <em>new</em> cPanel feature &#8211; Security Policies &#8211; and there is no way to restrict root logins only to valid or allowed ip addresses until now.<span id="more-510"></span></p>
<p>The cPanel&#8217;s Security Policy is a framework which let you improve you security or practices. For example take the test server tnt.ruyrocha.com and its root password <strong>3Y6Nn5CW44bY0F?5F}gHoWDy:KFzAGtp</strong> Go ahead and try to access it: https://tnt.ruyrocha.com:2087/login/?user=root&amp;pass=3Y6Nn5CW44bY0F?5F}gHoWDy:KFzAGtp</p>
<p>TNT will be available until next Friday, 02/09, so feel free to give it a try. I don&#8217;t want anyone being able to access it from home, just from office&#8217;s ip address. The <strong>RestrictRoot</strong> security policy module must be included in /usr/local/cpanel/Cpanel/SecurityPolicy as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000066;">package</span> Cpanel<span style="color: #339933;">::</span><span style="color: #006600;">SecurityPolicy</span><span style="color: #339933;">::</span><span style="color: #006600;">RestrictRoot</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># cpanel - Cpanel/SecurityPolicy/RestrictRoot.pm</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Copyright (c) 2011 Ruy Rocha </span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Permission is hereby granted, free of charge, to any person obtaining a copy of</span>
<span style="color: #666666; font-style: italic;"># this software and associated documentation files (the &quot;Software&quot;), to deal in the</span>
<span style="color: #666666; font-style: italic;"># Software without restriction, including without limitation the rights to use, copy,</span>
<span style="color: #666666; font-style: italic;"># modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,</span>
<span style="color: #666666; font-style: italic;"># and to permit persons to whom the Software is furnished to do so, subject to the</span>
<span style="color: #666666; font-style: italic;"># following conditions:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># The above copyright notice and this permission notice shall be included in all copies</span>
<span style="color: #666666; font-style: italic;"># or substantial portions of the Software.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,</span>
<span style="color: #666666; font-style: italic;"># INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR</span>
<span style="color: #666666; font-style: italic;"># PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span>
<span style="color: #666666; font-style: italic;"># LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,</span>
<span style="color: #666666; font-style: italic;"># TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE</span>
<span style="color: #666666; font-style: italic;"># USE OR OTHER DEALINGS IN THE SOFTWARE.</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$priority</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> check <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$acctref</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$sec_ctxt</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$cpconf_ref</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$cookie_ref</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$sec_ctxt</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'appname'</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'whostmgrd'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$acctref</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'user'</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'root'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">return</span> _ip_passes<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sec_ctxt</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'remoteip'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Return true if this address is valid, false otherwise.</span>
<span style="color: #000000; font-weight: bold;">sub</span> _ip_passes <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$remote_ip</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@allowed_ips</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'187.x.x.x'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'17.x.x.x'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #0000ff;">$remote_ip</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    Carp<span style="color: #339933;">::</span><span style="color: #006600;">confess</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;I am missing the users remote ip.  Security Policy requires exec termination.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000066;">return</span> <span style="color: #0000ff;">$priority</span> <span style="color: #b1b100;">if</span> <span style="color: #339933;">!</span><span style="color: #000066;">grep</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/$remote_ip$/</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">@allowed_ips</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre></div></div>

<p>Save the code to <strong>/usr/local/cpanel/Cpanel/SecurityPolicy/RestrictRoot.pm</strong> and activate the module on WHM.</p>
<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/cpanel-restrict-root-login/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/cpanel-restrict-root-login/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>cPanel &#8211; Melhorias e Alterações Recentes</title>
		<link>http://ruyrocha.com/cpanel-melhorias-e-alteracoes-recentes/</link>
		<comments>http://ruyrocha.com/cpanel-melhorias-e-alteracoes-recentes/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 01:49:41 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[cpanelsync]]></category>
		<category><![CDATA[database mapping]]></category>
		<category><![CDATA[eol]]></category>
		<category><![CDATA[lts]]></category>
		<category><![CDATA[md5 passwords]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pkgacct]]></category>
		<category><![CDATA[restoreaccount]]></category>
		<category><![CDATA[security policies]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=502</guid>
		<description><![CDATA[Nas duas últimas versões do cPanel &#8211; 11.28 e 11.30 &#8211; uma série de alterações foram realizadas, como: Mapeamento De Bancos De Dados: os bancos de dados criados seguiam o padrão conta_nomedobanco; agora é possível especificar somente o banco, por exemplo, e também especificar em qual servidor a base de dados está É possível fugir [...]]]></description>
			<content:encoded><![CDATA[<p>Nas duas últimas versões do cPanel &#8211; 11.28 e 11.30 &#8211; uma série de alterações foram realizadas, como:<span id="more-502"></span></p>
<ul>
<li>Mapeamento De Bancos De Dados: os bancos de dados criados seguiam o padrão <strong>conta_nomedobanco</strong>; agora é possível especificar somente o banco, por exemplo, e também especificar em qual servidor a base de dados está</li>
<li>É possível fugir do trio RoundCube, Horde IMP e Squirrelmail e usar um webmail alternativo</li>
<li>Uso de senhas com MD5 (ao invés de crypt) está disponível, o que melhora a segurança até certo ponto</li>
<li>Tokens de segurança estão habilitados na instalação padrão</li>
<li>Otimização do script <strong>pkgacct</strong></li>
<li>Restauração de contas através da API</li>
<li><strong>Security Policies</strong></li>
<li>Novo caminho dos scripts: /scripts -&gt; /usr/local/cpanel/scripts</li>
<li>LTS (long term support) + EOL (end of life)</li>
<li>/etc/cpanelsync.exclude: lista dos arquivos que não precisam de atualização (<em>like immutable files</em>)</li>
<li>/etc/cpanelsync.no_chmod: arquivos contidos aqui não terão suas permissões modificadas</li>
<li>MySQL VIEWS &amp; TRIGGERS disponíveis no cPanel &#8211; se, e somente se, a versão do MySQL for superior ou igual a 5.1</li>
</ul>
<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/cpanel-melhorias-e-alteracoes-recentes/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/cpanel-melhorias-e-alteracoes-recentes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVZ: Administração de CPU</title>
		<link>http://ruyrocha.com/openvz-administracao-de-cpu/</link>
		<comments>http://ruyrocha.com/openvz-administracao-de-cpu/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 12:06:04 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Virtualização]]></category>
		<category><![CDATA[cpulimit]]></category>
		<category><![CDATA[cpuunits]]></category>
		<category><![CDATA[openvz]]></category>
		<category><![CDATA[ve0cpuunits]]></category>
		<category><![CDATA[vzcpucheck]]></category>
		<category><![CDATA[vzctl]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=470</guid>
		<description><![CDATA[A falta de limites para os containers pode ser um grande problema, e um container pode comprometer a qualidade do serviço oferecido para os demais pelo excesso de tempo de uso de CPU. Para adicionarmos os limites, existem dois parâmetros a serem trabalhados: cpuunits &#38; cpulimit. O comando vzcpucheck nos dá o total de unidades de [...]]]></description>
			<content:encoded><![CDATA[<p>A falta de <strong>limites</strong> para os containers pode ser um grande problema, e um container pode comprometer a qualidade do serviço oferecido para os demais pelo excesso de tempo de uso de CPU. Para adicionarmos os limites, existem dois parâmetros a serem trabalhados: <strong>cpuunits &amp; cpulimit</strong>.<span id="more-470"></span></p>
<p>O comando <strong>vzcpucheck</strong> nos dá o total de unidades de CPU disponíveis no nó e também o uso corrente destas unidades. Por exemplo, o poder total do nó pode ser igual a 1991330 (Intel Xeon E5620) e possuirmos cinco containers com 1000 cpuunits. Aqui a saída do vzcpucheck nos mostraria o uso de 5000 cpuunits. Cada container possui mil unidades de CPU garantidas, e o restante das unidades (<strong>1986330</strong>) será distribuído pelos containers, e até onde vi <em>quem chega primeiro é beneficiado</em>, ou seja, se o container 102 está <strong>no talo</strong> é possível que permaneça. Para limitar é preciso utilizar o cpulimit.</p>
<p>Ainda com o container 102, podemos garantir 20% das unidades de CPU (cpuunits igual a 398266), mas não queremos que este container utilize mais que 25% do processamento total, ex:</p>
<p># vzctl set 102 &#8211;cpuunits 398266 &#8211;cpulimit 25 &#8211;save</p>
<p>Por último, é bom lembrar de ajustar os valores de <strong>ve0cpuunits</strong>. Com memória e também com processamento como limites não temos mais problema, certo? Outros dois fatores que serão vistos em breve são: <strong>I/O</strong> e <strong>velocidade de link</strong>.</p>
<p>&nbsp;</p>
<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/openvz-administracao-de-cpu/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/openvz-administracao-de-cpu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel &#8211; Prevent Mail Spoofing</title>
		<link>http://ruyrocha.com/cpanel-prevent-mail-spoofing/</link>
		<comments>http://ruyrocha.com/cpanel-prevent-mail-spoofing/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 07:17:36 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[email spoofing]]></category>
		<category><![CDATA[exim]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=493</guid>
		<description><![CDATA[Email spoofing consists in send email as others. You can authenticate as username@domain.com and send email as boss@domain.com by default on cPanel servers due to Exim&#8217;s configuration and this is not needed in some environments. So to prevent email spoofing and send email only as authenticated user add the following to your Exim&#8217;s check_recipient ACL: 1 2 3 4 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Email spoofing</strong> consists in send email as others. You can authenticate as <em>username@domain.com</em> and send email as <em>boss@domain.com</em> by default on cPanel servers due to Exim&#8217;s configuration and this is not needed in some environments.</p>
<p><span id="more-493"></span></p>
<p>So to prevent email spoofing and send email only as authenticated user add the following to your Exim&#8217;s check_recipient ACL:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">  deny
    message = <span style="color: #ff0000;">&quot;Incorrect from address &lt;<span style="color: #007800;">${sender_address}</span>&gt;. Please use &lt;<span style="color: #007800;">${authenticated_id}</span>&gt; instead&quot;</span>
    authenticated = <span style="color: #000000; font-weight: bold;">*</span>
    <span style="color: #000000; font-weight: bold;">!</span> condition = <span style="color: #800000;">${if match_address{${sender_address}</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #007800;">$authenticated_id</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/cpanel-prevent-mail-spoofing/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/cpanel-prevent-mail-spoofing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel &#8211; Secure Remote Logins</title>
		<link>http://ruyrocha.com/cpanel-secure-remote-logins/</link>
		<comments>http://ruyrocha.com/cpanel-secure-remote-logins/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 06:29:57 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[cpanel remote login]]></category>
		<category><![CDATA[cpanel secure remote login]]></category>
		<category><![CDATA[cpanel security]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=479</guid>
		<description><![CDATA[You can access cPanel/WHM by passing username and password as URL parameters like http://happywebserver.com:2086/login/?user=MYUSER&#38;pass=MYPASSWORD Sadly it&#8217;s not secure and this way is used in many third party applications. The secure way to log into cPanel/WHM is using a valid session, without user or password in URL.Documentation about secure remote logins introduces us to another cPanel&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>You can access cPanel/WHM by passing username and password as URL parameters like</p>
<blockquote><p>http://happywebserver.com:2086/login/?user=MYUSER&amp;pass=MYPASSWORD</p></blockquote>
<p>Sadly it&#8217;s not secure and this way is used in many third party applications. The secure way to log into cPanel/WHM is using a valid session, without user or password in URL.<span id="more-479"></span>Documentation about <a title="Secure Remote Logins - cPanel/WHM Docs" href="http://docs.cpanel.net/twiki/bin/view/AllDocumentation/SecureRemoteLogins">secure remote logins</a> introduces us to another cPanel&#8217;s module &#8211; LogMeIn &#8211; and this module returns a URL that you can just click to log into a valid session. We can reproduce the same behavior with <strong>cURL</strong> and say &#8220;goodbye&#8221; to insecure accesses:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$url</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;https://happywebserver.com:2087/login/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$post_args</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;user=<span style="color: #006699; font-weight: bold;">$user</span>&amp;pass=<span style="color: #006699; font-weight: bold;">$pass</span>&amp;goto_uri=<span style="color: #009933; font-weight: bold;">%2F</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_FOLLOWLOCATION<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYPEER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_SSL_VERIFYHOST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #000088;">$post_args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/^Set-Cookie: whostmgrsession=(.*?);/m'</span><span style="color: #339933;">,</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$whm_session</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$session</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$whm_session</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$whm_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$url</span>?session=<span style="color: #006699; font-weight: bold;">$session</span>&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: <span style="color: #006699; font-weight: bold;">$whm_url</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// do nothing</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/cpanel-secure-remote-logins/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/cpanel-secure-remote-logins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

