<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss version="2.0"><channel><title>FreeBSD Blog</title><link>http://www.freebsdblog.org</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/freebsdadmin" /><description>Focused on dedicated server administration</description><language>en</language><lastBuildDate>Thu, 17 May 2012 16:55:31 PDT</lastBuildDate><generator>http://wordpress.org/?v=3.2.1</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/freebsdadmin" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="freebsdadmin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">freebsdadmin</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bloglines.com/sub/http://feeds.feedburner.com/freebsdadmin" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.yourminis.com/subscribe.aspx?u=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.yourminis.com/images/addtoyourminisbadge.gif">Subscribe with Yourminis.com</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://hub.netomat.net/account/account.autoSubscribe.jspa?urls=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.netomat.net/blogger/images/icon_netomat_feedbutton.gif">Subscribe with netomat Hub</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Ffreebsdadmin" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item><title>AT&amp;T Email</title><link>http://www.freebsdblog.org/354/att-email/</link><category>Email</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Thu, 17 May 2012 06:46:37 PDT</pubDate><guid isPermaLink="false">http://www.freebsdblog.org/?p=354</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><em><strong>Update:</strong> I resubmitted a unblock request with this post, AT&#038;T has confirmed that they will remove the block. It was quick! Thanks!</em></p>
<p>AT&#038;T blocked all emails sent from one of my servers, which I&#8217;m sure was a mistake, because the server hosts several forums and only sends notification emails to registered members, e.g., when a member asked a question on accessforums.net, if someone replied to his question, the forum will send a notification email. To be on the safe side, I have never sent out a single newsletter from these forums.</p>
<p>According to email server log, I submitted unblock requests <a href="http://rbl.att.net/block_inquiry.html">here</a> two times in the last two months, but no actions, no response whatever, just like a black hole. I&#8217;m sure they didn&#8217;t look into the problem at all, because anyone who read the emails or checked my server will know it&#8217;s a clean server.</p>
<p>Can anyone bring this post to AT&#038;T admin&#8217;s attention? Your simple block has brought lots of inconvenience to our forum members (your customers).</p>
<blockquote><p>(host gateway-f2.isp.att.net[207.115.11.16] refused to talk to me: 550-72.51.41.55 blocked by ldap:ou=rblmx,dc=att,dc=net 550 Error &#8211; Blocked for abuse. See http://att.net/blocks)<br />
xxx@bellsouth.net</p></blockquote>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/111/email-blocked-by-bellsouth/' rel='bookmark' title='Permanent Link: Email Blocked by BellSouth'>Email Blocked by BellSouth</a></li>
<li><a href='http://www.freebsdblog.org/129/email-isp/' rel='bookmark' title='Permanent Link: Email ISP'>Email ISP</a></li>
<li><a href='http://www.freebsdblog.org/213/how-to-stop-a-cron-job-or-email-notification/' rel='bookmark' title='Permanent Link: How to Stop a Cron Job or Email Notification'>How to Stop a Cron Job or Email Notification</a></li>
</ol></p>]]></content:encoded><description>Update: I resubmitted a unblock request with this post, AT&amp;#038;T has confirmed that they will remove the block. It was quick! Thanks! AT&amp;#038;T blocked all emails sent from one of my servers, which I&amp;#8217;m sure was a mistake, because the server hosts several forums and only sends notification emails to registered members, e.g., when a [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/354/att-email/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>No custom kernel via ssh</title><link>http://www.freebsdblog.org/348/no-custom-kernel-via-ssh/</link><category>FreeBSD General</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Sun, 21 Aug 2011 08:35:18 PDT</pubDate><guid isPermaLink="false">http://www.freebsdblog.org/?p=348</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Tried to build a custom kernel on a canceled server, I couldn&#8217;t connect to it once the build started, I also couldn&#8217;t connect to it after the build finished and server rebooted. I don&#8217;t think I will build custom kernels ever again on remote servers.</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/24/freebsd-and-linux/' rel='bookmark' title='Permanent Link: FreeBSD and Linux'>FreeBSD and Linux</a></li>
</ol></p>]]></content:encoded><description>Tried to build a custom kernel on a canceled server, I couldn&amp;#8217;t connect to it once the build started, I also couldn&amp;#8217;t connect to it after the build finished and server rebooted. I don&amp;#8217;t think I will build custom kernels ever again on remote servers. Related posts:FreeBSD and Linux</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/348/no-custom-kernel-via-ssh/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>DoS Attacks</title><link>http://www.freebsdblog.org/347/dos-attacks/</link><category>FreeBSD General</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Sun, 21 Aug 2011 08:17:39 PDT</pubDate><guid isPermaLink="false">http://www.freebsdblog.org/?p=347</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>If your server was down due to insufficient swap space, usually needed by large amount of MySQL connections, it&#8217;s a sign of DoS attacks. My servers started to get attacks earlier this year, and they were getting increasingly frequent. Here are some simple practices I have employed, they have been proved to be effective for my server in the last few months.<br />
<span id="more-347"></span></p>
<p>1. Lower maximum mysql connections to make sure that the server will be up on attacks. The default value of <strong>max_connections</strong> is 150 which might be too high for servers that host database-heavy websites. Take my server (2GB ram) as an example, it hosts active vbulletin forums and couldn&#8217;t handle 150 connections, even light attacks can bring the server down easily. The server survived attacks after I lowered max_connections to 120, but it was very slow since it used lots of swap space. After I changed it to 100, the server responded fast while being attacked. </p>
<p>100 connections should be enough for 20~30K daily visits. The maximum connections mysql has used can be checked with:<br />
<code></p>
<p></code></p>
<blockquote><p># mysqladmin -u root -p extended-status | grep Max_used_connections<br />
| Max_used_connections                     | 57          |</p></blockquote>
<p>or </p>
<blockquote><p>mysql> show status where variable_name like &#8216;max_used_connections&#8217;;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<br />
| Variable_name        | Value |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+<br />
| Max_used_connections | 57    |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;-+</p></blockquote>
<p><code></p>
<p></code><br />
2. When mysql reaches its connection limit, the whole server will be affected, this can be avoided with user-level connection throttle. mysql.user table has a field <strong>max_connections</strong>, the default value is 0 which should be changed according to each mysql user&#8217;s usage. Many attacks targeted a mediawiki application on my server, actually this wiki has less than 100 visits, I don&#8217;t care about it at all, after I changed its max_connections to 5, many attacks no longer affect the server.</p>
<p>3. Apache can handle a lot more connections than mysql, but it can reach its limit. I used to set a very high value, but it&#8217;s not helpful to detect and fight attacks. I used the following settings on my 4GB-ram server. KeepAliveTimeout can be lower, I used 2 seconds for a while which also worked well. Since my server has enough memory, I used a higher value for better performance (possibly).<br />
<code></p>
<p></code></p>
<blockquote><p>TimeOut 60<br />
MaxClients 180<br />
KeepAliveTimeout 5</p></blockquote>
<p><code></p>
<p></code><br />
4. Limit Apache connections per IP. Most attacks on my server were from only several IPs, Apache mod <strong>limitipconn</strong> can limit each IP&#8217;s connections, it can be found in ports www/mod_limitipconn (for Apache 1.3.x) and www/mod_limitipconn2 (for Apache 2). I wasn&#8217;t able to see the effect with my limited tests even I set MaxConnPerIP to 3, Apache is too robust.<br />
<code></p>
<p></code></p>
<blockquote><p>LoadModule limitipconn_module libexec/apache22/mod_limitipconn.so<br />
&lt;IfModule mod_limitipconn.c&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;location /&gt;<br />
&nbsp;&nbsp;&nbsp; MaxConnPerIP 5<br />
&nbsp;&nbsp;&nbsp; NoIPLimit images/*<br />
&nbsp;&nbsp;&nbsp; &lt;/location&gt;<br />
&lt;/IfModule&gt;</p></blockquote>
<p><code></p>
<p></code><br />
5. Block malicious IPs with firewall. It&#8217;s hard to believe but, a certain IP (should be from a compromised server) participated in almost every attack. Here is a very good <a href="http://www.cyberciti.biz/faq/opebsd-pf-firewall-block-subnets-ip-address/" target="_blank">pf tutorial</a>, follow it strictly and you will be safe.</p>
<p>The above protections should be enough for random attacks.</p>


<p>No related posts.</p>]]></content:encoded><description>If your server was down due to insufficient swap space, usually needed by large amount of MySQL connections, it&amp;#8217;s a sign of DoS attacks. My servers started to get attacks earlier this year, and they were getting increasingly frequent. Here are some simple practices I have employed, they have been proved to be effective for [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/347/dos-attacks/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>Backup Script</title><link>http://www.freebsdblog.org/345/backup-script/</link><category>Command &amp; Utility</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Sat, 20 Aug 2011 10:32:23 PDT</pubDate><guid isPermaLink="false">http://www.freebsdblog.org/?p=345</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><strong>My simple backup script</strong><br />
It runs daily with cron job.</p>
<blockquote><p>
#!/bin/sh</p>
<p># directory to backup<br />
BACKUP_DIR=&#8217;/home/&#8217;</p>
<p># directory to store backup files<br />
DEST_DIR=&#8217;/backup/&#8217;</p>
<p># number of days to store backup files<br />
MAX_DAYS=30</p>
<p># base backup file name<br />
BASE_FILENAME=&#8217;home&#8217;</p>
<p># remove files that are 30 or more days old.<br />
find $DEST_DIR -mtime +$MAX_DAYS -maxdepth 1 -name &#8216;*.tgz&#8217; -exec /bin/rm -f &#8216;{}&#8217; +</p>
<p># generate backup file name with date stamp, no hour/minute info for easier remote backup.<br />
destfilename=$BASE_FILENAME`date &#8220;+%Y%m%d&#8221;`.tgz</p>
<p>cd $BACKUP_DIR<br />
tar czf $DEST_DIR$destfilename . &#038;
</p></blockquote>
<p><span id="more-345"></span><br />
<code></p>
<p></code><br />
<strong>Cross-server backup with scp</strong><br />
This script uses the same path info and runs later than the above one to make sure backup files have been generated, hence no need to check file existence. It runs weekly with cron job.</p>
<blockquote><p>#!/bin/sh</p>
<p>BACKUP_DIR=&#8217;/backup/&#8217;<br />
BASE_FILENAME=&#8217;home&#8217;<br />
BASE_FILENAME_REMOTE=&#8217;remotehome&#8217;</p>
<p># generate backup file name, the same with the backup script<br />
local_filename=$BACKUP_DIR$BASE_FILENAME`date &#8220;+%Y%m%d&#8221;`.tgz<br />
remote_filename=$BACKUP_DIR$BASE_FILENAME_REMOTE`date &#8220;+%Y%m%d&#8221;`.tgz</p>
<p># copy remote backup file to local server<br />
scp -i /root/.ssh/id_rsa -P 1234 loginame@hostname:$remote_filename $BACKUP_DIR</p>
<p># copy local backup file to remote server<br />
scp -i /root/.ssh/id_rsa -P 1234 $local_filename loginame@hostname:$BACKUP_DIR
</p></blockquote>
<p><code></p>
<p></code><br />
<strong>Cron job</strong></p>
<blockquote><p>10 4 * * * /root/backup.sh<br />
40 4 * * 0 /root/remote_backup.sh</p></blockquote>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/6/cron-job/' rel='bookmark' title='Permanent Link: Cron Job'>Cron Job</a></li>
<li><a href='http://www.freebsdblog.org/338/mysql-backup-and-restore/' rel='bookmark' title='Permanent Link: MySQL Backup and Restore'>MySQL Backup and Restore</a></li>
<li><a href='http://www.freebsdblog.org/116/ssh-copy/' rel='bookmark' title='Permanent Link: SSH Copy'>SSH Copy</a></li>
</ol></p>]]></content:encoded><description>My simple backup script It runs daily with cron job. #!/bin/sh # directory to backup BACKUP_DIR=&amp;#8217;/home/&amp;#8217; # directory to store backup files DEST_DIR=&amp;#8217;/backup/&amp;#8217; # number of days to store backup files MAX_DAYS=30 # base backup file name BASE_FILENAME=&amp;#8217;home&amp;#8217; # remove files that are 30 or more days old. find $DEST_DIR -mtime +$MAX_DAYS -maxdepth 1 -name [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/345/backup-script/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>PHP 5.3 Isn’t That Bad</title><link>http://www.freebsdblog.org/343/php-53-isnt-that-bad/</link><category>FreeBSD General</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Fri, 29 Jul 2011 02:21:31 PDT</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/343/php-53-isnt-that-bad/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I complained about <a href="http://www.freebsdblog.org/335/upgrading-php-52-to-53/">php5.3 generating huge log files</a>, also, E_DEPRECATED doesn&#8217;t suppress those deprecated errors, as a result, I had to turn off php logs. Actually it doesn&#8217;t have to be that bad. </p>
<p>The reason why E_DEPRECATED doesn&#8217;t work is that, some scripts set error_reporting value and supersede the setting in php.ini, so, no matter how we configure php, we just couldn&#8217;t suppress those errors. Obviously, the best solution is modifying the scripts, but I didn&#8217;t want to risk breaking the code and had never given it a try. I was very wrong, the best solution is actually also the easiest solution, there is no risk at all. I fixed a dozen scripts within a couple of hours &#8211; just very simple replace. <span id="more-343"></span></p>
<p>Here are some common deprecation errors I encountered:</p>
<p><strong>Error</strong>: date() [function.date]: It is not safe to rely on the system&#8217;s timezone settings. Please use the date.timezone setting. Old versions of WordPress generate crazy logs of this error.<br />
<strong>Solution</strong>: Set a default timezone in php.ini, my server was changed to<br />
date.timezone = &#8220;America/Phoenix&#8221;<br />
Here is the list of <a href="http://www.php.net/manual/en/timezones.php">supported timezones</a>.</p>
<p><strong>Error</strong>: PHP Deprecated:  Assigning the return value of new by reference is deprecated<br />
<strong>Solution</strong>: Replace &#8220;&#8216;=&#038; new&#8221; with &#8220;= new&#8221;.</p>
<p><strong>Error</strong>: Function split() is deprecated.<br />
<strong>Solution</strong>: Most scripts don&#8217;t use the regex version, simply replace &#8220;split&#8221; with &#8220;explode&#8221;.</p>
<p>There are some other errors but I don&#8217;t remember right now, just search online, there should always be a very easy solution.</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/335/upgrading-php-52-to-53/' rel='bookmark' title='Permanent Link: Upgrading PHP 5.2 to 5.3 &#8211; Bad Move'>Upgrading PHP 5.2 to 5.3 &#8211; Bad Move</a></li>
<li><a href='http://www.freebsdblog.org/56/php-debugging/' rel='bookmark' title='Permanent Link: PHP Debugging'>PHP Debugging</a></li>
</ol></p>]]></content:encoded><description>I complained about php5.3 generating huge log files, also, E_DEPRECATED doesn&amp;#8217;t suppress those deprecated errors, as a result, I had to turn off php logs. Actually it doesn&amp;#8217;t have to be that bad. The reason why E_DEPRECATED doesn&amp;#8217;t work is that, some scripts set error_reporting value and supersede the setting in php.ini, so, no matter [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/343/php-53-isnt-that-bad/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments></item><item><title>Add Zip Support</title><link>http://www.freebsdblog.org/342/add-zip-support/</link><category>PHP</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Fri, 29 Jul 2011 00:14:23 PDT</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/342/add-zip-support/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>According to <a href="http://www.php.net/manual/en/zip.requirements.php">the PHP manual</a>, zip extension uses the functions of zlib (<span style="color: #007a00;">archivers/php5-zlib</span>), but it doesn&#8217;t work. Actually there is a separated package dedicated to zip support: <span style="color: #007a00;">archivers/php5-zip</span>, after I installed this package, phpinfo() will have a zip section. Isn&#8217;t that confusing?</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/88/add-gd-support-for-php/' rel='bookmark' title='Permanent Link: Add GD Support for PHP'>Add GD Support for PHP</a></li>
<li><a href='http://www.freebsdblog.org/335/upgrading-php-52-to-53/' rel='bookmark' title='Permanent Link: Upgrading PHP 5.2 to 5.3 &#8211; Bad Move'>Upgrading PHP 5.2 to 5.3 &#8211; Bad Move</a></li>
<li><a href='http://www.freebsdblog.org/124/horrible-support/' rel='bookmark' title='Permanent Link: Horrible Support'>Horrible Support</a></li>
</ol></p>]]></content:encoded><description>According to the PHP manual, zip extension uses the functions of zlib (archivers/php5-zlib), but it doesn&amp;#8217;t work. Actually there is a separated package dedicated to zip support: archivers/php5-zip, after I installed this package, phpinfo() will have a zip section. Isn&amp;#8217;t that confusing? Related posts:Add GD Support for PHP Upgrading PHP 5.2 to 5.3 &amp;#8211; Bad [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/342/add-zip-support/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>SSH Tunneling – Easy Secure Proxy</title><link>http://www.freebsdblog.org/340/ssh-tunneling-easy-secure-proxy/</link><category>Networking</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Sat, 19 Mar 2011 12:38:15 PDT</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/340/ssh-tunneling-easy-secure-proxy/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>While I was trying to setup OpenVPN as a proxy, I found that SSH tunneling is a much easier and more convenient solution. The configuration only takes a few minutes, and the client side can be configured to use the proxy or not on a program-by-program basis.</p>
<p>Add the following line in /etc/ssh/sshd_config</p>
<blockquote><p>PermitTunnel yes</p></blockquote>
<p><a href="http://www.techrepublic.com/blog/security/use-putty-as-a-secure-proxy-on-windows/421">Configure Windows client</a></p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/90/install-a-proxy-server-privoxy/' rel='bookmark' title='Permanent Link: Install a Proxy Server &#8211; Privoxy'>Install a Proxy Server &#8211; Privoxy</a></li>
<li><a href='http://www.freebsdblog.org/83/301-redirect/' rel='bookmark' title='Permanent Link: 301 Redirect'>301 Redirect</a></li>
</ol></p>]]></content:encoded><description>While I was trying to setup OpenVPN as a proxy, I found that SSH tunneling is a much easier and more convenient solution. The configuration only takes a few minutes, and the client side can be configured to use the proxy or not on a program-by-program basis. Add the following line in /etc/ssh/sshd_config PermitTunnel yes [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/340/ssh-tunneling-easy-secure-proxy/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>Disable Remote Access for MySQL</title><link>http://www.freebsdblog.org/339/disable-remote-access-for-mysql/</link><category>MySQL</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Fri, 18 Mar 2011 11:31:17 PDT</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/339/disable-remote-access-for-mysql/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I&#8217;m seeing messages like below in mysql error log on my new server:</p>
<p><font color="#000099">110318 10:48:02 [Warning] IP address &#8216;x.x.x.x&#8217; could not be resolved: no reverse address mapping.</font></p>
<p>I don&#8217;t need to access mysql remotely, it should be disabled for either performance or security. This can be changed by adding &#8220;skip-networking&#8221; in my.cnf, mysql will not listen on a TCP/IP port at all.</p>
<blockquote><p>[mysqld]<br />
skip-networking
</p></blockquote>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/120/mysql-optimization/' rel='bookmark' title='Permanent Link: MySQL Optimization'>MySQL Optimization</a></li>
<li><a href='http://www.freebsdblog.org/7/optimizing-mysql/' rel='bookmark' title='Permanent Link: Optimizing MySQL'>Optimizing MySQL</a></li>
<li><a href='http://www.freebsdblog.org/87/mysql-start-script/' rel='bookmark' title='Permanent Link: MySQL Start Script'>MySQL Start Script</a></li>
</ol></p>]]></content:encoded><description>I&amp;#8217;m seeing messages like below in mysql error log on my new server: 110318 10:48:02 [Warning] IP address &amp;#8216;x.x.x.x&amp;#8217; could not be resolved: no reverse address mapping. I don&amp;#8217;t need to access mysql remotely, it should be disabled for either performance or security. This can be changed by adding &amp;#8220;skip-networking&amp;#8221; in my.cnf, mysql will not [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/339/disable-remote-access-for-mysql/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>MySQL Backup and Restore</title><link>http://www.freebsdblog.org/338/mysql-backup-and-restore/</link><category>MySQL</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Sat, 12 Mar 2011 02:20:31 PST</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/338/mysql-backup-and-restore/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><strong>Backup single database</strong><br />
<font color="#990000"># mysqldump -u root -p db_name | gzip > sql.gz</font></p>
<p><strong>Restore</strong><br />
<font color="#990000"># gunzip < sql.gz | mysql -u root -p db_name</font></p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/99/mysql-backup-and-mycnf/' rel='bookmark' title='Permanent Link: MySQL Backup and my.cnf'>MySQL Backup and my.cnf</a></li>
<li><a href='http://www.freebsdblog.org/345/backup-script/' rel='bookmark' title='Permanent Link: Backup Script'>Backup Script</a></li>
<li><a href='http://www.freebsdblog.org/120/mysql-optimization/' rel='bookmark' title='Permanent Link: MySQL Optimization'>MySQL Optimization</a></li>
</ol></p>]]></content:encoded><description>Backup single database # mysqldump -u root -p db_name &amp;#124; gzip &gt; sql.gz Restore # gunzip &lt; sql.gz &amp;#124; mysql -u root -p db_name Related posts:MySQL Backup and my.cnf Backup Script MySQL Optimization</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/338/mysql-backup-and-restore/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>How to Setup Key Based Authentication in SSH</title><link>http://www.freebsdblog.org/336/how-to-setup-key-based-authentication-in-ssh/</link><category>Security</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Tue, 08 Mar 2011 04:19:27 PST</pubDate><guid isPermaLink="false">http://www.freebsdblog.org/?p=336</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>This is for Windows client, please refer to <a href="http://www.freebsdonline.com/content/view/458/474/">this page</a> for FreeBSD workstation.</p>
<p><strong>Key Based Authentication, step by step</strong></p>
<p>1. <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Download PuTTYgen</a> (on Windows), generate private/public key pair.<br />
<span id="more-336"></span><br />
1.1 Save public and private key files.</p>
<p>1.2 Edit public key file according to <a href="http://www.walkernews.net/2009/03/22/how-to-fix-server-refused-our-key-error-that-caused-by-putty-generated-rsa-public-key/">this page</a>. Basically 3 changes:</p>
<ul>
<li>Delete the first two and the last line</li>
<li>Join the remaining lines into one single line   </li>
<li>Insert ssh-rsa keyword (with one trailing space) in front of the single line</li>
</ul>
<p>2. Upload public key file to <font color="#007A00">~/.ssh/authorized_keys</font>, this is the default path for public key file, create .ssh if the directory doesn&#8217;t exist. Append public key file content if the file authorized_keys already exists.</p>
<p>3. Edit <font color="#007A00">/etc/ssh/sshd_config</font><br />
Uncomment or add the following lines:<br />
<font color="#000099">RSAAuthentication yes<br />
PubkeyAuthentication yes<br />
AuthorizedKeysFile .ssh/authorized_keys<br />
PasswordAuthentication no<br />
ChallengeResponseAuthentication no</font></p>
<p><strong>Reload sshd</strong><br />
Note: make a test login before reload the sshd config, you may be locked out.<br />
<font color="#990000"># /etc/rc.d/sshd reload</font></p>
<p>4. Connect with putty, specify private key in &#8220;Connection > SSH > Auth > Browse&#8230;&#8221;</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/329/key-based-authentication-in-ssh/' rel='bookmark' title='Permanent Link: Key Based Authentication in SSH'>Key Based Authentication in SSH</a></li>
<li><a href='http://www.freebsdblog.org/77/change-sshd-port/' rel='bookmark' title='Permanent Link: Change sshd Port'>Change sshd Port</a></li>
<li><a href='http://www.freebsdblog.org/49/allowusers/' rel='bookmark' title='Permanent Link: AllowUsers'>AllowUsers</a></li>
</ol></p>]]></content:encoded><description>This is for Windows client, please refer to this page for FreeBSD workstation. Key Based Authentication, step by step 1. Download PuTTYgen (on Windows), generate private/public key pair. 1.1 Save public and private key files. 1.2 Edit public key file according to this page. Basically 3 changes: Delete the first two and the last line [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/336/how-to-setup-key-based-authentication-in-ssh/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>Upgrading PHP 5.2 to 5.3 – Bad Move</title><link>http://www.freebsdblog.org/335/upgrading-php-52-to-53/</link><category>PHP</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Sat, 04 Sep 2010 22:42:51 PDT</pubDate><guid isPermaLink="false">http://www.freebsdblog.org/?p=335</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><strong>Update</strong>: please see my new post: <a href="http://www.freebsdblog.org/343/php-53-isnt-that-bad/">PHP 5.3 Isn’t That Bad</a></p>
<p>MediaWiki doesn&#8217;t like PHP 5.2.8, I had to upgrade PHP to install MediaWiki. PortUpgrade upgraded PHP to 5.3.3 successfully, but it got problems while upgrading PHP modules, it&#8217;s mainly caused by the change of PCRE package which became part of PHP on FreeBSD since 5.3. If you need to upgrade to PHP 5.3.x, make sure you read <span style="color: #007a00;">/usr/ports/UPDATING</span> and <a href="http://forums.freebsd.org/showthread.php?t=13191">this thread</a>.<br />
<span id="more-335"></span><br />
Basically, PCRE needs to be included explicitly when compile PHP, otherwise other packages can&#8217;t be compiled due to the missing <span style="color: #007a00;">/usr/local/include/php/ext/pcre/pcre.h</span>. Add the following line to <span style="color: #007a00;">/etc/make.conf</span> if you use &#8216;make install&#8217;, or to <span style="color: #007a00;">/etc/pkgtools.conf</span> if you use portupgrade. </p>
<p><span style="color: #000099;">WITH_BUNDLED_PCRE=&#8221;YES&#8221;</span></p>
<p>Although I made it work finally, I really don&#8217;t like the result. PHP5.3.3 is quite different from its predecessors, I got huge amount of log errors &#8211; it&#8217;s a pain if you are running all kinds of third party scripts on your server. So far, I think the latest version of PHP 5.2 is a much better solution unless you only run home-made scripts, or all your third-party scripts have been tailored for PHP5.3.</p>
<p>I have all kinds of very old scripts on my server and have no plan to upgrade some of them in the foreseeable future.</p>
<p>The odd thing is that error_reporting didn&#8217;t seem to suppress any PHP warnings or deprecated errors regardless of any options, the error logs are so crazy that I had to turn off log_errors, obviously this can only be a temporary solution, I may downgrade PHP soon.</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/96/upgrade-to-php-5-and-mysql-5/' rel='bookmark' title='Permanent Link: Upgrade to PHP 5 and MySQL 5'>Upgrade to PHP 5 and MySQL 5</a></li>
<li><a href='http://www.freebsdblog.org/343/php-53-isnt-that-bad/' rel='bookmark' title='Permanent Link: PHP 5.3 Isn&#8217;t That Bad'>PHP 5.3 Isn&#8217;t That Bad</a></li>
<li><a href='http://www.freebsdblog.org/101/apache-error-log-file/' rel='bookmark' title='Permanent Link: Apache Error Log File'>Apache Error Log File</a></li>
</ol></p>]]></content:encoded><description>Update: please see my new post: PHP 5.3 Isn’t That Bad MediaWiki doesn&amp;#8217;t like PHP 5.2.8, I had to upgrade PHP to install MediaWiki. PortUpgrade upgraded PHP to 5.3.3 successfully, but it got problems while upgrading PHP modules, it&amp;#8217;s mainly caused by the change of PCRE package which became part of PHP on FreeBSD since [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/335/upgrading-php-52-to-53/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>Disable Apache Log Files</title><link>http://www.freebsdblog.org/331/disable-apache-log-files/</link><category>Apache</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Wed, 11 Aug 2010 02:02:32 PDT</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/331/disable-apache-log-files/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Today I was overwhelmed by all kinds of error messages caused by insufficient storage space, this <a href="http://www.freebsdblog.org/43/move-apache-log-files/">happened once</a> 5 years ago. Since I linked /var/db/ and /var/log/www/ to another big partition, /var usually only uses a few hundred MB and should never use up its 10GB space. It turned to be the master Apache log file (/var/log/httpd-access.log).<span id="more-331"></span></p>
<p>I use Google Analytics on many websites, Apache access log files are no long needed, so I disabled them by removing CustomLog lines in httpd.conf, but it&#8217;s not the right way, Apache started to write the log info to its master log file instead, which grew up to 9GB over the months.</p>
<p>The correct way to disable Apache log files is changing CustomLog line to:</p>
<p><em>CustomLog /dev/null combined</em></p>
<p>Error log files should be kept anyway.</p>
<p>The daily run output email contains the output of command &#8216;df&#8217;, but I didn&#8217;t notice the changes.</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/41/more-about-apache-log-file-rotation/' rel='bookmark' title='Permanent Link: More About Apache Log File Rotation'>More About Apache Log File Rotation</a></li>
<li><a href='http://www.freebsdblog.org/43/move-apache-log-files/' rel='bookmark' title='Permanent Link: Move Apache Log Files'>Move Apache Log Files</a></li>
<li><a href='http://www.freebsdblog.org/21/separate-log-files-for-virutal-host/' rel='bookmark' title='Permanent Link: Separate Log Files for Virutal Host'>Separate Log Files for Virutal Host</a></li>
</ol></p>]]></content:encoded><description>Today I was overwhelmed by all kinds of error messages caused by insufficient storage space, this happened once 5 years ago. Since I linked /var/db/ and /var/log/www/ to another big partition, /var usually only uses a few hundred MB and should never use up its 10GB space. It turned to be the master Apache log [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/331/disable-apache-log-files/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments></item><item><title>Welcome to Nginx! What’s This?</title><link>http://www.freebsdblog.org/330/welcome-to-nginx/</link><category>Security</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Fri, 23 Jul 2010 04:57:27 PDT</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/330/welcome-to-nginx/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>When I visited one of my sites, I got a page with only the bold and big text:</p>
<p><strong>Welcome to Nginx!</strong></p>
<p>It looked like my site was hacked, actually I was pretty sure about it at that moment. I almost wanted to roll out my backup, fortunately it&#8217;s back to normal 20 minutes later, then I thought it might be my computer&#8217;s problem. After some digging, it turned out to be my ISP&#8217;s problem, somehow my ISP treated my site as an invalid domain and displayed their own search engine (evil), but their own site didn&#8217;t work, hence the default page from their proxy server.</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/321/htaccess-error/' rel='bookmark' title='Permanent Link: .htaccess error'>.htaccess error</a></li>
<li><a href='http://www.freebsdblog.org/98/google-app-configuration-for-bind/' rel='bookmark' title='Permanent Link: Google App configuration for bind'>Google App configuration for bind</a></li>
<li><a href='http://www.freebsdblog.org/340/ssh-tunneling-easy-secure-proxy/' rel='bookmark' title='Permanent Link: SSH Tunneling &#8211; Easy Secure Proxy'>SSH Tunneling &#8211; Easy Secure Proxy</a></li>
</ol></p>]]></content:encoded><description>When I visited one of my sites, I got a page with only the bold and big text: Welcome to Nginx! It looked like my site was hacked, actually I was pretty sure about it at that moment. I almost wanted to roll out my backup, fortunately it&amp;#8217;s back to normal 20 minutes later, then [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/330/welcome-to-nginx/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>Key Based Authentication in SSH</title><link>http://www.freebsdblog.org/329/key-based-authentication-in-ssh/</link><category>Security</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Thu, 04 Mar 2010 12:27:49 PST</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/329/key-based-authentication-in-ssh/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I just changed my SSH authentication from password to key-based. If you are using password authentication, I strongly suggest you change it, it&#8217;s a must, the setup is also very easy, there is no any reasons you don&#8217;t do this. With all kinds of buggy programs and scripts, our servers are much much weaker than we thought.</p>
<p><strong>Edit: </strong> Wrote a <a href="http://www.freebsdblog.org/336/how-to-setup-key-based-authentication-in-ssh/">step by step guide</a> for easy reference.</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/336/how-to-setup-key-based-authentication-in-ssh/' rel='bookmark' title='Permanent Link: How to Setup Key Based Authentication in SSH'>How to Setup Key Based Authentication in SSH</a></li>
<li><a href='http://www.freebsdblog.org/55/smtp-may-not-be-necessary/' rel='bookmark' title='Permanent Link: SMTP May Not Be Necessary'>SMTP May Not Be Necessary</a></li>
<li><a href='http://www.freebsdblog.org/115/another-hack-on-third-party-script/' rel='bookmark' title='Permanent Link: Another Hack on Third-party Script'>Another Hack on Third-party Script</a></li>
</ol></p>]]></content:encoded><description>I just changed my SSH authentication from password to key-based. If you are using password authentication, I strongly suggest you change it, it&amp;#8217;s a must, the setup is also very easy, there is no any reasons you don&amp;#8217;t do this. With all kinds of buggy programs and scripts, our servers are much much weaker than [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/329/key-based-authentication-in-ssh/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item><item><title>Tar: extract one or more files from an archive</title><link>http://www.freebsdblog.org/328/tar-extract-one-or-more-files-from-an-archive/</link><category>Command &amp; Utility</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">KP</dc:creator><pubDate>Sun, 21 Feb 2010 21:49:31 PST</pubDate><guid isPermaLink="true">http://www.freebsdblog.org/328/tar-extract-one-or-more-files-from-an-archive/</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>To extract a single file from an archive:<br />
<font color=#990000># tar zxvf tarfile.tgz &#8211;include=&#8221;desiredfile&#8221;</font></p>
<p>Use patterns:<br />
<font color=#990000># tar zxvf tarfile.tgz &#8211;include=&#8221;desiredfile*&#8221;</font></p>
<p>&#8216;desiredfile&#8217; must use full path. To check file&#8217;s fullpath:</p>
<p><font color=#990000># tar tf tarfile.tgz</font></p>
<p>Note: It&#8217;s double &#8216;-&#8217; before include.</p>


<p>Related posts:<ol><li><a href='http://www.freebsdblog.org/31/tar-command/' rel='bookmark' title='Permanent Link: Tar Command'>Tar Command</a></li>
<li><a href='http://www.freebsdblog.org/5/recursively-ftp-files/' rel='bookmark' title='Permanent Link: Recursively FTP Files'>Recursively FTP Files</a></li>
<li><a href='http://www.freebsdblog.org/35/log-files/' rel='bookmark' title='Permanent Link: Log Files'>Log Files</a></li>
</ol></p>]]></content:encoded><description>To extract a single file from an archive: # tar zxvf tarfile.tgz &amp;#8211;include=&amp;#8221;desiredfile&amp;#8221; Use patterns: # tar zxvf tarfile.tgz &amp;#8211;include=&amp;#8221;desiredfile*&amp;#8221; &amp;#8216;desiredfile&amp;#8217; must use full path. To check file&amp;#8217;s fullpath: # tar tf tarfile.tgz Note: It&amp;#8217;s double &amp;#8216;-&amp;#8217; before include. Related posts:Tar Command Recursively FTP Files Log Files</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.freebsdblog.org/328/tar-extract-one-or-more-files-from-an-archive/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments></item></channel></rss>

