<?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>ServerAdmins.NET &#187; chrism</title>
	<atom:link href="http://serveradmins.net/author/chrism/feed/" rel="self" type="application/rss+xml" />
	<link>http://serveradmins.net</link>
	<description>Stuff for Server Admins...</description>
	<lastBuildDate>Wed, 22 Feb 2012 02:04:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>SSH timeouts suck.</title>
		<link>http://serveradmins.net/ssh-timeouts-suck/</link>
		<comments>http://serveradmins.net/ssh-timeouts-suck/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 02:03:39 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Daemons]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[keepalive]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh timeout]]></category>
		<category><![CDATA[ssh_config]]></category>
		<category><![CDATA[timeout]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=101</guid>
		<description><![CDATA[SSH Keepalive timeouts are fixed in this post.]]></description>
			<content:encoded><![CDATA[<p>So if you&#8217;re ever connected to a remote machine (or several), and you frequently see this message after you walk away from your term for a bit&#8230;</p>
<p><code><br />
Write failed: Broken pipe<br />
</code></p>
<p>Do this from the machine you&#8217;re connecting from.  SSHD for Macs/Linux boxes should all have this file.  Windows, I&#8217;m not so much sure on.</p>
<p>(if not root already)<br />
<code><br />
sudo echo "ServerAliveInterval 5" >> /etc/ssh_config<br />
</code></p>
<p>Or just open it up in your favorite text editor, save and call it good.</p>
<p>What&#8217;s happening here is that somewhere between you and your destination, there&#8217;s a long enough of a timeout happening that you hit SSHs internal timeout.   This line just forces your SSH client to send a keepalive pulse fairly regularly to the endpoint.</p>
<p>Anyway, dumb quick fix to what ails so many of is.  </p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/ssh-timeouts-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding custom nameservers and a custom gateway to your openstack virtual machines</title>
		<link>http://serveradmins.net/adding-custom-nameservers-and-a-custom-gateway-to-your-openstack-virtual-machines/</link>
		<comments>http://serveradmins.net/adding-custom-nameservers-and-a-custom-gateway-to-your-openstack-virtual-machines/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 23:39:36 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Daemons]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[dnsmasq]]></category>
		<category><![CDATA[nova-network]]></category>
		<category><![CDATA[nova.conf]]></category>
		<category><![CDATA[openstack]]></category>
		<category><![CDATA[resolv.conf]]></category>
		<category><![CDATA[resolvers]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=97</guid>
		<description><![CDATA[The gist of this is how to configure openstack (dnsmasq) to use a different router than the nova-network service provides in addition to using standard resolvers.]]></description>
			<content:encoded><![CDATA[<p>This took me awhile to figure out today, so I figure it&#8217;s worth a post (and we all know I&#8217;m WAAAY behind on those!).</p>
<p>The problem I ran into was with an OpenStack (diablo build) instance that we use internally at my work.   To make a long story short, I chose to go around the nova-network method of routing and use my own hardware gateway as opposed to using the software appliance provided by the OpenStack setup.   </p>
<p>Now, a brief bit of Background here.   </p>
<p>1.  Openstack is a &#8220;Virtualization Fabric&#8221;, i.e., a piece of software that ties together hypervisors with a nice API.  It handles the networking, connection to the hypervisors, sercurity and let&#8217;s you access everything with an API.  This is the same software that the Rackspace Cloud is setup and comparable to what VPS.Net uses (onapp.com).</p>
<p>2.  Openstack is comprised of components, nova-network handles the networking, routing and firewalling.  Nova-api handles the API calls.  Nova-scheduler handles all the scheduling.  Nova-compute actually interfaces with the hypervisors and creates/manages the VMs with nova-volume providing an EBS style of volume provisioning. </p>
<p>3.  When you provision a VM, it automatically routes through the machine you&#8217;ve designated to run nova-network, I didn&#8217;t like this.</p>
<p>So, I decided to change how the networking on the VMs routes to the public internet.  There&#8217;s a service called &#8216;dnsmasq&#8217; that runs on the nova-network machine which hands out IP and basic configuration information to your VMs when they come up.  It gives your VMs their IP, Gateway, subnet mask, resolvers and a few other items as well.   So here&#8217;s, where things needed to change.</p>
<p>Step 1.  Know your real network gateway!</p>
<p>Traditionally in an openstack setup, your VMs will route like this&#8230;</p>
<p>VM->Nova-network appliance->network gateway->Internet.</p>
<p>I was modifying it to route as follows&#8230;</p>
<p>VM->Network Gateway->Internet.</p>
<p>This is handled by adding one line to your nova.conf file, and creating a super basic configuation file to go along with it.  By adding &#8216;&#8211;dnsmasq_config_file=/etc/nova/dnsmasq.conf&#8217; to your nova.conf file, and ensuring that /etc/nova/dnsmasq.conf looks like the following snippet, you&#8217;ll 1. route through your own gateway, and 2.  use your own resolvers.</p>
<p>&#8212;-<br />
dhcp-option=6,10.1.100.254<br />
dhcp-option=3,10.1.100.254<br />
&#8212;-</p>
<p>dhcp-option 6 should be set to the resolver you want to use, and dhcp-option 3 should be set to the gateway you want to use.</p>
<p>After that, do a &#8216;killall dnsmasq; /etc/init.d/nova-network restart&#8217;, and then restart your instances and you should be good to go!</p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/adding-custom-nameservers-and-a-custom-gateway-to-your-openstack-virtual-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something old, something new, something borrowed, something&#8230; Orange?</title>
		<link>http://serveradmins.net/something-old-something-new-something-borrowed-something-orange/</link>
		<comments>http://serveradmins.net/something-old-something-new-something-borrowed-something-orange/#comments</comments>
		<pubDate>Wed, 18 May 2011 17:03:44 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[blacklist]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[mxreport]]></category>
		<category><![CDATA[mxreport.com]]></category>
		<category><![CDATA[rbl check]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=92</guid>
		<description><![CDATA[Guys and Gals, Awhile back, I had a list of URLs that were handy to me, as an admin. Mailchecker sites that&#8217;d hit up SPF/MX/RBL/header checks, DNS verification sites and gimmicky little things like &#8220;what is my ip&#8221; that&#8217;d get used fairly frequently. The sad thing is that the vast majority of my old go-to [...]]]></description>
			<content:encoded><![CDATA[<p>Guys and Gals, </p>
<p>Awhile back, I had a list of URLs that were handy to me, as an admin.  Mailchecker sites that&#8217;d hit up SPF/MX/RBL/header checks, DNS verification sites and gimmicky little things like &#8220;what is my ip&#8221; that&#8217;d get used fairly frequently.   The sad thing is that the vast majority of my old go-to sites are now gimped in favor of &#8220;please pay us&#8221;, inundated with ads, or simply gone to hell in a handbasket.    What&#8217;s an admin to do?</p>
<p>Code.  That&#8217;s what an admin is to do. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />     So I present to you, the very first alpha release of MXReport.com, my site that&#8217;ll hopefully contain all of those gimpy little scripts that have been so handy in the past.   </p>
<p>The goal of MXReport.com are as follows.</p>
<ul>
Fast.  It has to be fast.<br />
Curl/wget/LWPable (or your web autobot dejour).<br />
Efficient.  No bumbling through 234234 menus to find the one little script you want.<br />
Fast.<br />
Free (no ads either).<br />
Open.  (github links will be dropped once I get things a bit more under control)<br />
oh yeah and did I mention, Fast?
</ul>
<p>With that in mind, please feel free to kick around http://mxreport.com.   Is it proper and fully ready? Nah.   Does it do all the fancy stuff?  Nope.  Does it do RBL Checks quickly?  Yep!    Sure, there&#8217;s bugs, which are fairly easy to trip over once you start playing with input, but those should be resolved fairly soon.  In the meantime, kick it around and let me know what you think.   If you&#8217;ve got ideas, please feel free to send them on over.</p>
<p>This isn&#8217;t something for me.  This is something for Us.</p>
<p><a href="http://mxreport.com/"></p>
<p></a></p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/something-old-something-new-something-borrowed-something-orange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Woops.</title>
		<link>http://serveradmins.net/woops/</link>
		<comments>http://serveradmins.net/woops/#comments</comments>
		<pubDate>Tue, 17 May 2011 14:49:28 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=88</guid>
		<description><![CDATA[Hey guys, just so you know, I&#8217;m in the process of rebuilding and restoring serveradmins.NET. I hit an odd bug on the FreeBSD 7.4->8.2 upgrade which resulted in the default FreeBSD kernel simply not booting due to ACPI issues on this hardware. As this machine is colo&#8217;d far away, and important to have live, I [...]]]></description>
			<content:encoded><![CDATA[<p>Hey guys, just so you know, I&#8217;m in the process of rebuilding and restoring serveradmins.NET.   I hit an odd bug on the FreeBSD 7.4->8.2 upgrade which resulted in the default FreeBSD kernel simply not booting due to ACPI issues on this hardware.</p>
<p>As this machine is colo&#8217;d far away, and important to have live, I opted for the reinstall and rebuild quickly rather than running down the bug. </p>
<p>Please tolerate the breakage for a little bit, I&#8217;ll get you all sorted out quickly. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Edit:  Done.  Things should be good again now, sorry for the url breakage.</p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/woops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XCache 1.3.0 install &#8211; with cPanel and CentOS</title>
		<link>http://serveradmins.net/xcache-1-3-0-install-with-cpanel-and-centos/</link>
		<comments>http://serveradmins.net/xcache-1-3-0-install-with-cpanel-and-centos/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 04:57:58 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Daemons]]></category>
		<category><![CDATA[Utility]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[opcode]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[xcache]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=79</guid>
		<description><![CDATA[XCache PHP Opcode Cacher installation on CentOS and cPanel]]></description>
			<content:encoded><![CDATA[<p>Hey there!</p>
<p>I figure it&#8217;s been a little bit, so I&#8217;ve gone ahead and decided to update the XCache installer for version 1.3.0, and my favorite control panel, cPanel. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This is incredibly easy to do and should get a basic/barebones XCache installation up and going fairly quickly on your CentOS  + cPanel machine.</p>
<p>First, let&#8217;s grab our XCache sources&#8230;<br />
<code><br />
cd /usr/src/<br />
wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz<br />
</code></p>
<p>Now, go ahead and unarchive the source, and change into the XCache build dir&#8230;<br />
<code>tar -xzvf xcache-1.3.0.tar.gz<br />
cd xcache-1.3.0<br />
</code></p>
<p>Let&#8217;s prep our sources for the current PHP ecosystem&#8230;<br />
<code><br />
root@SERVER [/usr/src/xcache-1.3.0]# phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
</code></p>
<p>Now that should have gotten everything sorted with our sources so the XCache install is ready for our PHP version and environment, Let&#8217;s go ahead and kick off the build!  Keep in mind, this build should be fairly fast and lightweight.</p>
<p><code><br />
./configure &#038;&#038; make &#038;&#038; make install<br />
</code><br />
The above line basically says &#8220;Run configure, if that is successful w/o errors, run a make, and if that finishes w/o error, run the install&#8221;.  Once this is complete, you should see a line that says something like the following&#8230;<br />
<code><br />
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20060613/<br />
</code><br />
This is going to be where our xcache.so file is located, however when cPanel builds your php.ini file, it&#8217;s going to have that set already.  So getting the base module loaded is as simple as running the following command.<br />
<code><br />
echo "extension=xcache.so" >> /usr/local/lib/php.ini<br />
</code><br />
After that, you should be able to do a quick check of the PHP CLI and verify that it loaded properly with the &#8216;php -v&#8217; command&#8230;<br />
<code><br />
root@SERVER [/usr/src/xcache-1.3.0]# php -v<br />
PHP 5.2.13 (cli) (built: Jun 16 2010 09:27:33)<br />
Copyright (c) 1997-2010 The PHP Group<br />
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies<br />
    with XCache v1.3.0, Copyright (c) 2005-2009, by mOo<br />
</code></p>
<p>And there you go, you can safely restart Apache now and you should be serving cached content.  Please keep in mind, you&#8217;ll need to configure your XCache setup to ensure everything is working properly, all we&#8217;ve done here is install the base module.</p>
<p>I&#8217;d suggest taking a look at our other article regarding the tuning of XCache for a bit more information on this. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a href="http://serveradmins.net/tuning-xcache-for-fun-and-profit/"></p>
<p>That does it for now!</p>
<p></a></p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/xcache-1-3-0-install-with-cpanel-and-centos/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Howto show the current runlevel in linux&#8230;</title>
		<link>http://serveradmins.net/howto-show-the-current-runlevel-in-linux/</link>
		<comments>http://serveradmins.net/howto-show-the-current-runlevel-in-linux/#comments</comments>
		<pubDate>Fri, 28 May 2010 12:51:17 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rc3.d]]></category>
		<category><![CDATA[runlevel]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=76</guid>
		<description><![CDATA[How to detect and change the current runlevel in Linux]]></description>
			<content:encoded><![CDATA[<p>Quick one here, mostly for my own notes than anything else. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>An easy way to see the existing runlevel is with the &#8216;who -r&#8217; command.</p>
<p><code><br />
root@server:~ # who -r<br />
         run-level 3  May 22 03:54                   last=S<br />
</code></p>
<p>Here we show the last boot and current runlevel (3).   In order to modify this, you can open up /etc/inittab and look for the following line.</p>
<p><code><br />
id:3:initdefault:<br />
</code></p>
<p>This shows that runlevel 3 is the default one kicked off by init on a bootup.</p>
<p>For what it&#8217;s worth, this refers to the directories in /etc/rc.d/rcX.d/, where X is  #.  The number correlates to the runlevel of your machine, and all of the scripts stored in that directory are executed when that runlevel is enabled.</p>
<p>TMYK!</p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/howto-show-the-current-runlevel-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto enable CGI in the builtin OSX webserver</title>
		<link>http://serveradmins.net/howto-enable-cgi-in-the-builtin-osx-webserver/</link>
		<comments>http://serveradmins.net/howto-enable-cgi-in-the-builtin-osx-webserver/#comments</comments>
		<pubDate>Sat, 15 May 2010 00:24:13 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Daemons]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[enable]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=74</guid>
		<description><![CDATA[How to setup and enable the builtin Apache webserver in OSX to handle CGI and Perl Applications]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve caught myself writing more code on my Macbook and for the first time in&#8230; YEARS, not needing an internet connection to actually be productive.  To be quite honest, it&#8217;s a bit weird. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, the first thing I wanted was the ability to run/exec CGI via a webserver.   At first, I was thinking I&#8217;d go about a source build of Apache, and then I remembered OSX comes with one built in.    Huzzah!</p>
<p>So, first let&#8217;s enable the builtin webserver.</p>
<p>System Preferences -> Sharing, and then click on &#8220;Web Sharing&#8221;.   Go ahead and close out the window now, you&#8217;ve just fired off Apache.  (hooray!).  You should now be able to open your browser of choice and go to http://127.0.0.1/~<username /.   Since I login as 'chrismm', I go to http://127.0.0.1/~chrismm/ .   Here you should see the nifty default page.</p>
<p>Now, the document root is going to be off of your user account in /sites/.   My user is chrismm on my machine, so /Users/chrismm/Sites/ is my public HTML.   Any web content you want to view with the above URL needs to go off of this directory.  Go ahead and add the obligatory "Helloworld.html", I'll wait. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now that that's done and functioning, I needed to get some hawt hawt Perl/CGI action going on.   This, was incredibly easy.</p>
<p>OSX's main httpd.conf does a per-user http include in /private/etc/apache2/users/<username>.conf, so once again for me, it was /private/etc/apache2/users/chrismm.conf.   This file contains just a super basic Directory configuration for apache to parse and we only need to make one quick change here&#8230;</p>
<p>First and foremost, we need to be the root user, so go ahead and open up Terminal (Finder->Applications->Utilities -> Terminal), and type &#8216;sudo su -&#8217; .   Here, you&#8217;ll be prompted to enter your password.</p>
<p>Keep in mind as soon as you do this, you are the root user on your machine, ***BE VERY CAREFUL AS IF YOU ARE NOT YOU CAN END UP WITH A WORTHLESS WORKSTATION ***.</p>
<p>Now, go ahead and open up the include for your user, at /private/etc/apache2/users/</username><username>.conf, and make the following changes.</p>
<p>Original:<br />
<code><br />
maynard:beta root# cat /private/etc/apache2/users/chrismm.conf<br />
<directory "/Users/chrismm/Sites/"><br />
    Options Indexes MultiViews<br />
    AllowOverride None<br />
    Order allow,deny<br />
    Allow from all<br />
</directory><br />
</code><code></p>
<p>Needs to be changed to....</p>
<p></code><code><br />
maynard:beta root# cat /private/etc/apache2/users/chrismm.conf<br />
<directory "/Users/chrismm/Sites/"><br />
    Options Indexes MultiViews ExecCGI<br />
    AllowOverride None<br />
    Order allow,deny<br />
    Allow from all<br />
</directory><br />
</code></p>
<p>See that?  All I added was &#8220;ExecCGI&#8221; at the end of that Options statement.   We&#8217;re halfway done now!  </p>
<p>One more change&#8230;</p>
<p>Go ahead and open up &#8216;/private/etc/apache2/original/httpd.conf&#8217; in your text editor of choice, and search for &#8221;    #AddHandler cgi-script .cgi&#8221;</p>
<p>Go ahead and remove the &#8216;#&#8217; mark, save and exit.</p>
<p>Now, let&#8217;s restart the webserver&#8230; </p>
<p><code><br />
killall -HUP httpd<br />
</code></p>
<p>Done!</p>
<p>And now, you can use your CGI and be happy. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p></username></p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/howto-enable-cgi-in-the-builtin-osx-webserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cPanel TCP and UDP ports&#8230;</title>
		<link>http://serveradmins.net/cpanel-tcp-and-udp-ports/</link>
		<comments>http://serveradmins.net/cpanel-tcp-and-udp-ports/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 03:26:40 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Utility]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[passive]]></category>
		<category><![CDATA[pop3]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[udp]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=69</guid>
		<description><![CDATA[The ports necessary for creating a useful and successful firewall for a cPanel hosting machine.  This includes the UDP, TCP and Passive Port port ranges.]]></description>
			<content:encoded><![CDATA[<p>A little post here, more for reference than anything&#8230;   Here&#8217;s a list of the common ports used by cPanel for your firewall building pleasure&#8230;</p>
<p>TCP<br />
21 FTP<br />
22 SSH<br />
25 SMTP<br />
26 SMTP (Alternative port, configurable via WHM)<br />
80 HTTP<br />
110 POP3<br />
143 IMAP<br />
443 HTTPS<br />
465 SMTPS<br />
993 IMAP4<br />
995 POP3<br />
2082 cPanel (NON Encrypted)<br />
2083 cPanel (HTTPS)<br />
2086 WHM (NON Encrypted)<br />
2087 WHM (Encrypted)<br />
2095 Webmail (NON Encrypted)<br />
2096 Webmail (Encrypted)<br />
3306 MySQL (Only if allowing Remote Connections)</p>
<p>&#8211;UDP<br />
53 DNS </p>
<p>It should be noted that if you&#8217;re firewalling off your server, you should open up a portrange for the FTP PassivePort Rolloff.  Typically these are higher up ports and a wide range, such as 30000-50000.  You&#8217;ll also need to modify your FTPd configuration to use this portrange as well.  If you don&#8217;t, you&#8217;ll see issues with FTP connections dropping, successful logins, but a hang, pause or delay when dong an ls or beginning a transfer that results in a dropped connection.  Typically this will affect ftp clients that are behind a firewall/router doing NAT translations.</p>
<p>Anyway, that&#8217;s it, quick and simple. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />    Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/cpanel-tcp-and-udp-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Basic IPFW firewall HowTo for FreeBSD&#8230;</title>
		<link>http://serveradmins.net/a-basic-ipfw-firewall-howto-for-freebsd/</link>
		<comments>http://serveradmins.net/a-basic-ipfw-firewall-howto-for-freebsd/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 01:42:27 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Utility]]></category>
		<category><![CDATA[allow]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[ipfw]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=65</guid>
		<description><![CDATA[How to setup and configure a basic firewall for FreeBSD using ipfw.]]></description>
			<content:encoded><![CDATA[<p>Of all the different OS&#8217;s and the multitude of firewall implementations for each, my favorite has to be FreeBSD&#8217;s IPFW ruleset.  It&#8217;s powerful, super efficient, and most of all, *EASY* to read! </p>
<p>So I&#8217;m just going to paste a sample firewall below, notate it heavily for you, and show you how to get it enabled.   </p>
<p>For newer FreeBSD builds, it&#8217;s enough to add <code>firewall_enable="YES"</code> to your /etc/rc.conf file and reboot.  This will load all the necessary kernel modules, and get you in shape.   You should know that by default FreeBSD defaults to a &#8216;default deny&#8217; policy.  This is *VERY* important to know.   What it means is that by default, your server isn&#8217;t going to open up any ports. You *WILL* be locked out if you do not have a firewall in place.  Don&#8217;t say I didn&#8217;t warn you!</p>
<p>So, with that being said, let&#8217;s get our firewall in built and in place, and then we&#8217;ll go about adding in the necessary options to ensure it comes up properly on boot.  It should noted here that you can build in a &#8220;Default to accept&#8221; option into the kernel or &#8220;firewall_type=&#8221;open&#8221; to the /etc/rc.conf to start up wide open.  This is the suggested practice as the chances are, you&#8217;re not close enough to your server to console it. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Let&#8217;s get our basic firewall going.   We&#8217;re going to open up 22 for SSH, 80 for web traffic, 25 for SMTP and 110/143 for POP3/IMAP mail.   The syntax is simple enough you should be able to customize it for your own needs, but always make sure your SSH port is accessible.  Also if you run SSH on an alternative port, you should modify that here.  You don&#8217;t want to lock yourself out now, do you?</p>
<p>So go ahead, login as root to your server, open up your text editor of choice.  For the purpose of this post, I&#8217;m going to assume you&#8217;re creating the file /etc/firewall.sh.  If not, modify where appropriate. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   You should also make sure this file is executable by root, otherwise it won&#8217;t fire off properly on reboot.</p>
<p><code><br />
#!/bin/sh</p>
<p>set -e</p>
<p>#First, let's clear out any chance of conflicting with other FreeBSD firewall configurations<br />
# and make sure we're starting from a fresh slate.</p>
<p>/sbin/sysctl net.inet.ip.forwarding=0 >/dev/null<br />
/sbin/ipfw -q list >/dev/null 2>&#038;1 || /sbin/kldload ipfw<br />
(/sbin/ipf -D) >/dev/null 2>&#038;1 || true<br />
(/sbin/kldunload ipl) >/dev/null 2>&#038;1 || true<br />
(/sbin/pfctl -d) >/dev/null 2>&#038;1 || true<br />
(/sbin/kldunload pf) >/dev/null 2>&#038;1 || true<br />
/sbin/ipfw -q /dev/stdin < < EOF<br />
flush<br />
delete set 31</p>
<p>#Open up our Loopback device.  There's almost never any reason to filter this.<br />
add allow ip from any to any via lo0</p>
<p>#Allow checking/maintenance of stateful rulesets<br />
add check-state</p>
<p>#Kill off any active/open sessions, pre-fw init.  We do this<br />
#to ensure that any connection to unauthorized ports is dealt with<br />
#and that all connections adhere to the policy...</p>
<p>add reset tcp from any to any established</p>
<p>    ##########################<br />
## Add Inbound Service Allowances ##<br />
    ##########################<br />
#Port 80: www<br />
add allow tcp from any to me 80 setup in<br />
#Port 22: SSH - Stateful connection (it's going to maintain a connection, not come and go)<br />
add allow tcp from any to me 22 setup in keep-state</p>
<p>#Port 21, and 30000-50000, FTP and Passive port rolloff.<br />
add allow tcp from any to me 21 setup in<br />
add allow tcp from any to me 30000-50000 setup in keep-state</p>
<p>#Port 53: DNS<br />
add allow udp from any to me 53 in </p>
<p>#Port 25, 110, 143.  SMTP, POP3 and IMAP<br />
add allow tcp from any to me 25 in<br />
add allow tcp from any to me 110 in<br />
add allow tcp from any to me 143 in</p>
<p>#ICMP/ping requests should be allowed through, fun stuff happens<br />
#if you don't allow this.  (see ptmu)<br />
add icmp from any to me icmptypes 8 in</p>
<p> #################################<br />
## Lets Deny some Packets. WOOOT ##<br />
 #################################</p>
<p>#These rules denies everything else, not explicitly listed above<br />
add deny tcp from any to me setup in<br />
add deny ip from any to me in</p>
<p> ##################<br />
## Outbound Ahoy! ##<br />
 ##################</p>
<p>#Wide open outbound filtering.  You could modify this section to default to deny<br />
#And then allow specific ports out.  I'm not going to do that here, but you should<br />
#be able to figure it out. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>add allow tcp from me to any setup out keep-state<br />
add allow ip from me to any out keep-state</p>
<p> ###########################<br />
## Last chain to make sure ##<br />
 ###########################</p>
<p>#One more time, just to be positive...<br />
add deny tcp from any to any setup<br />
add deny ip from any to any<br />
enable firewall<br />
EOF</p>
<p>#I set this because the default FreeBSD behavior is to keep a table open<br />
#for a session for 1 hour.  That's a LONG time on a production server.  We<br />
#Go for 10 mins here, but could be lowered drastically.</p>
<p>#Set TTL on Dynamic Rules to 10 Mins.  Formerly 1 hour.<br />
/sbin/sysctl net.inet.ip.fw.dyn_ack_lifetime=600 >/dev/null</p>
<p></code></p>
<p>Done!</p>
<p>Save your /etc/firewall.sh file, then make sure permissions are right on it&#8230;</p>
<p><code><br />
chmod 755 /etc/firewall.sh &#038;&#038; chown root:wheel /etc/firewall.sh<br />
</code></p>
<p>Open up your handy text editor again, and add the following lines to /etc/rc.conf at the bottom.</p>
<p><code><br />
firewall_enable="YES"<br />
firewall_script="/etc/firewall.sh"<br />
</code></p>
<p>Done!   </p>
<p>Please keep in mind that if you set &#8220;firewall_type=open&#8221; above, it may overrule this firewall_script variable, so it should be removed.</p>
<p>Congrats, reboot and enjoy your new firewall. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If this is something you&#8217;re interested in, leave a comment and let me know how and I can write a few more articles on more complex configurations quite easily. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/a-basic-ipfw-firewall-howto-for-freebsd/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>cPanel backup and restore for disaster recovery purposes</title>
		<link>http://serveradmins.net/cpanel-backup-and-restore-for-disaster-recovery-purposes/</link>
		<comments>http://serveradmins.net/cpanel-backup-and-restore-for-disaster-recovery-purposes/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 03:18:22 +0000</pubDate>
		<dc:creator>chrism</dc:creator>
				<category><![CDATA[Utility]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[cpbackup]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[restoration]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://serveradmins.net/?p=57</guid>
		<description><![CDATA[cPanel backups made fast and easy with rsync and NFS, shave hours off your backup and restoration times!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve run my share of Hosting operations as a Sr. Admin before and one thing that always *killed* me&#8230;  Server failures and restorations.</p>
<p>Every shop I&#8217;ve been in has primarily been a cPanel shop.   It&#8217;s what the market demanded, so it&#8217;s what we sold.  Not only was it simply &#8220;what the masses wanted&#8221;, it offered an entire suite of scripts, apps and A+ quality support and upgrades that almost brought a tear to my eye. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>However, the one thing it did not provide, was a quick n&#8217; dirty backup and restore system, let me explain.</p>
<p>cPanels backup system is based around the single user ideology.  When you backup a server, it does this on a per cpuser account basis.   Now this has it&#8217;s pros and it&#8217;s cons.   It&#8217;s nice in the fact that restoring/migrating/tinkering with a single account is easy and *very* fast when you need to do it.  The downfall is that when you have to restore 1500+ accounts all at one shot, it&#8217;s *slow*.   For every single account, it copies over the user data, rebuilds certain configs, clears out the package, brings the domain up and then moves onto the next account.</p>
<p>Now, from an customer support standpoint, this is somewhat nice when restoring a server as you can say &#8220;we&#8217;re restoring accounts that begin with A now, your account will go live as soon as it&#8217;s restored.&#8221;   The bad side of this is that as soon as those domains start to go live, your server starts to go under load.   As you restore more accounts, your configuration files get longer (taking longer to modify/update), Apache starts serving requests, mail is being processed, additional load is placed on the server.    </p>
<p>This, gets very slow, very quickly.</p>
<p>Now back in the day, we had a set of servers that housed upwards of 8000+ accounts per machine.   They were super lighweight, averaging 25-50M of data and *no* webtraffic, however with a standard pkgacct/restorepkg procedure, at 30-45 seconds per account, we were looking at somewhere in the neighborhood of 2-3 days to fully restore a server.    From a customer support standpoint, this *SUCKS*  You&#8217;ve got thousands of users down for multiple days while pkgacct sits there and does it&#8217;s thing&#8230;  Not pretty, in fact, just plain unacceptable.</p>
<p>Necessity being the mother of invention, myself and another admin set out to find the &#8220;better way&#8221; of doing this.   These accounts were only using around 10 or so G of disk space in total on the machine, it was fast hardware, there *HAD* to be a better way to do this and keep everything in cPanel happy.   One highly tuned NFS mount later (jumbo frames on a private network are your friend here, trust me. <img src='http://serveradmins.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ), and we had our methods in place.</p>
<p>If you open up /scripts/cpbackup on any cPanel machine (checked on 11.25 for this instance) and go to line 240, you&#8217;ll see two arrays.  @FILES and @DIRS.   These are the core files that cPanel needs to do it&#8217;s thing.</p>
<p><code><br />
my @FILES = qw(<br />
  /etc/exim.conf<br />
  /etc/exim.conf.local<br />
  /etc/exim.conf.localopts<br />
  /etc/namedb/named.conf<br />
  /etc/rc.conf<br />
  /etc/named.conf<br />
  /etc/proftpd.conf<br />
  /etc/localdomains<br />
  /etc/httpd/conf/httpd.conf<br />
  /usr/local/apache/conf/httpd.conf<br />
  /etc/group<br />
  /etc/shadow<br />
  /etc/master.passwd<br />
  /etc/passwd<br />
  /etc/fstab<br />
  /root/.my.cnf<br />
  /etc/ips<br />
  /etc/ips.remotemail<br />
  /etc/ips.remotedns<br />
  /etc/reservedips<br />
  /etc/reservedipreasons<br />
  /etc/quota.conf<br />
  /etc/wwwacct.conf<br />
  /etc/remotedomains<br />
  /etc/rndc.conf<br />
  /etc/secondarymx<br />
  /etc/my.cnf<br />
  /usr/local/cpanel/3rdparty/interchange/interchange.cfg<br />
);</p>
<p>my @DIRS = qw(<br />
  /etc/namedb<br />
  /var/lib/rpm<br />
  /var/lib/named/chroot/var/named/master<br />
  /etc/valiases<br />
  /etc/proftpd<br />
  /var/named<br />
  /etc/vfilters<br />
  /var/cpanel<br />
  /var/spool/cron<br />
  /var/cron/tabs<br />
  /var/spool/fcron<br />
  /usr/local/frontpage<br />
  /var/log/bandwidth<br />
  /etc/vdomainaliases<br />
  /usr/share/ssl<br />
  /etc/ssl<br />
  /var/ssl<br />
  /usr/local/cpanel/3rdparty/mailman<br />
);<br />
</code></p>
<p>You&#8217;ll also need to get /home/ (or wherever your user accounts are stored) and your MySQL DBs as well.</p>
<p>So, rsync these files and directories to your backup server, do a &#8216;mysqldump -A&#8217; for the global databases (careful with remove mysql servers, this can get ugly) and rsync on over /home/ to your NFS mount and voila!  You&#8217;ve got EVERYTHING necessary to do a super fast backup (line speed and disk speed being your limitations here) of your cPanel server.  Now subsequent backups using rsync will only update files that change, not the entire home directory, so they should be fairly lightweight and fast as well.  You can also get jiggy with &#8211;link-dest options in Rsync to create multiple nightly snapshots in a differential format as well.</p>
<p>Now, if the proverbial poo hits the cooling device, you perform a fresh install of your OS of choice, grab your cPanel installer and run it, and then just reverse rsync from your backup mount (make sure to use &#8211;delete!).  After that, one /scripts/upcp &#8211;force and your server is fully live!</p>
<p>In the case I mentioned above, this cut a server restoration down from days, to about an hour.  It allowed us to make 150+ cPanel servers perform nightly backups (a huge selling point to this day) and all with the tools built into a standard CentOS + cPanel setup.</p>
<p>If there&#8217;s any desire for a script to handle this, just go ahead and post in the comments below and I&#8217;ll whip something up nice and fast for you.  It&#8217;s fairly trivial and you can have this rolling in your operation in no time at all.</p>
<p>One item of note, you lose the ability to do single account restores from backup with this method.  It *is* an all or nothing, disaster recovery shot.  You can always copy over individual files and directories, but you lose the elegance of the cPanel native granular backups.</p>
]]></content:encoded>
			<wfw:commentRss>http://serveradmins.net/cpanel-backup-and-restore-for-disaster-recovery-purposes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
