<?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>Richy&#039;s Random Ramblings &#187; Net: Techy: cPanel</title>
	<atom:link href="http://blog.rac.me.uk/category/net-techy-cpanel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rac.me.uk</link>
	<description>Random ramblings and ravings of Richy C</description>
	<lastBuildDate>Mon, 16 Jan 2012 12:16:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>cPanel: Error: Package system can not be repaired automatically</title>
		<link>http://blog.rac.me.uk/2009/06/07/cpanel-error-package-system-can-not-be-repaired-automatically/</link>
		<comments>http://blog.rac.me.uk/2009/06/07/cpanel-error-package-system-can-not-be-repaired-automatically/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 15:04:58 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[Net: Techy: Linux]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[package system]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/?p=1516</guid>
		<description><![CDATA[If, like myself, you have recently upgraded the cPanel control panel system on your Red Hat Enterprise Linux 5.2 server and received the error message &#8220;Error: Package system can not be repaired automatically&#8221; when upgrading Apache, then it&#8217;s probably caused by a problem with either the RedHat Package Manager (RPM) or YUM. To fix it, [...]]]></description>
			<content:encoded><![CDATA[<p>If, like myself, you have recently upgraded the cPanel control panel system on your Red Hat Enterprise Linux 5.2 server and received the error message &#8220;Error: Package system can not be repaired automatically&#8221; when upgrading Apache, then it&#8217;s probably caused by a problem with either the RedHat Package Manager (RPM) or YUM. To fix it, first ensure that no RPM or yum updates are running:<br />
<code>ps auxwww | grep yum<br />
ps auxwww | grep rpm</code><br />
If any are running, find out why and kill -9 them if they are zombie processes. Now you just need to rebuild the RPM database:<br />
<code> rm /var/lib/rpm/__db.* -rf<br />
rpm --rebuilddb</code><br />
This process may take some time (between 1 and 30 minutes depending on your server speed and the number of packages installed). Once it&#8217;s completed, you should be able to upgrade without problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2009/06/07/cpanel-error-package-system-can-not-be-repaired-automatically/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>cPanel: Simple Script To Backup Over rSync</title>
		<link>http://blog.rac.me.uk/2007/08/20/cpanel-simple-script-to-backup-over-rsync/</link>
		<comments>http://blog.rac.me.uk/2007/08/20/cpanel-simple-script-to-backup-over-rsync/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 20:53:45 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[whm]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/2007/08/20/cpanel-simple-script-to-backup-over-rsync/</guid>
		<description><![CDATA[If you are running a reasonably recent version of cPanel (I think v11 or later), you have the ability to run WHM backups over rsync instead of just FTP. This post, if it isn&#8217;t obvious, is intended for people with root access to their cPanel server. So how do you do this? Simple, configure the [...]]]></description>
			<content:encoded><![CDATA[<p>If you are running a reasonably recent version of cPanel (I think v11 or later), you have the ability to run WHM backups over rsync instead of just FTP. This post, if it isn&#8217;t obvious, is intended for people with root access to their cPanel server.</p>
<p>So how do you do this?</p>
<p>Simple, configure the backups as per normal in WHM to backup your secondary hard drive or a set partition on your main hard drive. Then just add a script via the shell command line as &#8220;/scripts/postcpbackup&#8221; (open PuTTY, connect to the server, login, &#8220;su&#8221; to root if necessary if you didn&#8217;t login as root, type &#8220;nano -w /scripts/postcpbackup&#8221;) and past the following script:<br />
<code><br />
#!/bin/sh<br />
rsync -vrplogDth /backup/cpbackup/* username@backupserver:/backuplocation/<br />
</code></p>
<p>Replacing &#8220;/backup/cpbackup/&#8221; with the location of your &#8220;local backups&#8221; if you changed it from the default, &#8220;username&#8221; with the username of your rSync account, &#8220;backupserver&#8221; with the hostname/IP address of the backup server and &#8220;backuplocation&#8221; of the place to store the backups. (It&#8217;s CTRL+X to exit nano by the way).</p>
<p>You then just need to make it executable by running &#8220;chmod a+x /scripts/postcpbackup&#8221; and you are done!</p>
<p>Hope it helps someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2007/08/20/cpanel-simple-script-to-backup-over-rsync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel: cPanel 11 and WebDav</title>
		<link>http://blog.rac.me.uk/2007/05/14/cpanel-cpanel-11-and-webdav/</link>
		<comments>http://blog.rac.me.uk/2007/05/14/cpanel-cpanel-11-and-webdav/#comments</comments>
		<pubDate>Mon, 14 May 2007 21:37:51 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[webdav]]></category>
		<category><![CDATA[whm]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/2007/05/14/cpanel-cpanel-11-and-webdav/</guid>
		<description><![CDATA[As some of you may be aware, the new version of cPanel (version 11) now supports a technology called &#8220;WebDav&#8221; (known as &#8220;Web Disks&#8221; within cPanel). Basically this allows you to setup your cPanel web hosting account as an additional drive on your machine &#8211; making the uploading and publishing of files a lot easier. [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you may be aware, the new version of cPanel (version 11) now supports a technology called &#8220;WebDav&#8221; (known as &#8220;Web Disks&#8221; within cPanel).</p>
<p>Basically this allows you to setup your cPanel web hosting account as an additional drive on your machine &#8211; making the uploading and publishing of files a lot easier.</p>
<p>However, server administrators will first need to enable the TCP ports 2077 and 2078 in and outbound for this to work correctly (don&#8217;t forget to restart/reload the firewall). Once that&#8217;s done, your customers should be able to login to their cPanel control panel and either select the new fancy &#8220;Getting Started&#8221; wizard or &#8220;Web Disks-&gt;Access Web Disk&#8221; to setup a link.</p>
<p>Using cPanel&#8217;s handy &#8220;Auto configuration&#8221; tool is useful &#8211; but you may hit the same problem I did when I downloaded the installer .vbs file to my Windows XP machine via Firefox. Attempting to open the file came up with the error &#8220;Windows Script Host access is disabled on this machine. Contact your administrator for details&#8221;. Needless to say &#8211; I am the administrator and if I&#8217;ve disabled something like that in the past, it&#8217;s probably for a very good reason!</p>
<p>So &#8211; how can we manually configure cPanel&#8217;s WebDav uploading tool manually if the automatic method fails?&#8230;.<br />
<span id="more-703"></span></p>
<p><strong>Manual Secure Method</strong></p>
<p>This is the recommended method and will encrypted your login details and your data as it passes to and from your machine to the server. However, you will need to accept a few security warnings.</p>
<ol>
<li>First access the &#8220;My Network Places&#8221; option on your Windows machine (it&#8217;ll probably show up on your desktop somewhere).</li>
<li>Then click &#8220;Add Network Place&#8221;</li>
<li>Click &#8220;Next&#8221; and it should ask &#8220;Where do you want to create this network place?&#8221; and provide you with (most probably) a single option labelled &#8220;Choose another network location&#8221;. Select that option and click Next.</li>
<li>In the &#8220;Internet or network address&#8221; box enter &#8220;<code>https://www.example.com:2078/</code>&#8221; (where example.com is your domain name) and click Next</li>
<li>You may receive a pop up security alert saying &#8220;This page requires a secure connection which includes server authentication. The certificate issuer for this site is untrusted or unknown. Do you wish to proceeed?&#8221; &#8211; click Yes. Basically this means that whilst the connection is encrypted, your computer cannot automatically detect that the server you are connecting to is who it is claming to be for the encryption (but all we care about is that our data is being encrypted).</li>
<li>You may then receive another pop up security alert saying &#8220;A secure connection with this site cannot be verified. Would you still like to proceed? The certificate you are viewing does not match the name of the site you are trying to view&#8221;. Again, just click Yes</li>
<li>It&#8217;ll then ask you to login &#8211; just use your cPanel login details.</li>
<li>Add a name for the location and click Next</li>
<li>Now if you go to &#8220;My Network Places&#8221; and click on the icon (and approve the security alerts and maybe login again), you&#8217;ll be able to access all your web files as if they were on your hard drive.</li>
</ol>
<p><strong>Manual Insecure Method</strong></p>
<p>If you don&#8217;t mind your login details being sent in &#8220;plain text&#8221; across the internet and would prefer to skip the security warnings, then follow these steps:</p>
<ol>
<li>First access the &#8220;My Network Places&#8221; option on your Windows machine (it&#8217;ll probably show up on your desktop somewhere).</li>
<li>Then click &#8220;Add Network Place&#8221;</li>
<li>Click &#8220;Next&#8221; and it should ask &#8220;Where do you want to create this network place?&#8221; and provide you with (most probably) a single option labelled &#8220;Choose another network location&#8221;. Select that option and click Next.</li>
<li>In the &#8220;Internet or network address&#8221; box enter &#8220;<code>http://www.example.com:2077/</code>&#8221; (where example.com is your domain name) and click Next</li>
<li>It&#8217;ll then ask you to login &#8211; just use your cPanel login details.</li>
<li>Add a name for the location and click Next</li>
<li>Now if you go to &#8220;My Network Places&#8221; and click on the icon (and maybe login again), you&#8217;ll be able to access all your web files as if they were on your hard drive.</li>
</ol>
<p>Hope it helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2007/05/14/cpanel-cpanel-11-and-webdav/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Techy: Dealing with .tar.gz, .gz and .zip files on a cPanel Server</title>
		<link>http://blog.rac.me.uk/2007/05/13/techy-dealing-with-targz-gz-and-zip-files-on-a-cpanel-server/</link>
		<comments>http://blog.rac.me.uk/2007/05/13/techy-dealing-with-targz-gz-and-zip-files-on-a-cpanel-server/#comments</comments>
		<pubDate>Sun, 13 May 2007 10:23:42 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[whm]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/2007/05/13/techy-dealing-with-targz-gz-and-zip-files-on-a-cpanel-server/</guid>
		<description><![CDATA[Many of you with cPanel web hosting accounts would have needed to upload files to a cPanel server which were in .tar.gz, .gz or .zip files (these are compressed archives). And I bet many of you would like to have been able to upload the archives to the server &#8220;as is&#8221; (to save decompressing them [...]]]></description>
			<content:encoded><![CDATA[<p>Many of you with cPanel web hosting accounts would have needed to upload files to a cPanel server which were in .tar.gz, .gz or .zip files (these are compressed archives).</p>
<p>And I bet many of you would like to have been able to upload the archives to the server &#8220;as is&#8221; (to save decompressing them on your machine and then having to slowly upload each and every file).</p>
<p>But did you know there is actually a &#8220;cheat&#8221; for this?</p>
<p>Just upload the files to your webspace via FTP (or via the cPanel File Manager) as per usual. Then login to your cPanel control panel and select &#8220;File Manager&#8221; (if you are running on the new x3 theme with cPanel 11, it doesn&#8217;t matter if you select &#8220;File Manager&#8221; or &#8220;Legacy File Manager&#8221;). Select the archive you uploaded, and then click &#8220;Decompress&#8221; from the top menu (on the new file manager) or &#8220;Extract from Archive&#8221; from the right hand menu (on the old file manager) and there you go.</p>
<p>Your files are now decompressed on the server quickly and simply!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2007/05/13/techy-dealing-with-targz-gz-and-zip-files-on-a-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Techy: Outdated Coppermine Finder</title>
		<link>http://blog.rac.me.uk/2006/08/10/techy-outdated-coppermine-finder/</link>
		<comments>http://blog.rac.me.uk/2006/08/10/techy-outdated-coppermine-finder/#comments</comments>
		<pubDate>Thu, 10 Aug 2006 23:10:56 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[coppermine]]></category>
		<category><![CDATA[cpanel]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/2006/08/10/techy-outdated-coppermine-finder/</guid>
		<description><![CDATA[Whilst on the subject of outdated cPanel based things, I&#8217;ve just put together a quick little script to scan a cPanel based webserver for outdated Coppermine Photo Gallery installations. As the notes state, the script isn&#8217;t pretty, it isn&#8217;t efficient, but it works. Comments/feedback are appreciated. Coppermine Gallery Outdated installation checker v0.01 Set $disableandemail to [...]]]></description>
			<content:encoded><![CDATA[<p>Whilst <a href="http://blog.rac.me.uk/2006/08/10/techy-cpanel-dns-cleardown-script/">on the subject of outdated cPanel based things</a>, I&#8217;ve just put together a quick little script to scan a cPanel based webserver for outdated Coppermine Photo Gallery installations.</p>
<p>As the notes state, the script isn&#8217;t pretty, it isn&#8217;t efficient, but it works.</p>
<p>Comments/feedback are appreciated.<br />
<a id="p654" href="http://blog.rac.me.uk/wp-content/uploads/2006/08/copfind.txt">Coppermine Gallery Outdated installation checker v0.01</a></p>
<p>Set $disableandemail to 1 to disable the scripts and email the users.<br />
<span id="more-652"></span><br />
<code><br />
#!/usr/bin/perl<br />
# Coppermine Gallery Outdated installation checker<br />
# Suitable for cPanel servers<br />
# Checks for unpatched files covered in<br />
# http://coppermine-gallery.net/forum/index.php?topic=31671.0 and<br />
# http://coppermine-gallery.net/forum/index.php?topic=32413.0<br />
#<br />
# Written by Richard Chiswell. http://www.rac.me.uk<br />
# 11-Aug-2006.<br />
# Script revision: 0.01 (it works, but it ain't pretty or efficient)<br />
#<br />
print "Searching for coppermine files...\n";<br />
$disableandemail=0;<br />
while(@PW=getpwent()) {<br />
 if (-d "$PW[7]/public_html" &amp;&amp; -e "/var/cpanel/users/$PW[0]")  {<br />
  $username=$PW[0];$path=$PW[7];<br />
  system("find ".$path."/public_html/ -type f -name usermgr.php -print &gt; /root/coppermine.txt");<br />
  open(VA,"&lt; /root/coppermine.txt") || die("Unable to open /root/coppermine.txt");<br />
  while (&lt;VA&gt;) {<br />
   $filename=$_;$linecount=0;$found=0;$revision=0;<br />
   open(FILE,"&lt; $filename") || die("Unable to open $filename");<br />
   while ($linecount&lt;20 &amp;&amp; $found==0) {<br />
    $line=&lt;FILE&gt;;<br />
    if ($line=~/\$Revision: ([0-9\.]+)/) { $revision=$1;$found=1; }<br />
    $linecount++;<br />
   }<br />
   close(FILE);<br />
   $filename=~s/(\n|\r)//g;<br />
   if ($found==1) {<br />
	if ($revision&lt;3116) {<br />
	 $scriptpath=$filename;<br />
	 $scriptpath=~s/$path//;<br />
     sendwarning($username,$path,$scriptpath,$revision,$filename,$disableandemail);<br />
	}<br />
   }<br />
  }<br />
  close(VA);<br />
  # check for other vunerability<br />
  system("find ".$path."/public_html/ -type f -name functions.inc.php -print &gt; /root/coppermine.txt");<br />
  open(VA,"&lt; /root/coppermine.txt") || die("Unable to open /root/coppermine.txt");<br />
  while (&lt;VA&gt;) {<br />
   $filename=$_;$found=0;$vunerable=1;$ver='';<br />
   if (!($filename=~/include\/functions.inc.php/)) { print "Not match\n";next; }<br />
   open(FILE,"&lt; $filename") || die("Unable to open $filename");<br />
   while (&lt;FILE&gt;) {<br />
    $line=$_;<br />
    # do a few checks to see if we have found coppermine<br />
    if ($line=~/Coppermine version: 1\.([0-9\.][0-9\.][0-9\.])/) { $found+=1;$ver=$1; }<br />
    if ($line=~/Coppermine Photo Gallery 1\./) { $found+=1; }<br />
    if ($line=~/get_meta_album_set_data/) { $found+=1; }<br />
    if ($line=~/Coppermine critical error/) { $found+=1; }<br />
    if ($line=~/obscure, misdocumented/) { $vunerable=0; }<br />
   }<br />
   close(FILE);<br />
   $filename=~s/(\n|\r)//g;<br />
   if ($found&gt;4) {<br />
    if ($vunerable==1) {<br />
	 $scriptpath=$filename;<br />
	 $scriptpath=~s/$path//;<br />
     sendwarning($username,$path,$scriptpath,$ver,$filename,$disableandemail);<br />
    }<br />
   } # close found&gt;4 loop<br />
  } # close va loop<br />
  close(VA);<br />
 }<br />
}</p>
<p>sub sendwarning {<br />
 my ($username,$userpath,$path,$version,$filename,$send)=@_;<br />
 open CONTACTEMAIL , "&lt;".$userpath."/.contactemail";<br />
 chomp(my $user_email = &lt;CONTACTEMAIL&gt;);<br />
 close CONTACTEMAIL;<br />
 if ($send==1) {<br />
  open SENDMAIL, "|/usr/sbin/sendmail -t";<br />
  print SENDMAIL "To: &lt;$user_email&gt;\n";<br />
  print SENDMAIL "From: security\@$hostname\n";<br />
  print SENDMAIL "Subject: Vulnerable Coppermine Gallery Warning!\n\n";<br />
  print SENDMAIL "*** DO NOT REPLY TO THIS EMAIL: YOUR REPLY WILL *NOT* BE READ ***\n\n";<br />
  print SENDMAIL "Hello,\n\n";<br />
  print SENDMAIL "A recent server security scan revealed that your site has a vunerable Coppermine Photo \n";<br />
  print SENDMAIL "Gallery file at $path . According to this automated scan, this file is revision/version $version \n";<br />
  print SENDMAIL "which is known to have security vunerabilities.\n";<br />
  print SENDMAIL "To help ensure the security of the server we are asking you to update your Coppermine insall\n";<br />
  print SENDMAIL "to the latest version.\n";<br />
  print SENDMAIL "To protect against this being abused, the file at $path has been disabled.\n";<br />
  print SENDMAIL "The latest known version of Coppermine is version 1.4.8 . Please upgrade\n";<br />
  print SENDMAIL "*** DO NOT REPLY TO THIS EMAIL: YOUR REPLY WILL *NOT* BE READ ***\n\n";<br />
  close SENDMAIL;<br />
  system("chmod a-rx $filename");<br />
 } else {<br />
  print "Would have sent to $user_email ($username) about version $revision at $path (filename $filename)\n";<br />
 }<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2006/08/10/techy-outdated-coppermine-finder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Techy: cPanel DNS Cleardown script</title>
		<link>http://blog.rac.me.uk/2006/08/10/techy-cpanel-dns-cleardown-script/</link>
		<comments>http://blog.rac.me.uk/2006/08/10/techy-cpanel-dns-cleardown-script/#comments</comments>
		<pubDate>Thu, 10 Aug 2006 21:04:17 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[dns cleardown]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/2006/08/10/techy-cpanel-dns-cleardown-script/</guid>
		<description><![CDATA[Do you have many &#8220;old&#8221; cPanel servers? Perhaps you have the cpanel servers configured in a DNS cluster for redudancy? If so, you may encounter the same problem as I did where you have &#8220;stale&#8221; (or old) DNS zones cluttering up the server. Here&#8217;s a script to get rid of any unused zone files (use [...]]]></description>
			<content:encoded><![CDATA[<p>Do you have many &#8220;old&#8221; cPanel servers? Perhaps you have the cpanel servers configured in a DNS cluster for redudancy? If so, you may encounter the same problem as I did where you have &#8220;stale&#8221; (or old) DNS zones cluttering up the server. Here&#8217;s a script to get rid of any unused zone files (use at your own risk yadda yadda yadda &#8211; you will have to rebuild /etc/named.conf afterwards):<br />
<span id="more-651"></span><br />
It&#8217;ll first take a copy of the DNS zones (into /root/oldzones ), then pull out all the domain names in /etc/localdomains and /etc/remotedomains and /etc/secondarymx and copy those zone files to the temporary /root/newzones folder.</p>
<p>It&#8217;ll then clear down the /var/named/ folder totally (the multiple rm commands are there because you could have several thousand files there: yes, I know this could be cleared up by using <code>find . -type f -name...</code> style syntax: but it was a &#8220;quickly hacked together&#8221; script). It then copies all the files from /root/newzones to /var/named ready for you to rebuild /etc/named.conf !</p>
<p><code><br />
#!/usr/bin/perl<br />
system("rm -rf /root/newzones");<br />
system("rm -rf /root/oldzones");<br />
system("mkdir /root/oldzones");<br />
system("rsync -ar /var/named/ /root/oldzones/");<br />
system("mkdir /root/newzones");<br />
open(VA,"&lt; /etc/localdomains") || die("Unable to open /etc/localdomains");<br />
$zonecount=0;<br />
while (&lt;VA&gt;) {<br />
 $filename=$_;<br />
 $filename=~s/\n//g;<br />
 $filename=$filename.'.db';<br />
 $source='/var/named/'.$filename;<br />
 $dest='/root/newzones/'.$filename;<br />
 $command="cp $source $dest";<br />
 system($command);<br />
 $zonecount++;<br />
}<br />
close (VA);<br />
open(VA,"&lt; /etc/remotedomains") || die("Unable to open /etc/remoteldomains");<br />
$zonecount=0;<br />
while (&lt;VA&gt;) {<br />
 $filename=$_;<br />
 $filename=~s/\n//g;<br />
 $filename=$filename.'.db';<br />
 $source='/var/named/'.$filename;<br />
 $dest='/root/newzones/'.$filename;<br />
 $command="cp $source $dest";<br />
 system($command);<br />
 $zonecount++;<br />
}<br />
close (VA);<br />
open(VA,"&lt; /etc/secondarymx") || die("Unable to open /etc/secondarymx");<br />
$zonecount=0;<br />
while (&lt;VA&gt;) {<br />
 $filename=$_;<br />
 $filename=~s/\n//g;<br />
 $filename=$filename.'.db';<br />
 $source='/var/named/'.$filename;<br />
 $dest='/root/newzones/'.$filename;<br />
 $command="cp $source $dest";<br />
 system($command);<br />
 $zonecount++;<br />
}<br />
close (VA);<br />
print "Zones:$zonecount\n";<br />
system("rm -rf /var/named/a*.db");<br />
system("rm -rf /var/named/b*.db");<br />
system("rm -rf /var/named/c*.db");<br />
system("rm -rf /var/named/d*.db");<br />
system("rm -rf /var/named/e*.db");<br />
system("rm -rf /var/named/f*.db");<br />
system("rm -rf /var/named/g*.db");<br />
system("rm -rf /var/named/h*.db");<br />
system("rm -rf /var/named/i*.db");<br />
system("rm -rf /var/named/j*.db");<br />
system("rm -rf /var/named/k*.db");<br />
system("rm -rf /var/named/l*.db");<br />
system("rm -rf /var/named/m*.db");<br />
system("rm -rf /var/named/n*.db");<br />
system("rm -rf /var/named/o*.db");<br />
system("rm -rf /var/named/p*.db");<br />
system("rm -rf /var/named/q*.db");<br />
system("rm -rf /var/named/r*.db");<br />
system("rm -rf /var/named/s*.db");<br />
system("rm -rf /var/named/t*.db");<br />
system("rm -rf /var/named/u*.db");<br />
system("rm -rf /var/named/v*.db");<br />
system("rm -rf /var/named/w*.db");<br />
system("rm -rf /var/named/x*.db");<br />
system("rm -rf /var/named/y*.db");<br />
system("rm -rf /var/named/z*.db");<br />
system("rm -rf /var/named/0*.db");<br />
system("rm -rf /var/named/1*.db");<br />
system("rm -rf /var/named/2*.db");<br />
system("rm -rf /var/named/3*.db");<br />
system("rm -rf /var/named/4*.db");<br />
system("rm -rf /var/named/5*.db");<br />
system("rm -rf /var/named/6*.db");<br />
system("rm -rf /var/named/7*.db");<br />
system("rm -rf /var/named/8*.db");<br />
system("rm -rf /var/named/9*.db");<br />
system("rm -rf /var/named/a*.bak");<br />
system("rm -rf /var/named/b*.bak");<br />
system("rm -rf /var/named/c*.bak");<br />
system("rm -rf /var/named/d*.bak");<br />
system("rm -rf /var/named/e*.bak");<br />
system("rm -rf /var/named/f*.bak");<br />
system("rm -rf /var/named/g*.bak");<br />
system("rm -rf /var/named/h*.bak");<br />
system("rm -rf /var/named/i*.bak");<br />
system("rm -rf /var/named/j*.bak");<br />
system("rm -rf /var/named/k*.bak");<br />
system("rm -rf /var/named/l*.bak");<br />
system("rm -rf /var/named/m*.bak");<br />
system("rm -rf /var/named/n*.bak");<br />
system("rm -rf /var/named/o*.bak");<br />
system("rm -rf /var/named/p*.bak");<br />
system("rm -rf /var/named/q*.bak");<br />
system("rm -rf /var/named/r*.bak");<br />
system("rm -rf /var/named/s*.bak");<br />
system("rm -rf /var/named/t*.bak");<br />
system("rm -rf /var/named/u*.bak");<br />
system("rm -rf /var/named/v*.bak");<br />
system("rm -rf /var/named/w*.bak");<br />
system("rm -rf /var/named/x*.bak");<br />
system("rm -rf /var/named/y*.bak");<br />
system("rm -rf /var/named/z*.bak");<br />
system("rm -rf /var/named/0*.bak");<br />
system("rm -rf /var/named/1*.bak");<br />
system("rm -rf /var/named/2*.bak");<br />
system("rm -rf /var/named/3*.bak");<br />
system("rm -rf /var/named/4*.bak");<br />
system("rm -rf /var/named/5*.bak");<br />
system("rm -rf /var/named/6*.bak");<br />
system("rm -rf /var/named/7*.bak");<br />
system("rm -rf /var/named/8*.bak");<br />
system("rm -rf /var/named/9*.bak");<br />
system("rm -rf /var/named/*.bak");<br />
system("rm -rf /var/named/*.db");<br />
system("rsync -arv /root/newzones/ /var/named/");<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2006/08/10/techy-cpanel-dns-cleardown-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Techy: Handy Security Tips</title>
		<link>http://blog.rac.me.uk/2003/08/09/techy-handy-security-tips/</link>
		<comments>http://blog.rac.me.uk/2003/08/09/techy-handy-security-tips/#comments</comments>
		<pubDate>Sat, 09 Aug 2003 03:47:39 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server security]]></category>
		<category><![CDATA[whm]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/?p=513</guid>
		<description><![CDATA[If you have a new box you want to use for web hosting etc, then here are just a few of the things you can do to help make the box secure. This list is not comprehensive, nor do I take any responsibility for any harm that may come to your server if you use [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a new box you want to use for web hosting etc, then here are just a few of the things you can do to help make the box secure. This list is not comprehensive, nor do I take any responsibility for any harm that may come to your server if you use any of these commands. These are mainly &#8220;quick reference&#8221; commands in case I need them in a rush (for example: we&#8217;ve put a box online and need it at least &#8220;semi-secured&#8221; &#8211; we&#8217;ll spend a bit more time securing a box then just these commands, but they&#8217;re a good starting point)</p>
<p>Run commands as root/su:</p>
<p><b>Disable telnet</b><br />
Modify <code>/etc/xinetd.d/telnet</code> (could also be <code>/etc/xinetd.d/telnet</code> and change <code>disable=no</code> to <code>disable=yes</code></p>
<p><b>Disable code compilation</b><br />
Add compiler group: <code>/usr/sbin/groupadd compiler</code><br />
Move to correct directory: <code>cd /usr/bin</code><br />
Make most common compilers part of the compiler group <code>chgrp compiler *cc*<br />
chgrp compiler *++*<br />
chgrp compiler ld<br />
chgrp compiler as<br />
</code><br />
Set access on mysqlaccess <code>chgrp root mysqlaccess</code><br />
Set permissions <code>chmod 750 *cc*<br />
chmod 750 *++*<br />
chmod 750 ld<br />
chmod 750 as<br />
chmod 755 mysqlaccess</code><br />
To add users to the group, modify <code>/etc/group</code> and change <code>compiler:x:123:</code> to <code>compiler:x:123:username1,username2</code> (&#8217;123&#8242; will be different on your installation)<br />
<span id="more-513"></span><br />
<b>Disable direct root login: SSH</b><br />
Modify <code>/etc/ssh/sshd_config</code>.<br />
Ensure the Protocol line is not commented out and reads <code>Protocol 2</code> (increases the encryption level)<br />
Modify <code>PermitRootLogin yes</code> to <code>PermitRootLogin no</code><br />
Restart SSHD <code>/etc/rc.d/init.d/sshd restart</code></p>
<p><b>Disable direct root login: ProFTP</b><br />
Modify <code>/etc/proftpd.conf</code><br />
Add <code>RootLogin off</code><br />
Restart ProFTP <code>/sbin/service proftpd stop<br />
/sbin/service proftpd start</code></p>
<p><b>Restrict access to Inet services</b><br />
Modify <code>/etc/hosts.allow</code><br />
Suggested format:<br />
<code># Approved IP addresses<br />
ALL: 192.168.0.1<br />
ALL: 192.168.5.2<br />
# CSV uploader machine<br />
proftpd: 10.0.0.5<br />
# pop3 from anywhere<br />
ipop3: ALL</code><br />
Modify <code>/etc/hosts.deny</code><br />
<code>ALL:ALL EXCEPT localhost:DENY</code></p>
<p><b>Mount /tmp as being not executable</b><br />
(not recommended for Cpanel servers)<br />
<code>cd /dev</code><br />
Create 100Mb (the &#8220;count&#8221;) storage file: <code>dd if=/dev/zero of=tmpMnt bs=1024 count=100000</code><br />
Make an extended filesytem <code>/sbin/mke2fs /dev/tmpMnt</code> (answer yes to &#8220;&#8230;is not a block special device. continue?&#8221;)<br />
Backup existing temp files <code>cp -R /tmp/ /tmp_backup</code><br />
Mount new file system with noexec <code>mount -o loop,rw,nosuid,noexec /dev/tmpMnt /tmp<br />
chmod 0777 /tmp</code><br />
Copy the backup files back: <code>cp -R /tmp_backup/* /tmp/</code><br />
Remove backups <code>rm -rf /tmp_backup</code><br />
Modify <code>/etc/fstab</code> to add the following to ensure the mount point is recreated on boot up<code>/dev/tmpMnt             /tmp                    ext2    loop,rw,nosuid,noexec  0 0</code> (spaces are tabs)</p>
<p><b>Remove unused RPMs</b><br />
Create a file called &#8220;cleardown&#8221; with the following contents:<br />
<code>#!/bin/bash<br />
# Remove unneeded RPMs<br />
# by jd_waverly<br />
# Please read this script completely before executing to verify that you are<br />
# not using any of these rpms</p>
<p># Remove # from following line to display every command as it executes<br />
#set -x<br />
# Add # in front of any you don't want removed<br />
# Several removals are commented out by default including:<br />
#<br />
# ipchains<br />
# squid<br />
# grub<br />
# mutt<br />
# mouseconfig<br />
# rdate<br />
# kernel source code<br />
# ash shell</p>
<p>echo Rebuilding rpm database<br />
echo Please wait<br />
# Make sure rpm database is clean before beginning<br />
rpm --rebuilddb</p>
<p>echo Removing Ghostscript and Japanese vector fonts</p>
<p># Description of these modules<br />
# VFlib2 Japanese vectorfont library<br />
# VFlib2-devel Japanese vectorfont development support<br />
# ghostscript Postscript interpreter and renderer<br />
# ghostscript-fonts Ghostscript postscript fonts<br />
rpm -e VFlib2 VFlib2-devel ghostscript ghostscript-fonts</p>
<p>echo Removing unused Print Utilities</p>
<p>rpm -e LPRng printconf #print spooler<br />
rpm -e pnm2ppa #HP printer drivers<br />
rpm -e mpage #Page print utility<br />
rpm -e Omni Omni-foomatic #Omni print driver management<br />
rpm -e foomatic #Printer driver database</p>
<p>echo Removing typically unused network services<br />
# Descriptions of modules see below for the rest<br />
# portmap manage RPC connections<br />
# ypbind NIS client binding<br />
# rusers-server rusers command server<br />
# rwall-server rwall message server<br />
# nfs-utils NFS server<br />
# ypserv NIS server<br />
# yp-tools NIS client programs</p>
<p>rpm -e portmap ypbind rusers-server rwall-server nfs-utils ypserv yp-tools</p>
<p>rpm -e dhcpcd #DHCP support<br />
rpm -e finger #finger client<br />
rpm -e finger-server #finger server<br />
#rpm -e ipchains lokkit #ipchains not needed if using iptables</p>
<p>#SNMP support is a security risk<br />
# rpm -e php-snmp-4.2.2-2ensim5 #php snmp support under ensim<br />
rpm -e ucd-snmp ucd-snmp-utils ucd-snmp-devel </p>
<p>#rpm -e squid #squid proxy server<br />
rpm -e talk #Talk client program<br />
rpm -e talk-server #Talk server<br />
rpm -e radvd #IPV6 router advertisement<br />
rpm -e inews #For posting usenet articles<br />
rpm -e inn #News server</p>
<p>echo Removing rsh, rlogin, rcp, rwho, rusers, rdate support<br />
rpm -e rsh #rsh, rlogin, rcp command<br />
#rpm -e rdate #rdate program<br />
rpm -e rsh-server #rsh server<br />
rpm -e rwho #rwho command</p>
<p>echo Removing utilities<br />
rpm -e a2ps #postscript converter<br />
rpm -e aspell #spell checker<br />
#rpm -e ash #alternative to bourne shell</p>
<p>echo Removing various font support<br />
#Description of modules see below for the rest<br />
# chkfontpath Font path for X server<br />
# urw-fonts Postscript fonts<br />
# ttfonts-ja Japanese TrueType fonts<br />
rpm -e chkfontpath urw-fonts ttfonts-ja<br />
rpm -e nkf #Kanji code converter<br />
rpm -e watanabe-vf #Watanabe font</p>
<p>echo Removing mouse support utilities and links browser<br />
#rpm -e mouseconfig #mouse setup<br />
#rpm -e mc #midnight commander<br />
rpm -e gpm gpm-devel links #console mouse support and links www browser</p>
<p>echo Removing Docbook support<br />
rpm -e docbook-utils docbook-utils-pdf<br />
rpm -e docbook-style-dsssl #docbook style sheets<br />
rpm -e docbook-dtd30-sgml docbook-dtd31-sgml #docbook style sheets<br />
rpm -e docbook-dtd40-sgml docbook-dtd41-sgml #docbook style sheets</p>
<p>echo Removing useless hardware support<br />
rpm -e bcm5820 #broadcomm comm processor support<br />
rpm -e efax #fax program<br />
rpm -e hotplug #hotplug USB support<br />
rpm -e eject #software media eject support<br />
rpm -e apmd #laptop power management is dangerous on a server<br />
rpm -e hwcrypto #hardware crypto support<br />
rpm -e pciutils #tweak tool for pci hardware<br />
rpm -e kudzu-devel pciutils-devel #hardware development tools</p>
<p>echo Removing file management tools<br />
rpm -e CVS #CVS software development management<br />
rpm -e rcs #file management tool</p>
<p>echo Removing Tex text formatting<br />
rpm -e tetex tetex-dvilj tetex-latex tetex-afm tetex-dvips tetex-fonts jadetex</p>
<p>echo Removing various mail utilities<br />
#rpm -e mutt #text mode mail agent<br />
rpm -e fetchmail #PPP mail client</p>
<p>echo Removing various development packages<br />
#Carnegie Mellon Cyrus mail system development package<br />
rpm -e cyrus-sasl-devel </p>
<p>echo Removing SGML utilities<br />
rpm -e psgml #Emacs SGML support<br />
rpm -e sgml-tools #text formatting suite</p>
<p>echo Removing grub<br />
#rpm -e grub #grub not used by RS</p>
<p>echo Removing DOS utilities<br />
rpm -e mkbootdisk dosfstools #Make dos boot disk and FAT filesystem support</p>
<p>echo Removing Redhat logos<br />
rpm -e redhat-logos</p>
<p>echo Removing kernel development tools and source<br />
rpm -e ksymoops #kernel error message devel tool<br />
#rpm -e kernel-source-2.4.18-18.7.x #kernel source code for devel<br />
#rpm -e kernel-source-2.4.18-17.7.x #kernel source code</p>
<p>echo Removals complete<br />
exit</code><br />
Run using <code>/bin/bash cleardown</code></p>
<p><b>Firewall ports</b><br />
A firewall in necessary and I quite like Cheetaweb&#8217;s &#8220;APF&#8221;/iptables based one.<br />
This can be downloaded from <a href="http://download.cheetaweb.com/apf-0.8.7-1.i386.rpm" class="broken_link">http://download.cheetaweb.com/apf-0.8.7-1.i386.rpm</a> and installed using <code>rpm -Uvh apf-0.8.7-1.i386.rpm</code>.<br />
You&#8217;ll need to modify /etc/apf/conf.apf to use the correct ports for the web server software you are using:<br />
Cpanel servers: TCP_CPORTS=&#8221;21,22,53,80,110,443,2082,2083,2086,2087,2095,2096&#8243;<br />
Ensim/Ensim Pro servers:<br />
TCP_CPORTS=&#8221;21,22,25,53,80,110,143, 443, 19638&#8243;<br />
# Common UDP Ports<br />
UDP_CPORTS=&#8221;53&#8243;<br />
Run on reboot: <code>/sbin/chkconfig --level 2345 apf on</code></p>
<p><b>Hide Apache Information</b><br />
Show only that you are running Apache: no details of any of the modules or version numbers.<br />
Modify <code>/etc/httpd/conf/httpd.conf</code><br />
Change the <code>ServerSignature</code> line to:<br />
<code>ServerSignature Off</code><br />
and add/amend:<br />
<code>ServerTokens ProductOnly</code><br />
Restart Apache: <code>/sbin/service httpd restart</code><br />
Cpanel users: This may break the &#8220;Needs upgrade&#8221; display on WHM.</p>
<p><b>Hide PHP information</b><br />
Modify php.ini (locations vary) from:<br />
<code>expose_php=On</code><br />
to:<br />
<code>expose_php=Off</code><br />
You may need to restart Apache.</p>
<p><b>Install ChkRootKit</b><br />
Download <a href="ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz">ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz</a><br />
Unpack it <code>tar xvzf chkrootkit.tar.gz</code><br />
Compile it: <code>cd chkrootkit*<br />
make sense</code><br />
Remove the install file <code>rm ../chkrootkit.tar.gz</code><br />
Find out &#8220;full path&#8221; <code>pwd</code><br />
Add cronjob to run daily by adding a file called &#8220;chkrootkit&#8221; to <code>/etc/cron.daily</code> with: <code>#!/bin/bash<br />
/"full path"/./chkrootkit -q | mail -s "[servername] chkrootkit Output" youremailaddress@example.com</code><br />
Chmod it <code>chmod 755 /etc/cron.daily/chkrootkit</code></p>
<p><b>Installed System Integrity Monitor</b><br />
See <a href="http://www.r-fx.net/sim.php" class="broken_link">http://www.r-fx.net/sim.php</a> for full information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2003/08/09/techy-handy-security-tips/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Techy: New Cpanel Server</title>
		<link>http://blog.rac.me.uk/2003/07/24/techy-new-cpanel-server/</link>
		<comments>http://blog.rac.me.uk/2003/07/24/techy-new-cpanel-server/#comments</comments>
		<pubDate>Thu, 24 Jul 2003 20:59:18 +0000</pubDate>
		<dc:creator>Richy C.</dc:creator>
				<category><![CDATA[Net: Techy: cPanel]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[ensim]]></category>

		<guid isPermaLink="false">http://blog.rac.me.uk/?p=496</guid>
		<description><![CDATA[At work, we&#8217;ve got a combination of Cpanel and Ensim Pro control panel based webservers (plus a proprietary system on our very old datacentre). My &#8220;personal&#8221; dedicated server just has plain Linux (Debian) on it and hosts around a dozen sites &#8211; but I&#8217;ve decided to go for a more easy to manage solution and [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="Cpanel Screenshot" src="http://blog.rac.me.uk/photos/2003/07/cpanelserver.jpg" width="110" height="110" border="0" align="left" />At work, we&#8217;ve got a combination of Cpanel and Ensim Pro control panel based webservers (plus a proprietary system on our very old datacentre). My &#8220;personal&#8221; dedicated server just has plain Linux (Debian) on it and hosts around a dozen sites &#8211; but I&#8217;ve decided to go for a more easy to manage solution and I&#8217;ve chosen to purchase a brand new Red Hat Linux (I actually would have preferred Debian) server &#8211; complete with a whopping 700Gb bandwidth per month (I&#8217;m currently on just 40Gb) with Cpanel.</p>
<p>Why Cpanel? Well, Ensim tries to &#8220;control&#8221; your server a bit too much for my liking: you&#8217;ve got to be especially careful what you upgrade/install and if you make any changes to the Apache configuration by hand &#8211; then it can really screw things up (and the next restart of Ensim will mean it&#8217;ll try and &#8220;correct&#8221; your amendments). Cpanel, on the other hand, seems to act as a control panel should &#8211; it&#8217;ll allow me to go right in and forcible change settings without having to worry too much about it overriding my settings.</p>
<p>Plus, the whole system seems lot more &#8220;open&#8221; then Ensim&#8217;s compiled Python mess: which means if I feel like writing an extension to Cpanel, then I&#8217;m free to do so. And, it comes with some nifty &#8220;one click install&#8221; style items &#8211; I&#8217;ve disabled most of them, but at least if I ever want to have a quick play with &#8211; say OsCommerce &#8211; I won&#8217;t even have to bother loading an FTP client to upload the files! Oh &#8211; and it&#8217;s support of anti-spam systems looks perfect (my current real email/spam ratio is around 1:500 &#8211; yes, I get around 500 spams for every proper email! I deleted 3,500 of them so far today)</p>
<p>On the slightly negative side: I&#8217;m having real difficulties disabling FrontPage on the server. I absolutely detest that b&#8211;ardised system: it&#8217;s a little bit of a web design package, a little bit of &#8220;PHP/Perl scripting&#8221; and a strange FTP client all muddled together and pulled out incorrectly. FrontPage would have been so much better if it used standard FTP uploads and server admins didn&#8217;t have to worry about getting the darn FrontPage extensions to work correctly. 75%+ of our technical support calls are about FrontPage (but, to be fair, some of our customers are such numbskulls that I have to talk them through how to start FrontPage&#8217;s inbuilt help system: I wish I was joking <img src='http://blog.rac.me.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ).</p>
<p>Anyway, once I&#8217;ve got the new server stabilised and ready, I&#8217;m going to be moving everything to it &#8211; it&#8217;ll take me a while though as my current server has a few &#8220;exotic&#8221; settings made to it which I&#8217;ll need to take into account.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rac.me.uk/2003/07/24/techy-new-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

