<?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>Refreshingly Blue &#187; Sys Admin</title>
	<atom:link href="http://www.refreshinglyblue.com/category/sys-admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.refreshinglyblue.com</link>
	<description>Notes by Lee Blue</description>
	<lastBuildDate>Sun, 29 Aug 2010 03:50:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Git Archive Like SVN Export But Better</title>
		<link>http://www.refreshinglyblue.com/2010/03/05/git-archive-like-svn-export-but-better/</link>
		<comments>http://www.refreshinglyblue.com/2010/03/05/git-archive-like-svn-export-but-better/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 16:16:58 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.refreshinglyblue.com/?p=206</guid>
		<description><![CDATA[If you are switching from Subversion to Git and want to know the best way to export your code similar to svn export then here is a great command to know about.
git archive -o ~/Desktop/project.zip HEAD
That will extract your most recent stuff in your current branch, zip it up, and drop it on your desktop. [...]]]></description>
			<content:encoded><![CDATA[<p>If you are switching from Subversion to Git and want to know the best way to export your code similar to svn export then here is a great command to know about.</p>
<pre>git archive -o ~/Desktop/project.zip HEAD</pre>
<p>That will extract your most recent stuff in your current branch, zip it up, and drop it on your desktop. We do a lot of WordPress plugin development and with this single command we can get our plugin code ready for installation extremely quickly. Here is more information about <a href="http://ftp.sunet.se/pub/Linux/kernel.org/software/scm/git/docs/git-archive.html">git archive</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refreshinglyblue.com/2010/03/05/git-archive-like-svn-export-but-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup Subversion with cPanel and Apache</title>
		<link>http://www.refreshinglyblue.com/2010/01/21/setup-subversion-with-cpanel-and-apache/</link>
		<comments>http://www.refreshinglyblue.com/2010/01/21/setup-subversion-with-cpanel-and-apache/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 16:58:04 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Everyday Tips]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://www.refreshinglyblue.com/?p=187</guid>
		<description><![CDATA[This is a  summary of how to set up a new svn repository that you can access through apache when your server is configured with cPanel. This is not a tutorial on installing cPanel and Subversion.  The assumption is that you already have subversion installed on your cPanel managed server.

1) Set up an account where [...]]]></description>
			<content:encoded><![CDATA[<p>This is a  summary of how to set up a new svn repository that you can access through apache when your server is configured with cPanel. This is not a tutorial on installing cPanel and Subversion.  The assumption is that you already have subversion installed on your cPanel managed server.</p>
<p><span id="more-187"></span></p>
<p>1) Set up an account where you want to host your subversion repositories, perhaps use a domain like subversion.mywebsite.com</p>
<p>2) SSH into your new account and create a directory that will contain all your subversion repositories. For example, you might have a path like /home/&lt;username&gt;/subversion where &lt;username&gt; is the username you used to log into your account.</p>
<p>3) Set up a subversion repository by changing directories into your subversion directory you just created and issuing the following commands.</p>
<p>cd /home/username/subversion<br />
svnadmin create myproject<br />
sudo chgrp -R nobody myproject<br />
sudo chmod -R g+w myproject</p>
<p>Note that we changed the group to &#8220;nobody&#8221; which is the user that apache runs as. You need to do this so that when you access the repository through apache, apache has permission to write files to your repository. By default, cPanel runs apache with the user &#8220;nobody&#8221; but not always. So, just be sure that you set the correct group name for your repository.</p>
<p>4) Next you need to tell apache about your new subversion repository. To do that, log into your cPanel WHM account and go to <strong>Service Configuration -&gt; Apache Configuration -&gt; Include Editor</strong> and edit the Pre VirtualHost Include file. Enter in a block like this:</p>
<p>&lt;Location /path/to/repository&gt;<br />
DAV svn<br />
SVNPath /absolute/path/to/repository<br />
AuthType Basic<br />
AuthName “Subversion Repository”<br />
AuthUserFile /absolute/path/to/password/file.txt<br />
Require valid-user<br />
&lt;/Location&gt;</p>
<p>The first path in the block above is /path/to/repository in the Location tag. This is the path you want to use when accessing the repository through Apache.  For example, if you wanted to access your repository at http://subversion.mywebsite.com/myproject then you would simply write /myproject as the path in the Location tag.</p>
<p>The second path is the SVNPath which is the absolute path to your subversion repository. So in our example you would use /home/username/subversion/myproject</p>
<p>The third path is the absolute path to you htpasswd file. We haven’t created this yet but we will in the next step. You may choose to put this file in any directory you wish perhaps at /home/username/svnpasswords.txt This is the file that will contain the usernames and passwords for accessing your Subversion repository through Apache.</p>
<p>When you are all finished click the button to restart Apache.</p>
<p>5) Now we need to create the htpasswd file. Change directories into the directory where you want to store your password file and issue this command:</p>
<p>htpasswd -c svnpasswords.txt</p>
<p>If you want more than one user, run the same command again but leave off the -c. If you don’t leave off the -c then a new password file will be created and all your previous entries will be lost.</p>
<p>6) Finally, you will want to create the normal trunk, tags, and branches folders in your repository. You can issue these commands from your development machine if you like since you are now able to access your repository through apache.</p>
<p>svn mkdir http://subversion.mywebsite.com/myproject/trunk -m &#8220;creating trunk&#8221;<br />
svn mkdir http://subversion.mywebsite.com/myproject/tags -m &#8220;creating tags&#8221;<br />
svn mkdir http://subversion.mywebsite.com/myproject/branches -m &#8220;creating branches&#8221;</p>
<p>Now you have your repository all set up and ready to receive your source code. So, normally speaking you would checkout out your trunk, add some files, and commit your initial set of files to the repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refreshinglyblue.com/2010/01/21/setup-subversion-with-cpanel-and-apache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Tar A Directory</title>
		<link>http://www.refreshinglyblue.com/2008/02/23/how-to-tar-a-directory/</link>
		<comments>http://www.refreshinglyblue.com/2008/02/23/how-to-tar-a-directory/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 21:25:04 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Everyday Tips]]></category>
		<category><![CDATA[Sys Admin]]></category>

		<guid isPermaLink="false">http://www.refreshinglyblue.com/2008/02/23/how-to-tar-a-directory/</guid>
		<description><![CDATA[I constantly forget how to tar a directory. I think the ln command and the tar command have their parameters in different orders and I can never seem to remember which parameter is the dir you are archiving and which one is the name for the archive. So here it is:
tar -czf archive.tgz dirName
]]></description>
			<content:encoded><![CDATA[<p>I constantly forget how to tar a directory. I think the <em>ln</em> command and the <em>tar</em> command have their parameters in different orders and I can never seem to remember which parameter is the dir you are archiving and which one is the name for the archive. So here it is:</p>
<pre>tar -czf archive.tgz dirName</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.refreshinglyblue.com/2008/02/23/how-to-tar-a-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails + SSL + ISPConfig + Apache 2.0 + Mongrel</title>
		<link>http://www.refreshinglyblue.com/2007/06/13/ruby-on-rails-ssl-ispconfig-apache-mongrel/</link>
		<comments>http://www.refreshinglyblue.com/2007/06/13/ruby-on-rails-ssl-ispconfig-apache-mongrel/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 03:43:57 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://refreshinglyblue.com/?p=8</guid>
		<description><![CDATA[If you are using ISPConfig to manage the virtual hosts on your web server, you will notice that there is no way to separate SSL vs non-SSL Apache directives using the standard web interface. This is a problem if you are writing Ruby on Rails applications and proxying requests through Apache to a Mongrel cluster [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using ISPConfig to manage the virtual hosts on your web server, you will notice that there is no way to separate SSL vs non-SSL Apache directives using the standard web interface. This is a problem if you are writing Ruby on Rails applications and proxying requests through Apache to a Mongrel cluster because Mongrel won&#8217;t know what type of requests it is receiving. Being behind the proxy, Mongrel doesn&#8217;t know if the original requests are coming via HTTP or HTTPS. The solution is to add RequestHeader set X_FORWARDED_PROTO &#8216;https&#8217; as a line in your Apache virtual host configuration for the SSL virtual host. I will tell you how to get ISPConfig to handle that for you. I will also show how to get GoDaddy.com ssl certificates working and how our Apache 2.0 randomized proxy balancer works.</p>
<p><span id="more-8"></span></p>
<p>We are running Apache 2.0 and proxying to a Mongrel cluster for our latest e-commerce website <a href="http://www.quietheadphones.com">QuietHeadphones.com</a> which is scheduled to be launched at the end of June. Being an e-commerce site we needed to put the checkout functionality behind SSL. Since Apache is handling both the HTTPS/SSLfunctionality as well as the standard HTTP requests and proxying everything to the Mongrel cluster, the Mongrel cluster doesn&#8217;t know which requests are HTTPS and which are HTTP. To tell Rails which requests are HTTPS requests you can set up an environment variable in the Apache virtual host configuration in the httpd.conf file. The environement variable is: </p>
<p class="code">RequestHeader set X_FORWARDED_PROTO &#8216;https&#8217;</p>
<p>In Rails, request.rb checks for that variable and pleasantly handles everything else for you.</p>
<p>Now if you are using ISPConfig to manage the virtual hosts on your web server, you will notice that there is no way to separate SSL vs non-SSL Apache directives using the web interface. Since most of our sites are Ruby on Rails sites and since the RequestHeader variable doesn&#8217;t hurt anything if you aren&#8217;t using rails, I revised the source code of ISPConfig to always include the RequestHeader set X_FORWARDED_PROTO line in all of the SSL virtual host configurations. That way, anytime you set up a site in ISPConfig and select the SSL option, ISPConfig faithfully inserts the RequestHeader line so that Mongrel knows what sort of requests it is getting.</p>
<p>To make this revision to ISPConfig, open up config.lib.php then edit the SSL-Web section at approximately line 1521 by adding RequestHeader set X_FORWARDED_PROTO &#8216;https&#8217;</p>
<p class="code">file: /root/ispconfig/scripts/lib/config.lib.php<br />
<br />
RequestHeader set X_FORWARDED_PROTO &#8216;https&#8217;
</p>
<p>Once that is in place, all HTTPS requests will have that request header variable set and regular HTTP requests will not. Then you can use the standard web interface to configure the rest of the Apache directives for your Ruby on Rails application and the Mongrel cluster. Here&#8217;s an example of what the Apache Directives text box may look like in ISPConfig.</p>
<p class="code">
&lt;Proxy *&gt;<br />
  Order allow,deny<br />
  Allow from all<br />
&lt;/Proxy&gt;<br />
<br />
ProxyRequests Off<br />
ProxyPassReverse / http://www.mydomain.com:9001/<br />
ProxyPassReverse / http://www.mydomain.com:9002/<br />
ProxyPassReverse / http://www.mydomain.com:9003/<br />
ProxyPreserveHost On<br />
RewriteEngine On<br />
RewriteMap  servers rnd:/var/www/webX/rails/map.txt<br />
RewriteRule ^/(images|stylesheets|javascripts)/?(.*) $0 [L]<br />
RewriteRule ^/(.*)$ http://www.mydomain.com:${servers:ports}/$1 [P,L]<br />
Alias /images /var/www/webX/web/images<br />
Alias /stylesheets /var/www/webX/web/stylesheets<br />
Alias /javascripts /var/www/webX/web/javascripts<br />
SSLCertificateChainFile /var/www/webX/ssl/gd_intermediate_bundle.crt
</p>
<p>There are a couple things to note in this example. At the time of this writing, we are using Apache 2.0 and, therefore, don&#8217;t have access to the mod_proxy_balancer that many people are enjoying with Apache 2.2. Nevertheless, we wanted to run a Mongrel cluster so we are using a randomized proxy balancer by taking advantage of the RewriteMap feature of Apache 2.0. We created a text file that contains the port numbers that each of our Mongrel instances are using separated by pipes as follows:</p>
<p class="code">file: map.txt<br />
<br />
ports 9001|9002|9003
</p>
<p>Then on each request, Apache randomly selects on of the three ports from the map.txt file and rewrites the request for one of our mongrel instances.</p>
<p class="code">
RewriteRule ^/(.*)$ http://www.mydomain.com:${servers:ports}/$1 [P,L]
</p>
<p>Lastly, if you buy an SSL certificate from godaddy.com, you will need to add the SSLCertificateChainFile directive to your Apache configuration. Otherwise, most &#8211; perhaps all &#8211; browsers will complain about the ssl certificate not being trusted. Once you know about that, it&#8217;s an easy adjustment to make. Simply give Apache the path to the gd_intermediate_bundle.crt that you will get when you buy your ssl certificate at GoDaddy.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refreshinglyblue.com/2007/06/13/ruby-on-rails-ssl-ispconfig-apache-mongrel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTP Login Delay With Proftpd &#8211; Ubuntu Perfect Setup</title>
		<link>http://www.refreshinglyblue.com/2007/06/11/ftp-login-delay-with-proftpd-ubuntu-perfect-setup/</link>
		<comments>http://www.refreshinglyblue.com/2007/06/11/ftp-login-delay-with-proftpd-ubuntu-perfect-setup/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 03:19:43 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://refreshinglyblue.com/?p=7</guid>
		<description><![CDATA[I manage serveral servers and &#8211; for the most part &#8211; they are all set up using the Perfect Setup for Ubuntu. Overall the setup is great, but I have been noticing a very annoying delay when trying to log in via FTP. Everything works, but when I initially connect, 5 &#8211; 10 seconds pass [...]]]></description>
			<content:encoded><![CDATA[<p>I manage serveral servers and &#8211; for the most part &#8211; they are all set up using the <a href="http://www.howtoforge.org/forums/showthread.php?t=6447">Perfect Setup for Ubuntu</a>. Overall the setup is great, but I have been noticing a very annoying delay when trying to log in via FTP. Everything works, but when I initially connect, 5 &#8211; 10 seconds pass by before I&#8217;m prompted for my login credentials. After many hours of pain and sadness, I finally discovered the solution.</p>
<p><span id="more-7"></span></p>
<p><a href="http://www.howtoforge.com/perfect_setup_ubuntu_6.10_p6">Page six</a> of the Perfect Setup tutorial says that you should add the following lines to your proftpd.conf file.</p>
<p class="code">vi /etc/proftpd/proftpd.conf<br />
&#8230;<br />
DefaultRoot ~<br />
IdentLookups off<br />
ServerIdent on &#8220;FTP Server ready.&#8221;<br />
&#8230;
</p>
<p>I found that if I include those lines inside of &lt;Global&gt;&#8230;&lt;/Global&gt; tags the delay goes away and I am instantly logged into the server. So, instead of the above format, add those lines inside the Global tags like this.</p>
<p class="code">vi /etc/proftpd/proftpd.conf<br />
&#8230;<br />
&lt;Global&gt;<br />
DefaultRoot ~<br />
IdentLookups off<br />
ServerIdent on &#8220;FTP Server ready.&#8221;<br />
&lt;/Global&gt;<br />
&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refreshinglyblue.com/2007/06/11/ftp-login-delay-with-proftpd-ubuntu-perfect-setup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Long Delay Before SSH Authentication</title>
		<link>http://www.refreshinglyblue.com/2007/05/18/long-delay-before-ssh-authentication/</link>
		<comments>http://www.refreshinglyblue.com/2007/05/18/long-delay-before-ssh-authentication/#comments</comments>
		<pubDate>Sat, 19 May 2007 03:06:23 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://refreshinglyblue.com/?p=5</guid>
		<description><![CDATA[If you are experiencing a long, annoying delay when attempting to connect to a remote server via SSH &#8211; especially if you have recently noticed this problem after installing/upgrading Ubuntu Feisty &#8211; try commenting out the &#8220;GSSAPIAuthentication yes&#8221; line in your /etc/ssh/ssh_config file:


File: /etc/ssh/ssh_config
&#8230;
&#160;&#160;HashKnownHosts yes
#  GSSAPIAuthentication yes
&#160;&#160;GSSAPIDelegateCredentials no
&#8230;
GSSAPIAuthentication specifies whether user authentication based on [...]]]></description>
			<content:encoded><![CDATA[<p>If you are experiencing a long, annoying delay when attempting to connect to a remote server via SSH &ndash; especially if you have recently noticed this problem after installing/upgrading Ubuntu Feisty &ndash; try commenting out the &#8220;GSSAPIAuthentication yes&#8221; line in your /etc/ssh/ssh_config file:</p>
<p><span id="more-5"></span></p>
<p class="code">
File: /etc/ssh/ssh_config<br />
&#8230;<br />
&nbsp;&nbsp;HashKnownHosts yes<br />
#  GSSAPIAuthentication yes<br />
&nbsp;&nbsp;GSSAPIDelegateCredentials no<br />
&#8230;</p>
<p>GSSAPIAuthentication specifies whether user authentication based on GSSAPI is allowed. Connections with GSSAPIAuthentication option enabled on non-kerberos SSH servers are very slow. If you run ssh in verbose mode you may get a &#8220;Miscellaneous failure&#8221; error message.</p>
<p class="code">
ssh -v -l <username> example.com<br />
&#8230;<br />
debug1: Miscellaneous failure<br />
No credentials cache found<br />
&#8230;
</p>
<p>After disabling GSSAPIAuthentication, you probably won&#8217;t have to wait as long to get your login in prompt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refreshinglyblue.com/2007/05/18/long-delay-before-ssh-authentication/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mail Not Delivered To Hotmail/MSN Accounts</title>
		<link>http://www.refreshinglyblue.com/2007/05/08/mail-not-delivered-to-hotmail-msn-accounts/</link>
		<comments>http://www.refreshinglyblue.com/2007/05/08/mail-not-delivered-to-hotmail-msn-accounts/#comments</comments>
		<pubDate>Wed, 09 May 2007 00:47:55 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://refreshinglyblue.com/?p=4</guid>
		<description><![CDATA[If you have a VPS or your own dedicated server and you can&#8217;t send mail to Hotmail or MSN email accounts, the good news is that the solution is easy. I manage a few Postfix mail servers and I was getting lines like this in my /var/log/mail.log file.

May  8 05:46:07 hostname postfix/smtp: 23E507C950: to=, [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a <span class="caps">VPS</span> or your own dedicated server and you can&#8217;t send mail to Hotmail or <span class="caps">MSN</span> email accounts, the good news is that the solution is easy. I manage a few Postfix mail servers and I was getting lines like this in my /var/log/mail.log file.</p>
<p><span id="more-4"></span></p>
<p class="code">May  8 05:46:07 hostname postfix/smtp: 23E507C950: to=<username@hotmail.com>, relay=mx1.hotmail.com[65.54.244.136]:25, delay=0.6, delays=0.26/0.01/0.15/0.18, dsn=2.0.0, status=sent (250  <20070508054607.23E507C950@hostname.com> Queued mail for delivery)</p>
<p>Mail was successfully leaving my server and Hotmail was reporting back that the mail was successfully sent yet the mail was not ever getting delivered to my hotmail inbox. The solution is to make sure you have a valid <span class="caps">SPF</span> record for your domain. Microsoft has an online wizard to help you <a href="http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/">create the <span class="caps">SPF</span> record.</a></p>
<p>When you are creating the record, make sure not to include a &#8220;ptr&#8221; lookup. I got this email from Microsoft when trying to figure all this out.</p>
<p class="code">We reviewed your <span class="caps">SPF</span> record and note that it includes the &#8220;ptr&#8221; or reverse <span class="caps">DNS</span> lookup mechanism.  The specification for <span class="caps">SPF</span> records (RFC 4408) discourages use of &#8220;ptr&#8221; for performance and reliability reasons.  This is especially important for Windows Live Mail, Hotmail and other large ISPs as a result of the very high volume of mail we receive each day.   We highly recommend you remove the &#8220;ptr&#8221; mechanism from your <span class="caps">SPF</span> record and, if necessary, replace it with other <span class="caps">SPF</span> mechanisms that do not require a reverse <span class="caps">DNS</span> lookup, such as &#8220;a&#8221;, &#8220;mx&#8221;, &#8220;ip4&#8221; and &#8220;include.&#8221;  This will help ensure that Sender ID validation is performed as accurately as possible, maximizing your email deliverability while protecting your domain from spoofing.</p>
<p>Finally, you need to create a <span class="caps">TXT DNS</span> entry. Allow about 24 hours or so, and Hotmail and <span class="caps">MSN</span> will start accepting your mail. Note, however, they may be sending it to your Junk Mail folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refreshinglyblue.com/2007/05/08/mail-not-delivered-to-hotmail-msn-accounts/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
