<?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>FamousPhil.com Admin Blog and More &#187; Linux</title>
	<atom:link href="http://famousphil.com/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://famousphil.com</link>
	<description>My Personal Blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 01:40:01 +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>Listen To Your Music In Spotify For Free Without Wine (Guest Post)</title>
		<link>http://famousphil.com/blog/2012/01/listen-to-your-music-in-spotify-for-free-without-wine-guest-post/</link>
		<comments>http://famousphil.com/blog/2012/01/listen-to-your-music-in-spotify-for-free-without-wine-guest-post/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 17:51:35 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Spotify]]></category>
		<category><![CDATA[Wine]]></category>

		<guid isPermaLink="false">http://famousphil.com/?p=1633</guid>
		<description><![CDATA[Phil&#8217;s Introduction to the post: This will be the last guest post that I accept indefinitely that doesn&#8217;t deal with a difficult problem that the poster hasn&#8217;t directly solved (basically, the same things I blog about).  I feel that these posts are deteriorating the quality of my site, and guest posters are simply looking for [...]]]></description>
			<content:encoded><![CDATA[<p>Phil&#8217;s Introduction to the post:<strong> This will be the last guest post that I accept indefinitely</strong> that doesn&#8217;t deal with a difficult problem that the poster hasn&#8217;t directly solved (basically, the same things I blog about).  I feel that these posts are deteriorating the quality of my site, and guest posters are simply looking for high page rank back links to their sites, instead of writing unique, original content that creates better rankings.  In a few days, I&#8217;ll be releasing some python source code for MySQL connectivity, Nginx for high traffic sites, and other tricky problems that I&#8217;m currently dealing with in attempt to re-rail my site back onto topic.  Anyways, Rebecca Jones has written about Listening to Spotify on Linux (without WINE which is a Windows Execution Emulator for Linux), I hope that you enjoy her guest post.</p>
<p><strong>Listen To Your Music In Spotify For Free Without Wine</strong></p>
<p>Music aficionados who delight in listening to millions of tracks through Spotify’s free version but feel petered out of needing Wine at the same time have just got some good news to enjoy. The DRM-based music streaming service now announces a new free version specifically for Linux users. Spotify for free will now enable listeners to indulge in gripping tunes without calling out for Wine.</p>
<p>Integrated with a host of great user –friendly features, the music streaming application allows users to listen to millions of songs, any time they like. One can simply rifle through Spotify for a particular song and start playing in unprecedented clarity. For those unaware, Spotify is music based software which provides users with an intuitive medium to search download and play their favorite songs.</p>
<p>Almost like a new music collection, Spotify brings forth convenient access to unlimited tracks and features compatibility with home audio systems and smartphones. The app also lends support to users’ desktop and Mac for tunes that should follow everywhere. At the same time, the app allows users to discover and share music with their closed ones. In fact, users can even hear what their friends are listening to – just by hitting ‘play’ on any music post.</p>
<p>However, Spotify distinguishes from Last FM and Pandora in a couple of significant ways. To state, the app lets music buffs listen to entire albums on demand. But, be careful as there are certain obnoxiously genre-defying advertisements contained. Irrespective of the pros and cons that it comes with, the app still emerges to be an ideal pick. With this one around, people can seamlessly search up and down for songs and share them with amigos.</p>
<p>Although Spotify was extended to several platforms, the software did arch shoulders for those who would always need Wine just to listen to the music. Previously, the Linux version for Spotify used to function merely with paid accounts. Nevertheless, the free version of Spotify for Linux is now anticipated to make things simpler for enthusiasts by large.</p>
<p>The native Linux adaptation starts up pretty quickly and does not gulp down much of a listener’s time while delivering a better experience than Wine. As far as the enrollment is concerned, users will be required to register for an account at Spotify’s official website before kicking off their musical journey. But, a bit to dismay, registering feels a dearth of a Facebook account since the company has made it mandatory to have an account on the stated social networking site.</p>
<p>Besides Spotify for free without Wine, the music streaming service can be downloaded either in Premium which makes users shell our £9.99 per month or in Unlimited which costs just about £4.99 per month. Those who do not wish to fork their pennies out can simply download the free version. However, irrespective of which subscription has been settled upon, the software ensures a thorough, rich music experience. So, what are you waiting for? Just head towards Spotify and we believe the rest you know!</p>
<p><strong>About the author</strong>: Rebecca is a blogger by profession. She loves writing on environment and technology. Beside this she is fond of books. She recently bought a <a href="http://www.gizmowatch.com/agp-graphics-card-10-prices-reviews-specs.html">AGP Graphics Card</a>. These days she is busy in writing an article on  <a href="http://www.styleguru.com/magnetic-earrings-7-comfortable.html">Magnetic Earrings</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2012/01/listen-to-your-music-in-spotify-for-free-without-wine-guest-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing a screen session</title>
		<link>http://famousphil.com/blog/2011/07/sharing-a-screen-session/</link>
		<comments>http://famousphil.com/blog/2011/07/sharing-a-screen-session/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 18:22:48 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[shared session]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://famousphil.com/?p=1082</guid>
		<description><![CDATA[Phil discusses the basic usage of screen and how to share a screen session.  He also discusses the fix to a permissions problem which denies normal users from using screen.]]></description>
			<content:encoded><![CDATA[<p>Often times, I find myself working in a remote Linux terminal window. The other day, I had the need to share what I was doing with a friend, but I didn&#8217;t want to share my entire local desktop because sharing a full desktop is slow and laggy. So I quickly looked into sharing a screen session with him so he&#8217;d only see the command line window that I was in, and I know I will need it again, so its going up here.  For those of you who have a Mac or Linux, you might know that you can have multiple desktops and go through them by some key combination (usually ctrl-alt-arrow).  In a very simplified nutshell, screen basically allows for the user to exploit multiple desktops.</p>
<p>Here is how you share a screen session:</p>
<pre class="brush: bash; title: ; notranslate">
#User 1, initiator of the screen session
screen -R sessionName

#User 2, connecting to an existing session
screen -x -R sessionName
</pre>
<p>The -R flag means try to reattach to an existing session, if the existing session does not exist, create a new session and attach to that.  The -x flag means to connect to an already attached session, which allows for session sharing.</p>
<p>I ran into a problem as a non-root user (that I normally run as) when I first started using shared screen sessions.  The error is as follows:</p>
<pre class="brush: bash; title: ; notranslate">
Cannot open your terminal '/dev/pts/0' - please check.
</pre>
<p>There are several terminal devices that screen can use under the /dev/pts directory, starting with 0.  Only root can traditionally access these terminal devices, therefore, we need to modify each necessary device to allow normal users access.  I didn&#8217;t research the security implications that the following fix has, so use this at your own risk.  The server that I was using has only trusted users on it, so I was not concerned about possible risks.</p>
<pre class="brush: bash; title: ; notranslate">
#run this as root, or as sudo
#this gives others read and write access to the device
chmod o+rw /dev/pts/0
</pre>
<p>Finally, up until last week, I could never get myself out of a screen session safely without completely closing my putty terminal window.  Here is the proper key sequence to detach from a screen session.</p>
<pre class="brush: bash; title: ; notranslate">
ctrl-A  followed by  ctrl-D
</pre>
<p>To terminate a session in screen, simply type exit.</p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2011/07/sharing-a-screen-session/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Decent Backup Strategy for Exchange 2010 SP1</title>
		<link>http://famousphil.com/blog/2011/01/a-decent-backup-strategy-for-exchange-2010-sp1/</link>
		<comments>http://famousphil.com/blog/2011/01/a-decent-backup-strategy-for-exchange-2010-sp1/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 23:37:35 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[exchange 2010]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://famousphil.com/?p=613</guid>
		<description><![CDATA[Phil explains his backup routine for Exchange 2010 and some of the possible complications from it for the benefit of the reader.]]></description>
			<content:encoded><![CDATA[<p><strong>There is a new blog with additional information on this topic at <a href="http://famousphil.com/blog/2011/07/revisiting-exchange-2010-sp1-pst-backups-improved-script/">http://famousphil.com/blog/2011/07/revisiting-exchange-2010-sp1-pst-backups-improved-script/</a></strong></p>
<p>About a week ago, I finally got around to reviewing and upgrading my existing backup routine for my exchange server.  My previous backup scheme involved pushing a full server backup image to a remote server on a weekly basis.  If the server failed during a backup, I would have no viable way of recovering from a complete disaster.  Obviously, this required some changes.</p>
<p>With the release of SP1 for Exchange 2010, a few new power shell commandlets came out that provide functionality to back up Exchange accounts directly on the server (no needing second computer with outlook and exchange management tools anymore!).  This meant that I decided to utilize some backup scripts that backup each mailbox nightly.  I also modified the weekly system backup.</p>
<p>There are scripts attached to this post.  With any kind of solution that I provide, I always provide it on an as is basis with no warranty provided that it will work for your situation, although I try my best to cover as many scenarios as I can.</p>
<p>So what was decided upon?<span id="more-613"></span></p>
<p><strong>Full Image Backup</strong>: On the local Exchange front, I opted to make the monthly full system image backup run the first Sunday of every month.  It is configured to back up to a network share that is actually on the same server.  When backing up to a local drive, Windows Backup typically appends to the backup and I prefer to have the previous backup removed so that disk space usage is minimized.  The full backup takes about 25 minutes to complete and is stored locally.</p>
<pre class="brush: bash; title: ; notranslate">
rmdir /S /Q localhostbackupwinbackup
mkdir localhostbackupwinbackup
C:WindowsSystem32wbadmin.exe START BACKUP -backupTarget:localhostbackupwinbackup -vssFull -allcritical -quiet
</pre>
<p>Then, on the eighth day of each month, my Linux-based backup server connects via SCP to pull the monthly image that was created.  Technically, it would take a dual hard drive failure (both the system drive, and backup drive) to completely render the system un-restorable with this scheme.  It is very rare to see a dual drive failure, but if it were to occur, I still would have the nightly backups to fall back on and it might take about 5 to 10 hours more to complete a restoration.</p>
<p>SCP as I’ve mentioned in the past is a way to copy files between two Linux based servers securely.  It operates using the SFTP protocol which runs on top of SSH.  Remember that SSH is a way to bring up a command prompt that runs on the remote system.  Since Windows doesn’t natively support any decent secure file transfer techniques that I’m aware of, I installed copssh (<a href="http://www.itefix.no/i2/copssh">http://www.itefix.no/i2/copssh</a>), which is a Cygwin based solution for Windows that supports SSH and SFTP (and ultimately the SCP command).  With Cygwin working on the Exchange server, I added a user to Cygwin with bash shell access and I firewalled port 22 to where only the remote backup server could connect (for security reasons mostly).  I will leave the actual SCP script writing up to the reader, although here is a helpful page (<a href="http://en.wikipedia.org/wiki/Secure_copy">located here</a>).  I will also hint that the reader will need to learn about public keys to allow for a passwordless remote ssh login so that sftp doesn&#8217;t prompt for a password when ran as a cron job.</p>
<p><strong>Nightly Backup: </strong>When Exchange 2010 SP1 was released, several commandlets were created in powershell which allow for the export of PST files without needing Outlook installed on the same computer (which should never be installed on an exchange server directly).</p>
<p>I’ve found that in my initial testing of the PST export, there is a fairly large performance hit on the server, so I recommend doing it at the least used hour available.  I’ve also found that it takes a fair amount of time (10 minutes or so) and cpu power to export a large mailbox (> 1GB).  I also found that when restoring (importing) a PST, it can only be imported to another folder of the mailbox, it cannot overwrite existing mail in the box (I guess this is a good thing and a bad thing).</p>
<p>Anyways, I managed to find how to do a mass export using powershell at <a href="http://www.stevieg.org/2010/07/using-the-exchange-2010-sp1-mailbox-export-features-for-mass-exports-to-pst/">Steve Goodman’s Tech Blog</a>.  I modified the script because his script included mailboxes that I didn’t care about (such as alias boxes, the discovery box, etc).  My Script takes in a constant array of usernames (mailbox alias names) and only backs up those boxes sequentially (posted with this article).  This happens nightly at 12:45am since that is the least active time for my system.  I chose to export to the same local drive as my other backups so that they could be pulled in by my backup server (via SFTP).  This maintains security of all the email data I handle.</p>
<p>The first task when implementing this backup plan is to set appropriate permissions to make the backup work.  The folder or server share (in my case) where the export will be saved needs to have the modify permission set for the Exchange Trusted Subsystem.  Remembering my firewall woes post, make sure that file and printer sharing rules are present in the firewall (even if you have custom rules and disable the default rules), otherwise you will get an illegal exception error without any real clue for what the problem is.  Then, within exchange’s powershell interface, the user who will be running the export commandlet will need to have permissions set.  This can be done by the command:</p>
<pre class="brush: powershell; title: ; notranslate">
New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “ADAdmin”
</pre>
<p>Next, it is probably helpful to get a listing of all the mailboxes so that we know the aliases of each mailbox that needs to be backed up.  I will note that I’ve also noticed that lower/upper case doesn’t matter on Windows Powershell like it would on a Linux based shell.  The command to get the listing is:</p>
<pre class="brush: powershell; title: ; notranslate">
get-mailbox
</pre>
<p>Using the output of the Alias column, you should be able to fill in the script that I’ve modified (from Steve Goodman) and have it run.  At the end of a successful run, I have powershell send me an email telling me if the job was completed successfully or not.  I’ve noticed that my spam filters caught that email, so I added an exception for my Exchange server.  The end of this post has the actual script, and the source can be found here.   The email portion of my script initially threw errors to me, eventually I used telnet to test if port 25 was open and I discovered that it wasn’t.  It turns out that my exchange server was not listening on port 25 of the localhost address.  If you run into this situation, I’d recommend checking that or the firewall before jumping to conclusions.  Telnet is a very powerful tool!</p>
<p>Last but not least, I pull the nightly backups from Exchange every day at 8am, well after the nightly backup is finished.  The script that pulls these backups is very similar to the monthly script but it copies the existing daily backup to a weekly retention folder every Sunday before it begins grabbing the latest nightly backup.  I’ve included that script below for your reference.</p>
<p><strong>Conclusion</strong>: Backups are a necessary part of any viable disaster recovery plan.  I’ve outlined one above that I use on my own systems.  I’m sure it isn’t perfect, but it’s well thought out and I have used it to recover systems in full before.  As with any backup plan, I usually always test it out immediately after its implementation to verify that it will work in the event of a disaster.  As a system admin, I never want to be left holding onto a faulty backup that I believe worked and I’m sure that you can also appreciate this thinking.</p>
<pre class="brush: bash; title: exchangedaily.sh; notranslate">
#Crontab Entry
#5 8 * * * /back/exchangedaily.sh  | mail -s &quot;daily exchange offsite backup finished&quot; phil@matthouse.us
#!/bin/bash
cd /backup/exchange
if [ $(date +%A) = &quot;Sunday&quot; ]
then
        rm -Rf weekly
        mv daily weekly
        mkdir daily
        cd daily
else
        rm -Rf daily
        mkdir daily
        cd daily
fi
scp -r admin@matthouse.org:/cygdrive/e/bck/pstbackup ./
</pre>
<p><strong>This script has been updated:  <a href="http://famousphil.com/blog/2011/07/revisiting-exchange-2010-sp1-pst-backups-improved-script/">http://famousphil.com/blog/2011/07/revisiting-exchange-2010-sp1-pst-backups-improved-script/</a></strong></p>
<pre class="brush: powershell; title: MassExport.ps1; notranslate">
# Exchange 2010 SP1 Mailbox Export Script
# Steve Goodman. Use at your own risk! - modified by Philip Matuskiewicz for Matthouse 1/2/11

#create a .cmd file with the following line to invoke this:
#C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -command &quot;. 'c:Program FilesMicrosoftExchange ServerV14binRemoteExchange.ps1'; Connect-ExchangeServer -auto; .MassExport.ps1&quot;

#what to back up from?
$Server = &quot;exchangeserver.matthouse.org&quot;

#who to backup, use the alias from commandlet Get-Mailbox -Server $Server (replace $server appropriately)
$USRALIAS = @(&quot;FamousPhil&quot;, &quot;MyUserOne&quot;, &quot;Staff &quot;, &quot;AnotherUSER&quot;)

# Share to export mailboxes to. Needs R/W by Exchange Trusted Subsystem
$ExportShare = &quot;localhostbackuppstbackup&quot;

#error checking

    if (!(Get-ExchangeServer $Server -ErrorAction SilentlyContinue))
    {
        throw &quot;Exchange Server $Server not found&quot;;
    }
    if (!(Get-MailboxDatabase -Server $Server -ErrorAction SilentlyContinue))
    {
        throw &quot;Exchange Server $Server does not have mailbox databases&quot;;
    }
# Make batch name
$date=Get-Date
$BatchName = &quot;Export_$($date.Year)-$($date.Month)-$($date.Day)_$($date.Hour)-$($date.Minute)-$($date.Second)&quot;

        Write-Output &quot;Queuing Pre-defined mailboxes as batch '$($BatchName)' sequentially&quot;

foreach ($element in $USRALIAS)
{

        if (Get-Item &quot;$($ExportShare)$($element).PST&quot; -ErrorAction SilentlyContinue)
        {
                Remove-Item &quot;$($ExportShare)$($element).PST&quot; -Confirm:$false
        }
        New-MailboxExportRequest -BatchName $BatchName -Mailbox $($element) -FilePath &quot;$($ExportShare)$($element).PST&quot;

        while ((Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -eq &quot;Queued&quot; -or $_.Status -eq &quot;InProgress&quot;}))
        {
                Write-Output &quot;Waiting on backup of $($element), refreshing every 60 seconds&quot;
                sleep 60
        }
}

###REPLACE SMTP SERVER, FROM, and TO addresses and potentially subjects below.

        $SmtpClient = new-object system.net.mail.smtpClient(&quot;exchangeserver.com&quot;)
        $msg = new-object Net.Mail.MailMessage
        $msg.From = &quot;phil@matthouse.us&quot;
        $msg.To.Add(&quot;phil@matthouse.us&quot;)

    $Incomplete = Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -ne &quot;Completed&quot;} | Get-MailboxExportRequestStatistics | Format-List
    if ($Incomplete)
    {
        Write-Output &quot;Process didn't complete, Emailing report to admin&quot;
        $msg.Subject = &quot;Double.matthouse.org Backup Incomplete&quot;
        $msg.Body = $Incomplete
        $SmtpClient.Send($msg)
    }

    $Completed = Get-MailboxExportRequest -BatchName $BatchName | Where {$_.Status -eq &quot;Completed&quot;} | Get-MailboxExportRequestStatistics | Format-List
    if ($Completed)
    {

        Write-Output &quot;Backup done, sending the report to admin&quot;
        $msg.Subject = &quot;Double.matthouse.org Backup Complete&quot;
        $msg.Body = $Completed
        $SmtpClient.Send($msg)
    }

# Remove Requests and clean up
Write-Output &quot;Removing requests created as part of batch '$($BatchName)'&quot;
Get-MailboxExportRequest -BatchName $BatchName | Remove-MailboxExportRequest -Confirm:$false

Write-Output &quot;Process complete!&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2011/01/a-decent-backup-strategy-for-exchange-2010-sp1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CronJob Failing?  Maybe its a race condition&#8230;</title>
		<link>http://famousphil.com/blog/2010/10/cronjob-failing-maybe-its-a-race-condition/</link>
		<comments>http://famousphil.com/blog/2010/10/cronjob-failing-maybe-its-a-race-condition/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 02:05:35 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cron job]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[supercomputer]]></category>

		<guid isPermaLink="false">http://famousphil.com/?p=584</guid>
		<description><![CDATA[Phil discusses how scp failed in Linux when being ran simultaneously from 35 machines.]]></description>
			<content:encoded><![CDATA[<p>Sorry for such a long wait.  It isn&#8217;t often that I have time during the college semester to write posts for my blog, especially ones that fulfill my expectations (long, boring, informative, etc)&#8230; You get the idea <img src='http://famousphil.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .  As you can probably tell by the title, I ran into a very strange problem.  Being a decent system administrator, I tend to come up with much more advanced problems that I cannot solve easily.  This problem took me a few weeks so I thought I&#8217;d post it to the web so that it might help someone else.</p>
<p>About 2 months ago now, I finally got back to school and I got back to work on my Masters project, which is basically building a condor flock and programming on it.  For those of you who don&#8217;t know what that means, I&#8217;m building a variant of a super computer.  Last year, I spent hours putting together everything and making it all work, but there were tiny things here and there that I finally got time to address.  With 35 computers that do the same thing, generally, performing the same tasks to the machines is acceptable (for example, monthly updates).</p>
<p>Cron Jobs in Linux will run a script (or program) at a specified time (and date).  The description of a Linux cron job fits the bill perfectly for running updates automatically on the 35 machines that I&#8217;m tasked with keeping updated and running smoothly.  I am also aware that in Linux, NFS (Network File System) can share files between Linux enabled computers.  Using NFS, I can put a file in a central location and grab it from each computer automatically, run it, then move on.  <span id="more-584"></span></p>
<p>This seems like it would work, but I forgot one tiny problem, NFS is very insecure.  Let me explain, with NFS, there is no such thing as authentication (ouch).  NFS simply looks for computers on the network to request files and folders.  When a request is received, it looks at the user who made the request, then if that user has read / write access to the directory they requested from the server, they will get access.  Passwords aren&#8217;t sent, so there isn&#8217;t any kind of password that protects the information, you simply have to be logged in as that username to get to a user&#8217;s files on a server.  For this reason, typically when NFS is ran on a network, that network is heavily fire walled and the NFS server can only be reached by trusted computers on the network.  Even though trusted computers are specified on the network, it is very easy to spoof their identity with a personal Linux laptop and connect to the server.  This is why NFS also has something called root_squash which disables root from getting access to files on the server (since root can do anything in Linux, kind of like a Windows Administrator, but more powerful).</p>
<p>I decided to keep NFS for user&#8217;s files since it is easily implemented, and my network is physically secure to where users can&#8217;t plug into the network physically to spoof users.  However, I did decide that it would be best to squash root access to the NFS server.  From this information, I found that NFS will not be suitable to run scripts from  since root is going to be running those scripts.  Therefore, I switched my approach to scp.  SCP in Linux is a utility that securely transfers files from one computer to another.  It is able to use public key encryption (RSA) to login to a remote machine as a user.  SCP is sort of like SSH, but it doesn&#8217;t provide a shell to the user.</p>
<p>With SCP and Cron ready to go, I wrote a script that would simply login to the head server as a user to download a script securely that each machine could run.  The script worked perfectly every time I ran it manually from the terminal, so my testing phase was done and I went to implement it as a cron.  What I found after implementing the cron on the 35 machines was that only 50% of the machines or about there actually ran the script.  Another weird consideration is that the 50% that ran the script was random.  At this point a few days later, I was wondering what was going on.  I began examining the cron job, figuring out if there was a bug of some sort, or something along those lines.  I suspected paths might be an issue, so I modified the cron job to contain full paths to each program.  For example, for cd (change directory), I changed that command to /usr/bin/cd which is the full path to the variable.  Linux usually sets a path variable when you login to it, so cd is automatically found in /usr/bin, but I figured that cron may not be doing that.  I continued getting the same problem.</p>
<p>After a week of being perplexed, I finally thought back to my algorithms class, and I remember something about a race condition.  Basically, what happens when 35 machines are bombarding one central machine simultaneously for information&#8230; Usually they give up after a while (a matter of seconds in the cyber world).  So with this in mind, I tried making the crons run at different times of the hour and furthermore, I also verified that the main file server didn&#8217;t have any limits set which would cause scp to fail at getting the file.  After an hour of modifying the cron jobs, they work perfect.</p>
<p>I wish I would have seen this problem sooner, but hopefully my mistake can help save someone else a week of their professional career <img src='http://famousphil.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2010/10/cronjob-failing-maybe-its-a-race-condition/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Windows or Linux Hosting?</title>
		<link>http://famousphil.com/blog/2010/08/windows-or-linux-hosting/</link>
		<comments>http://famousphil.com/blog/2010/08/windows-or-linux-hosting/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 01:26:03 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[choice]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://famousphil.com/?p=526</guid>
		<description><![CDATA[Phil discusses the difference between Windows Hosting and Linux Hosting and why Linux Hosting is truly more wise in most cases.]]></description>
			<content:encoded><![CDATA[<p>Often times, I&#8217;m asked the question: Should I get Windows hosting or Linux hosting for my new website.  This is a topic that comes up time and time again in my field of expertise and sadly, newbies often choose based on perception, not based on fact.  This blog will cover some of the facts about both hosting platforms and hopefully help you make an informed decision about how you want your website hosted.<br />
<span id="more-526"></span><br />
Due to perception, Windows hosting, by no doubt, is the most chosen hosting platform by newbies worldwide (in my experience).  Unless my knowledge is outdated, Windows is the most popular and used operating system on the market today.  I&#8217;d say that there are at least 2 windows users to every mac or Linux user out there, there are possibly as many as 5 or 6, but I will remain with a conservative estimate.  Most new people who are just starting in the website world want their new website to be as compatible with everyone else as possible.  Since most people use Windows, most newbies make the assumption that Windows hosting is necessary to ensure that most of their friends will be able to see their website without any compatibility issues.</p>
<p>Before I get to the main point, I&#8217;d like to explain how a web server acts under the hood.  Deep down in the guts of the web server&#8217;s programming, there is a concept called a socket and a protocol.  Sockets are used to open a connection from any web browser (Internet Explorer, Firefox, Chrome, Safari, Opera, etc) to the web server sitting in a data center somewhere.  A socket is similar to establishing a telephone call to a friend, the wires that connect both ends of the telephone receivers together can be viewed as a socket.  A protocol can be simply described as a means of communication.  When you&#8217;re on the telephone, there is a way that you speak, for example, you expect to hear hello before the conversation begins, and there are pauses and such as both sides understand the other.  If the connection is weak, one side may ask to hear the message over again.  This is the normal protocol of a telephone call.  Computers are no different, they expect hello messages, acknowledgment messages and such to validate that the message each side got was the correct message.  In the web&#8217;s case, this protocol is called Hyper Text Transfer Protocol (HTTP).  Finally, there is data that is passed through the socket.  The data follows the protocol specification.  On the telephone, you&#8217;d begin speaking English, then once done, you&#8217;d wait for the other side to return its response in English.  Most web browsers understand HTML (Hyper Text Markup Language) and this is passed through the socket.  The last paragraph has been ultra simplified so that you can get the idea.</p>
<p>Contrary to popular belief, Windows hosting is actually just as compatible with the world as Linux hosting is!  Because of HTTP, all web servers must communicate using a single protocol which is HTTP.  All browsers that work with the web send an HTTP request to a web server for a certain content and the web server returns it.  It may not always be plain text (HTML is written in plain text), but at times it may be binary (1/0 encoded) data that contains an image or other files.  Regardless, the web server must be uniform in a response, it is up to the browser how this data may be displayed.</p>
<p>ASIDE: Most web developers are annoyed about how they HAVE to test Internet Explorer, Opera, Firefox, Chrome, and Safari to make sure that their web page looks correct.  Browsers all will get the same exact data from the server, but they parse the data differently.  Think of English, I&#8217;m sure that you&#8217;ve been in situations where you misunderstood the other party and therefore took a different action.  Computer browsers parse (or understand) the same web page differently, so they may display web pages a bit different than other browsers.  To implement (program) a browser, you need to look at the specification of the HTTP protocol and HTML language then give the browser methods to display what it understands.  There is no single way to write a parser, therefore all parsers (browsers in this case) may produce slightly different results.  In the past, Microsoft has been the worst offender since they didn&#8217;t fully implement the HTML specification which is well known, but they&#8217;ve gotten much better.</p>
<p>Back to the original topic, since all servers have to return the same exact data, it doesn&#8217;t matter what operating system is on the server, it will return the same compatible data regardless.  So now, what are the differences between Windows and Linux based hosting?</p>
<p>Windows Hosting-</p>
<ul>
<li>Price: Just like with your copy of Windows on your local computer, a copy of Windows for a server is quite pricey.  If you want the latest and greatest Windows Server version (currently 2008 R2), you are looking at anywhere between $300-$1500 PER COPY of Windows Server 2008 R2.  This is on top of the costs to keep the server running in a data center that is climate controlled and sufficiently powered (backup systems in place, multiple excellent internet connections to many providers).</li>
<li>Stability: Windows has a monthly release of updates from Microsoft, sometimes these are more frequent as important issues are found and fixed.  Normally, 99% of Windows updates require a reboot of the server.  During the reboot, your websites are not accessible.  Therefore, you can easily look at 5 to 10 minutes of downtime at least once per month if your host cares anything about security.</li>
<li>Ease of administration: Most administrators start in Windows and never leave because Windows typically babies the administrator through any task.  Windows has really nice wizards that take all the difficulty out of administration.  Windows also typically can fix itself if it runs into issues, so there is less time spent fixing problems.  Unfortunately, since administrators don&#8217;t need to know a lot to get by with Windows, some security measures are often overlooked.</li>
<li>Control Panels: These are often desired in hosting since it gives the client the power to do anything with their website space, including create accounts, view statistics, add additional domains, control email accounts and more.  There are 4 control panels that I&#8217;m aware of, they are dotnetpanel, vdeck, plesk, helm.  All 4 of these controls panels can cost anywhere from $20-$100/month to maintain from their suppliers.</li>
<li>Supported Languages: ASP.net, ASP, JSP, Perl (CGI), PHP, Python, Ruby, etc</li>
<li>Supported Database Servers: MySQL, MSSQL, Oracle, etc</li>
</ul>
<p>Linux Hosting-</p>
<ul>
<li>Price: Linux is free, so you&#8217;re really looking at the bare cost to keep the server running in a data center.  This dramatically reduces the cost of hosting.</li>
<li>Stability: In my experience, I see the need to reboot a Linux server every 4 to 5 months due to a major security vulnerability that involves the kernel (the heart of Linux).  Linux can be easily updated without a reboot, so clients typically experience much less down time.</li>
<li>Ease of administration: Linux has very few wizards and graphical screens that say &#8220;let me baby you through this dreaded task&#8221;.  In fact, Linux is 99% controlled by the command line when it is used as a server.  Often, Linux often will not even notify the administrator that there is a problem directly.  Therefore, administrators tend to monitor Linux more closely.  They also know the command line more because to get a server running in Linux takes a lot more knowledge than it does in Windows.  Linux administrators are also more likely to know about security measures more because they read more about flaws that are found.  This makes Linux administrators get a better pay check, but in the end, Linux tends to be very stable because the admins really know what they&#8217;re doing (in most cases).</li>
<li>Control Panels: Like Windows, control panels on Linux cost between $20-$100/month from their suppliers.  The most common panel for Linux is CPanel, Plesk also exists.  These give you full control over your web space and in many cases, they also simply the administrator&#8217;s job by doing the hand editing of vital configuration files automatically (like Windows would do).</li>
<li>Supported Languages: JSP, Perl (CGI), PHP, Python, Ruby, etc</li>
<li>Supported Database Servers: MySQL, Oracle, etc</li>
</ul>
<p>So, I&#8217;ve done a comparison, what is the verdict?  In my humble opinion, Linux is by far my choice of a hosting platform.  Although Linux admins may cost a little more, they really don&#8217;t cost enough more to make it unreasonable (Windows admins make a good pay check too!).  It does everything that Windows can do and more.  There is just one catch with Linux.  Linux doesn&#8217;t support Microsoft SQL Server or ASP.NET (active server pages) fully (You can achieve partial support using MONO).  Therefore, if you must have a website that uses either MSSQL or ASP/ASP.NET, I&#8217;m afraid that you have no choice if you want your website to work without problems.  Most websites are programmed in PHP, so this is rarely a problem, but for some businesses that started long before PHP was created, ASP is a need, therefore, Windows is needed.</p>
<p>Yet another Aside: You may have noticed that not too long ago, I added a new Windows server to Matthouse (bit).  This was added because I do not have a lot of ASP experience and I thought it would be nice to get some experience with it.  I&#8217;ve decided to use ASP to pull data from Microsoft Exchange to display a new calendar on FamousPhil.  I hope that this is done by the end of August!  Unfortunately, I cannot access Exchange from PHP, so I had no real choice but using ASP.net to pull data.</p>
<p>This blog post was made because I&#8217;ve always seen newbies go for Windows without a real reason.  Its sort of like the Mac fans who fight to get Mac products for no real advantage over something like the Android OS on Verizon Phones.  Hopefully this blog post will convince you that Linux is indeed a better choice unless you seriously want to learn or use ASP.net for your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2010/08/windows-or-linux-hosting/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Getting Public Key Authentication to work in SSH</title>
		<link>http://famousphil.com/blog/2010/02/getting-public-key-authentication-to-work-in-ssh/</link>
		<comments>http://famousphil.com/blog/2010/02/getting-public-key-authentication-to-work-in-ssh/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 05:51:12 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[keygen]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://famousphil.com/?p=403</guid>
		<description><![CDATA[Phil discusses the use of SSH public and private keys for passwordless authentication to remote linux computers.]]></description>
			<content:encoded><![CDATA[<p>This post is going to be short, sweet, and to the point <img src='http://famousphil.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />   It seems that every time I build a new server, I&#8217;m constantly at a loss for memorizing the commands that generate public keys in SSH (Secure Shell).  SSH for the computer illiterate is the Linux equivalent to Windows Telnet Services.  This basically gives you a command prompt that is running on a remote computer.</p>
<p>SSH is the heart and soul of linux based computers because *everything* can be done through the command line simply.  Unfortunately, Windows is just starting to catch up with Telnet using a new application called powershell.  Powershell is very unlike the linux command line though since it is more a scripting language than a command based language.  This is why I always scratch my head when working with Microsoft Exchange Server&#8217;s Powershell commands and end up reverting to the famous Microsoft graphical administration interface which gives me the option of &#8220;next next next finish&#8221;.  I really do appreciate the Microsoft wizards that make software so easy to administer.  Anyways, Linux never started with a graphical desktop (Unlike Windows and Macintosh), therefore, the command line in linux is far easier to use when administering a system.</p>
<p>To get back to my original topic, I am a fan of passwordless entry into my own systems.  With linux and SSH, there are a few authentication methods, 1 being password entry, and 2 being public key authentication.  With a password login, you basically enter a username and password and you are logged into a command prompt on linux.</p>
<p>With public key authentication, you generate 2 keys at your local computer, one being a private key and the other being a public key.  Basically, you give the server you wish to connect to the public key, and only you hold onto the private key.  When you connect to the server, it will first give you the public key so that you can verify that the server is actually the server that you want to connect to.  This will be ignored on the first connect, but in the future, if this key changes, you will be notified that the server was possibly compromised.  Upon allowing the connection, you will give the server your private key and it will run some calculations on the key you provided.  If the result matches that of the server&#8217;s public key, you will be granted access.  Since keys are generally 256 hexadecimal characters long, these are much more secure than normal passwords, and they are generally much easier to use (unless your laptop is stolen).</p>
<p>So now onto how to actually use these keys:</p>
<p>1. Generate the key on your local machine (not the remote machine).<br />
<strong>A. ssh-keygen -t rsa<br />
</strong>2. Verify that your remote server has an ~/.ssh directory.  ~ in linux is the home directory.<br />
3. Copy the local public key to the server<br />
A. This can be done with: <strong>scp ~/.ssh/id_rsa.pub user@remote_server:~/.ssh/authorized_keys2</strong><br />
B. Notice I specified authorized_keys2&#8230; this is actually for SSH Protocol 2 which is a more secure SSH protocol than the original.<br />
C. scp is secure copy in linux and it copies files between computers using SSH tunnels.<br />
4. Attempt to ssh into your remote machine.  It should not need a password anymore.<br />
A. <strong>ssh user@remote_server</strong></p>
<p>Hopefully this helps make sense of SSH keys.</p>
<p><strong>Afterthought on 2/4/10:<br />
</strong>when using the scp command as a copy / paste above, this will overwrite your authorized_keys2 file on the remote computer.  To prevent this from happening, append to the file using this command (thanks Cris for pointing this out to me):</p>
<p><strong>cat </strong><strong>~/.ssh/id_rsa.pub</strong><strong><em></em> | </strong><strong>user@remote_server</strong><strong> &#8220;cat >> <em></em></strong><strong>~/.ssh/authorized_keys2</strong><strong><em></em>&#8220;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2010/02/getting-public-key-authentication-to-work-in-ssh/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Win Serv 2003 Backups over a network w/out being logged in</title>
		<link>http://famousphil.com/blog/2009/07/win-serv-2003-backups-over-a-network-wout-being-logged-in/</link>
		<comments>http://famousphil.com/blog/2009/07/win-serv-2003-backups-over-a-network-wout-being-logged-in/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 18:05:03 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mapped network drive]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[ntbackup]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[server 2003]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://famousphil.com/blog/?p=233</guid>
		<description><![CDATA[Phil goes into technical details of how to backup a Windows server using the ntbackup utility over a network link without having to be logged into the server.]]></description>
			<content:encoded><![CDATA[<p>As you probably know by now, I have a Microsoft Exchange 2007 server.  With any kind of server, a backup and disaster recovery plan is a vital part of any kind of professional hosting.  Hosting email can be quite tricky as it is, but taking network backups was a new road that I&#8217;ve never covered in Windows.</p>
<p>First, I have a fairly simple environment set up for my backup.  I have a Linux backup server running samba sitting in Seattle (mthsweb2).  This server has the Windows IP white listed so that only my Windows server can connect to it to map a network share.  For those of you who don&#8217;t know what samba is, samba is a daemon in Linux that will allow Windows to naively connect to a Linux server for file sharing.  Samba is a very simple solution for mapping a network drive to Linux in Windows without needing any specialized software such as sftpdrive (not called something else).</p>
<p><span id="more-233"></span></p>
<p>I want to connect Windows to Linux so I mapped a network drive on the Windows server (and I made sure reconnect at login was checked).  I logged in using the proper credentials and saved them to my Windows user account.  I then proceeded to setup NTBackup (the Windows server backup utility).  Configuring NTBackup was quite simple, a few next&#8217;s and a couple of checks on my exchange server information, system state, and a few very important directories that hold onto ssl certificates for the server.  Naturally, the backup ran fine while I was logged in.  The problem was, when I was logged off the server, the backup failed because the network drive wasn&#8217;t there.</p>
<p>After some research, I found an easy way to solve this via batch scripting.  I could schedule a task in Windows that would run the batch script which would map the network drive for my system and execute NTBackup.  Below is the script  (you will need to customize the bold parts as described below):</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
@echo off</p>
<p>net use z: <strong>server</strong><strong>backup </strong>/persistent:yes</p>
<p><strong>C:WINDOWSsystem32ntbackup.exe backup &#8220;@C:Documents and SettingsadminLocal SettingsApplication DataMicrosoftWindows NTNTBackupdatad.bks&#8221; /a /d &#8220;Set created 7/10/2009 at 1:49 PM&#8221; /v:no /r:no /rs:no /hc:off /m normal /j &#8220;d&#8221; /l:s /f &#8220;C:Documents and SettingsadminMy DocumentsBackup.bkf&#8221;</strong></p>
<p>net use z: /d /y</p>
<p>exit<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Now that we have a script, what do we put in place of the bold remarks?  <strong>Server </strong>should be the IP Address of your remote file server.  This can either be a Linux server running samba or a Windows File Server.  Either method will require that you open up a range of file sharing ports on your firewall, I tend to just whitelist the ip of the server doing the backup from the backup server&#8217;s firewall.  If you are curious of the ports, I believe you need TCP ports 135-139 open for Windows file sharing to work, but there may be more.    The bolded <strong>backup</strong> is the path from the file sharing server to where you want to store your backup.</p>
<p>To get the <strong>other bolded part</strong>, you will need to login to Windows and map a network drive under the letter you used in the script (Z in this case).  Once the drive is mapped, make sure you save your login credidentials.  Now goto the system backup utility in start>programs>accessories>system.  Select your desired backup files and when you get to the location selection screen, make sure you save to the network drive letter you created.  Then when you get to the finish screen, click advanced.  Do a normal backup appending to existing backups (or whatever you desire).  Schedule the job for later (try a few days or a week later).  You will need to type in your username / password up to 4 times until you get past this screen to the finish screen.   Once done configuring your backup, goto start>programs>accessories>system -> scheduled tasks.  Double click the backup you made and you should see something like the blurb in the batch script above.  You will need to copy this entire line and paste it into this batch script.  After you have this line successfully saved into your script, you should disconnect the drive letter from my computer by right clicking the drive and selecting disconnect.</p>
<p>Now take the entire composed batch script and paste it into a new notepad document.  Now goto file > save as on notepad and save it to a file like backup.bat in the c drive or someplace where it will be easily findable.</p>
<p>Now you can go back to the scheduled tasks, remove that backup job (its not needed anymore) and remove it from the recycle bin.  Now create a new scheduled task.  This time select the bat script you made and schedule it as needed.  Its a fairly simple set of on screen instructions to follow.  Once this task is scheduled you&#8217;re all set.</p>
<p>If you wish to test the batch script before making it a scheduled task, simply click on it and your backup should run perfectly.</p>
<p>Thats all there is to it.  This was a 5 minute fix for me and I no longer have to worry about finding a third party solution to making stable backups of my operating system.  In addition to this backup method, you might want to look into running a mirror where 2 drives copy each other live.  This will also prevent against data loss provided there isn&#8217;t any danger in the server room such as fire or water damage.</p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2009/07/win-serv-2003-backups-over-a-network-wout-being-logged-in/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>my biggest blunder as a system admin</title>
		<link>http://famousphil.com/blog/2009/04/my-biggest-blunder-as-a-system-admin/</link>
		<comments>http://famousphil.com/blog/2009/04/my-biggest-blunder-as-a-system-admin/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 17:57:00 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[blunder]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[disk space]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[var/lib/mysql]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://famousphil.com/blog/?p=98</guid>
		<description><![CDATA[Phil discusses the time when he removed mysql from a production server with over 100 clients on it.]]></description>
			<content:encoded><![CDATA[<p>A good place to introduce this topic is by stating that I consider myself a &#8220;good&#8221; system administrator.  I consider myself above average when it comes to Windows Server administration, and &#8220;average&#8221; when it comes to Linux server administration.  Normally, regardless of platform (Linux or Windows), I usually know enough not to get myself into trouble, yet rectify the problem that is presented to me.</p>
<p>Prior to last October (2008), I have solved a wide array of problems consisting of Apache malfunctions and complete Server Hard Drive failures requiring data recovery, to simply having to unblock a person&#8217;s ip address from the firewall because they tried to login to the server incorrectly too many times.  I never really messed a server up so badly that I couldn&#8217;t undo what I attempted to fix in the first place.</p>
<p><span id="more-98"></span></p>
<p>The biggest problem that I have ever had up until October 2008 was with an email server&#8217;s outgoing email queue.  All email that was sent from this server would always be refused by other popular mail servers on the internet due to it not having the correct configuration.  I never did figure out that error, and instead I changed the software that manages the email server from <a href="http://lxlabs.com">LXAdmin</a> to <a href="http://www.cpanel.net">CPanel</a>.  This fixed the problem, I never did understand why the server wouldn&#8217;t send, but CPanel fixed my mail problems and so many other problems that I sort of fixed on LXAdmin but didn&#8217;t really have a long term solution for.</p>
<p>Now that I have blabbed on enough about my experience, lets get to this blunder (I&#8217;m sure I&#8217;ve posted about it elsewhere, but I don&#8217;t recall putting it here).  In October, Justin, a good friend who runs <a href="http://www.amphosted.com">AmpHosted</a> came to me (this wasn&#8217;t the first time incase you are wondering) asking about some sort of tiny problem that he was somewhat unsure of how to fix, but he had the right idea and I confirmed it.  He also asked me how to free up space on the linux /var directory since his was getting pretty full.  I&#8217;m not sure how the conversation went anymore, however I know that there were a few possible solutions.</p>
<p>My first goal was to free up enough space so that the /var partition wouldn&#8217;t overflow and risk crashing the server.  Server crashes can be costly, and Justin was in no mood to lose money as a president of a strengthening hosting company.  So I began googling to figure out what log files were safe to delete.  I know that linux has a lot of log files that cannot be deleted safely, and I was finding these so I would know not to delete them.</p>
<p>My second goal was to have this partition expanded from free space on the other partitions so that the problem would have a more permanent solution (which did happen in November).</p>
<p>I then noticed that one of the mysql directories was using most of the space.  I quickly did a google search and read that it was safe to delete a mysql log directory.  Unfortunate for me, I only saw what I wanted to see, and didn&#8217;t read the article thoroughly. <strong> Needless to say, I wiped out the /var/lib/mysql directory from his server, effectively freeing up a lot of disk space on the /var partition, and also wiping out the mysql server and all of the database files. </strong>On top of this, when I began looking for the backup files to quickly restore the databases within an hour, I found out quickly that some of the <strong>backups were corrupt</strong> and others non existant.  After restoring most of the server, one client lost a month of data and I felt horrible!</p>
<p>Since then, my admin buddies still push that blunder in my face.  I&#8217;m not entirely sure why because I still feel sorry for Justin.  I have also started taking the time to read what is safe to remove and not so I don&#8217;t accidently do something that bad again.  A mistake like that could have costed me my job or a pay cut if I was working directly for a big time hosting company, even if I did have 10 to 15 years of experience.</p>
<p>Since then, when it comes to matthouse and my own hosting company, or when I&#8217;m helping Justin, I always make sure to double check that I&#8217;m right before I proceed.  I know that I&#8217;m now slower, but I also have made changes to my procedures to make them more safe, sacraficing speed in my repairs.</p>
<p>I feel that I should write this blog for 2 reasons, 1. to make it known that I DO make mistakes and I&#8217;m not perfect, and also, I hope that anyone who reads this blog will make sure to check twice before doing an operation that is not reversable (at least easily).</p>
<p>I will be taking a system administration course next semester which is linux based with a FreeBSD pioneer teaching that course.   The final reason why I wrote this was to say how good of an Admin I consider myself now, so that after that course, I can re-rate myself and hopefully talk about a lot of my experiences in that class.</p>
<p>One final note, I&#8217;m still working on adminreference.com, and I will probably start posting more recent knowledge that I&#8217;ve acquired in the near future after this final week of college classes and work.</p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2009/04/my-biggest-blunder-as-a-system-admin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Advantages / Disadvantages of using WHM / CPanel (Mainly on major sites)</title>
		<link>http://famousphil.com/blog/2009/02/advantages-disadvantages-of-using-whm-cpanel-mainly-on-major-sites/</link>
		<comments>http://famousphil.com/blog/2009/02/advantages-disadvantages-of-using-whm-cpanel-mainly-on-major-sites/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 17:50:13 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[CPanel]]></category>
		<category><![CDATA[Host]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Manager]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://famousphil.com/blog/?p=21</guid>
		<description><![CDATA[As the owner of a hosting company, I have made several decisions regarding which server to use, what kind of control panel should I provide, should I add features to my hosting, how many resources should I include, etc.  In my opinion, one of the most important decisions in hosting is choosing how your users [...]]]></description>
			<content:encoded><![CDATA[<p>As the owner of a hosting company, I have made several decisions regarding which server to use, what kind of control panel should I provide, should I add features to my hosting, how many resources should I include, etc.  In my opinion, one of the most important decisions in hosting is choosing how your users will use the service, meaning what control panel should I use?  There are many options for Linux including, Plesk, LXAdmin, and the most popular: CPanel.</p>
<p><strong>CPanel </strong>is the control panel that I choose to use for Matthouse hosting accounts, but why did I choose CPanel, what are its <strong>advantages and disadvantages</strong>?</p>
<p>I suppose I should first begin with a small <strong>description of what CPanel is</strong>.  CPanel allows the hosting client to modify all aspects of their site from an easy to use web-based interface such as FTP accounts, Email accounts, statistics, subdomains, additional domains to host, etc.  CPanel makes it very easy for the hosting company to give the client total control of their website without the requirement of providing full server access.</p>
<p>Here are the advantages of using CPanel:</p>
<ol>
<li>Its very easy to install, just install Linux and run the installation script, it will configure most of your server automatically</li>
<li>Cpanel provides a very easy visual interface where you can manage your server.  There are several panels that are meant for administrators, clients, and even email users.  There are also very easy to follow tutorials posted on CPanel&#8217;s website for those users who may not know where to start</li>
<li>Cpanel automates most of the hosting experience which reduces stress on the hosting company</li>
</ol>
<p>So, what are the disadvantages of hosting with CPanel?</p>
<ol>
<li>I personally believe that <strong>CPanel is meant for websites that are small to medium. </strong>CPanel itself is a resource hog and requires at least 256MB of ram on the server to run, and this amount probably won&#8217;t even run a website getting 200 hits a day without running out of memory or running into swap space on the server.    Most servers will have much more RAM than this, but a base install should not require more than 50 to 60MB of ram.</li>
<li>On a default install, CPanel usually is optimized for a dedicated server with 4 to 16GB of RAM.  Even the VPS Optimized version of <strong>CPanel requires additional configuration</strong> to keep CPanel within check.  If you don&#8217;t do initial configuration in Apache, etc, you may run into memory errors easily since Apache will start up 20 to 30 processes at 1 to 6MB a piece.  In addition, most of the Apache configuration is default and many modules are missing such as Source Gaurdian which will protect PHP code from hurting your server.  In addition, CPanel doesn&#8217;t secure SSH or FTP, you you should still install a firewall and tighten SSH security.</li>
<li><strong> CPanel is software which contains vulnerabilities</strong> just like any other software.    Cpanel updates run nightly, however what happens if someone discovers a security risk and decides to attack your server before the updates are pushed to your server covering the vulnerability?  To come back to my past disadvantage of Cpanel is meant for small to medium sites, I believe this aids to the arguement that <strong>big sites are more likely to be hacked than smaller sites</strong>.</li>
<li><strong>CPanel costs money to license.</strong> This is rarely a factor to most big sites and companies because they have that kind of money to spend for something easy to use, however CPanel licenses are not cheap.  This really could be neither and advantage of disadvantage, but its worth sticking on my list of points to consider.</li>
</ol>
<p>So when would I recommend a CPanel installation?  Thats simple, I&#8217;d recommend it for hosting companies that host many sites on a single server.  It reduces stress on the hosting company, and generally these servers have plentiful resources to handle CPanel in its entirety.  Also sites that are generally on shared CPanel hosting are not big enough to have a good probability of being hacked.</p>
<p>When would I not recommend installing CPanel.  I would personally say never install CPanel on a large site that gets over 5000 unique hits a day or more.  CPanel may make administering the site easier, however most sites that are this big bring in a lot of revenue  and paying for CPanel could be just slightly cheaper than hiring an experienced server administrator or a friend to run the server without CPanel.  Installing the core components and configuring them manually will also ensure that you have minimal code that can be hacked (Yes, web servers are software).  I&#8217;ve always been taught that the less code you use, the less likely there will be problems with it.</p>
<p>Thats all the time I have.  I might follow up on this depending on how many comments I receive.</p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2009/02/advantages-disadvantages-of-using-whm-cpanel-mainly-on-major-sites/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Server Move Complete!</title>
		<link>http://famousphil.com/blog/2009/01/server-move-complete/</link>
		<comments>http://famousphil.com/blog/2009/01/server-move-complete/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 22:10:09 +0000</pubDate>
		<dc:creator>Famous Phil</dc:creator>
				<category><![CDATA[Hosting / Server Administration]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Server Hosting]]></category>

		<guid isPermaLink="false">http://famousphil.com/blog/?p=13</guid>
		<description><![CDATA[Phil has moved his hosted websites successfully.  Phil also introduces a new website idea that will be taking off in a few weeks called http://adminreference.com]]></description>
			<content:encoded><![CDATA[<p>As expected, I completed moving all of the websites hosted on the former mthsweb1 (Matthouse Web Server 1) server over to the new mthsweb4 server.  I haven&#8217;t heard any complaints so far about the new server so far and don&#8217;t expect to hear of any problems.  Tonight I will be doing some testing on the old matthouse web 1 server before it expires later in February.  I hope to learn some new knowledge from my testing later tonight regarding apache optimization.</p>
<p>Earlier today, I helped a friend in the hosting business move a massive website (<a href="http://clevelandleader.com" target="_blank">http://clevelandleader.com</a>) from his server to a virtual server that will just host that website.  This website is ranked ~76,000 on the alexa scale which means that it gets an insane amount of traffic.  My best guess would be 300 to 1500 loads per second.  The site itself has a huge mysql database that is over 2GB and the sql move alone almost crashed a dedicated server with a quadcore processor (it did have a lot of other websites on it though).  Regardless, after the move, my friend didn&#8217;t realize that a default whm (cpanel, inc) installation doesn&#8217;t optimize the server nearly enough for a large website like this.  Heck, I don&#8217;t even know if whm was made for such a large website.  I did optimize the server and compile apache correctly just to handle the needs of clevelandleader.com.  I also did a lot to prevent apache from crashing with the high load.</p>
<p>Traditionally, with such a large website such as cleveland leader, the web server hosting the site would only run a web server, no overhead like cpanel.  I feel that cpanel has made the hosting process much easier, but I just don&#8217;t think it was made to handle such a large website.   Also, the fact that cpanel uses the root password directly means that if there is a security vulnerability and the user obtains that root password through hacking or whatever, the server could be compromised not only from cpanel&#8217;s whm but also from the terminal through ssh (or a rare occasion of console access, meaning sitting in front of the server physically).  This could present a major problem.  Most smart hosting companies use cpanel&#8217;s wheel group to give su access to certain cpanel uesrs that can then login to the terminal via ssh and then su root with the root password to gain root.  This provides a 2 password layer and adds an additional layer of security to the server.</p>
<p>Another pitfall that large websites face is the need for a dedicated mysql server, that is if mysql can even handle the load.  Mysql was made for small to medium sites and it was made for maybe 100 to 200 queries per second, but much more than that and it undergoes a massive strain.  Many large websites find themselves moving to more powerful database servers such as Microsoft SQL or Oracle which are much more powerful solutions that were made for high loads.</p>
<p>So why am I even talking about this!  I felt that this would be the best way to introduce a new idea that I&#8217;m going to begin working on within the next couple of weeks.  I have purchased the domain (<a href="http://adminreference.com">http://adminreference.com</a>) and will begin a forum where users can share their administration experience and knowledge to the world.  I am a seasoned Windows administrator and a somewhat experienced Linux admin.  I find myself knowledgable about both server operating systems and I post tutorials on multiple websites that don&#8217;t really aim for administration concepts.  I also hope that some day this can help me when I am stuck on a massive problem.</p>
<p>I encourage you to stay informed as I begin this new journey.  I will likely be ready to release the site sometime in the next couple of weeks.  I am not sure how to market such a website, however I&#8217;m sure as people begin coming, someone will have knowledge about that as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://famousphil.com/blog/2009/01/server-move-complete/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: famousphil.com @ 2012-02-10 06:00:52 by W3 Total Cache -->
