<?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>OMNINOGGIN &#187; FreeBSD</title>
	<atom:link href="http://omninoggin.com/category/freebsd/feed/" rel="self" type="application/rss+xml" />
	<link>http://omninoggin.com</link>
	<description>WordPress and Web Dev From the Ground Up</description>
	<lastBuildDate>Wed, 07 Jul 2010 16:01:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Setting up Sendmail on FreeBSD 6.2</title>
		<link>http://omninoggin.com/freebsd/setting-up-sendmail-on-freebsd-62/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-sendmail-on-freebsd-62/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 06:16:10 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Host Names]]></category>
		<category><![CDATA[Internet Service Provider]]></category>
		<category><![CDATA[Isp]]></category>
		<category><![CDATA[Local Host]]></category>
		<category><![CDATA[mail proxy]]></category>
		<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[Mail Servers]]></category>
		<category><![CDATA[Mail Services]]></category>
		<category><![CDATA[Mail Start]]></category>
		<category><![CDATA[Mail Yahoo]]></category>
		<category><![CDATA[Net Mail]]></category>
		<category><![CDATA[Proxy Server]]></category>
		<category><![CDATA[Public Mail]]></category>
		<category><![CDATA[sbc]]></category>
		<category><![CDATA[Sbc Yahoo]]></category>
		<category><![CDATA[Sbcglobal Net]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[Server Domain]]></category>
		<category><![CDATA[Smart Host]]></category>
		<category><![CDATA[Smtp Mail]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[Yahoo Mail]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/10/10/setting-up-sendmail-on-freebsd-62/</guid>
		<description><![CDATA[Previously, I mentioned that I was not able to successfully send emails via sendmail.  This functionality is quite useful because WordPress, among other things, uses sendmail to send emails to you when someone leaves a comment on your post.  So it turns out that because most public mail servers (i.e. gmail, hotmail, etc) [...]]]></description>
			<content:encoded><![CDATA[<p>Previously, I mentioned that I was not able to successfully send emails via sendmail.  This functionality is quite useful because WordPress, among other things, uses sendmail to send emails to you when someone leaves a comment on your post.  So it turns out that because most public mail servers (i.e. gmail, hotmail, etc) do not trust my &#8220;omninoggin.com&#8221; mail server domain, all messages I sent were refused.  After hours of research, I found out that I can route my mail traffic through my internet service provider&#8217;s mail proxy (SBC Yahoo!) to get this to work.<span id="more-82"></span></p>
<p>I started by following the <a href="http://www.openaddict.com/deploying_a_freebsd_6_2_server.html" rel="nofollow" >Open Addict tutorial</a> section &#8220;Configuring Mail Services&#8221;.  After the step &#8220;Edit the [hostname].mc file, add these lines, I put mine above DAEMON_OPTIONS,&#8221; I stopped following  the tutorial and did the following:</p>
<ol>
<li>Add these lines into my [hostname].mc file (above DAEMON_OPTIONS).  Also note that &#8220;smtp.sbc.mail.yahoo4.akadns.net&#8221; is SBC Yahoo&#8217;s mail proxy server.
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define(`confAUTH_OPTIONS', `A')dnl
define(`confAUTH_MECHANISMS', `PLAIN LOGIN')dnl
TRUST_AUTH_MECH(`PLAIN LOGIN')dnl
FEATURE(`authinfo',`hash /etc/mail/authinfo')dnl
define(`SMART_HOST',`smtp.sbc.mail.yahoo4.akadns.net')dnl</pre></div></div>
</li>
<li>Create the file /etc/mail/authinfo and put the following into it (<strong>all in one line</strong>) and save (also make sure you replace &lt;your-username&gt; and &lt;your-password&gt; with your real username and password):
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">AuthInfo:smtp.sbc.mail.yahoo4.akadns.net
&quot;U:&lt;your-username&gt;@sbcglobal.net&quot;
&quot;I:&lt;your-username&gt;@sbcglobal.net&quot;
&quot;R:sbcglobal.net&quot; &quot;P:&lt;your-password&gt;&quot; &quot;M:PLAIN&quot;</pre></div></div>
</li>
<li>Run the following command:
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">makemap <span style="color: #7a0874; font-weight: bold;">hash</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>authinfo <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>authinfo</pre></div></div>
</li>
<li>Set sendmail to start (and listen) at boot, so add this to /etc/rc.conf:
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sendmail_enable=&quot;YES&quot;</pre></div></div>
</li>
<li>Create the file /etc/mail/local-host-names and insert your domain name(s) to accept mail for. Then, finish the sendmail re-build.
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mail<span style="color: #000000; font-weight: bold;">/</span>local-host-names
<span style="color: #c20cb9; font-weight: bold;">make</span> all <span style="color: #c20cb9; font-weight: bold;">install</span> restart</pre></div></div>
</li>
<li>Send a test email to yourself
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sendmail</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;webmaster@your-domain.com&quot;</span> <span style="color: #660033;">-F</span> <span style="color: #ff0000;">&quot;webmaster&quot;</span></pre></div></div>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">From: Webmaster &lt;webmaster@your-domain.com&gt;
To: your.other@email.com
Subject: Hello World!
Hello World!
.</pre></div></div>
</li>
</ol>
<p>This should work but in case it doesn&#8217;t, there is some good troubleshooting information on <a href="http://www.dslreports.com/faq/11247" rel="nofollow" >DSL Reports</a>. It took me 5 hours to figure this out so good luck!</p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-sendmail-on-freebsd-62/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Keeping BSD Ports Up-to-date Effortlessly</title>
		<link>http://omninoggin.com/freebsd/keeping-your-freebsd-ports-up-to-date-effortlessly/</link>
		<comments>http://omninoggin.com/freebsd/keeping-your-freebsd-ports-up-to-date-effortlessly/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 07:30:46 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[bsd ports]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cvsup]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/10/03/keeping-your-freebsd-ports-up-to-date-effortlessly/</guid>
		<description><![CDATA[If you don&#8217;t have  &#8216;cvsup&#8217; installed, do so by following the tutorial on Open Addict (section: Rebuild the World, and Recompile the Kernel):
Since all you have to do to update your ports is run the command:
cvsup -g -L 2 /root/ports-supfile
Just stick that command in your crontab and make it run every midnight.
crontab -e # [...]]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t have  &#8216;cvsup&#8217; installed, do so by following the tutorial on <a href="http://www.openaddict.com/installing_freebsd_6_2.html" rel="nofollow" >Open Addict</a> (section: Rebuild the World, and Recompile the Kernel):</p>
<p>Since all you have to do to update your ports is run the command:</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cvsup <span style="color: #660033;">-g</span> <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>ports-supfile</pre></div></div>
<p>Just stick that command in your crontab and make it run every midnight.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">crontab <span style="color: #660033;">-e</span> <span style="color: #666666; font-style: italic;"># This opens the crontab in the vi editor.</span></pre></div></div>
<p>Add this line to the crontab:</p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">0 0 * * * /usr/local/bin/cvsup -g -L 2 /root/ports-supfile</pre></div></div>
<p>Shift+zz to save and you are done.</p>
<p>This it one of the reasons why I love Unix.   With little thought, everything is script-able and customizable.</p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/keeping-your-freebsd-ports-up-to-date-effortlessly/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Recapping: Setting up a FreeBSD 6.2 Web Server</title>
		<link>http://omninoggin.com/freebsd/recapping-setting-up-a-freebsd-62-web-server/</link>
		<comments>http://omninoggin.com/freebsd/recapping-setting-up-a-freebsd-62-web-server/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 16:18:01 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[digg]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[storm]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[varnish]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp-cache]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/09/14/recapping-setting-up-a-freebsd-62-web-server/</guid>
		<description><![CDATA[I hope I can get some part-time consulting jobs to do this optimization for small businesses.  All in all, it doesn&#8217;t seem too hard to do and I enjoyed doing it.  If you run into a problem just google it for the answer.  Anyway, here is the recap of the steps I [...]]]></description>
			<content:encoded><![CDATA[<p>I hope I can get some part-time consulting jobs to do this optimization for small businesses.  All in all, it doesn&#8217;t seem too hard to do and I enjoyed doing it.  If you run into a problem just google it for the answer.  Anyway, here is the recap of the steps I took to set up my FreeBSD 6.2 Web Server.</p>
<ol>
<li><a href="http://omninoggin.com/2007/08/26/setting-up-a-freebsd-62-web-server-part-1/">Installing OS </a></li>
<li><a href="http://omninoggin.com/2007/08/28/setting-up-a-freebsd-62-web-server-apache-mysql-etc-part-2/">Setting Up Apache, MySQL, and Other Services</a></li>
<li><a href="http://omninoggin.com/2007/08/30/setting-up-a-freebsd-62-web-server-migrating-wordpress-from-winxp-to-freebsd-part-3/">Migrating Wordpress from WinXP to FreeBSD</a></li>
<li><a href="http://omninoggin.com/2007/09/05/setting-up-a-freebsd-62-web-server-optimizing-apache-part-4/">Optimizing Apache</a></li>
<li><a href="http://omninoggin.com/2007/09/08/setting-up-a-freebsd-62-web-server-optimizing-mysql-part-5/">Optimizing MySQL</a></li>
<li><a href="http://omninoggin.com/2007/09/09/setting-up-a-freebsd-62-web-server-optimizing-php-part-6/">Optimizing PHP</a></li>
<li><a href="http://omninoggin.com/2007/09/10/setting-up-a-freebsd-62-web-server-proxy-caching-part-7/">Proxy Caching</a></li>
<li><a href="http://omninoggin.com/2007/10/06/wp-cache-the-untold-way-to-set-it-up/">Optimizing Wordpress with WP-Cache</a></li>
<li><a href="http://omninoggin.com/2007/10/03/keeping-your-freebsd-ports-up-to-date-effortlessly/">Keeping Your FreeBSD Ports Up-to-Date Effortlessly</a></li>
<li><a href="http://omninoggin.com/2007/10/10/setting-up-sendmail-on-freebsd-62/">Setting Up Sendmail on FreeBSD 6.2</a></li>
</ol>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/recapping-setting-up-a-freebsd-62-web-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up a FreeBSD 6.2 Web Server: Proxy Caching (Part 7)</title>
		<link>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-proxy-caching-part-7/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-proxy-caching-part-7/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 07:42:25 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[Cache Hit]]></category>
		<category><![CDATA[Cache Miss]]></category>
		<category><![CDATA[Cpu Usage]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[Efficiency]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[Javascripts]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[Ports]]></category>
		<category><![CDATA[proxy cache]]></category>
		<category><![CDATA[Proxy Server]]></category>
		<category><![CDATA[Server Proxy]]></category>
		<category><![CDATA[Static Files]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[traffic storm]]></category>
		<category><![CDATA[varnish]]></category>
		<category><![CDATA[Virtual Memory]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/09/10/setting-up-a-freebsd-62-web-server-proxy-caching-part-7/</guid>
		<description><![CDATA[Okay I lied, eAccelerator gives a pretty darn high ROI, but setting up a proxy cache gives a comparable or higher ROI.  I chose to use Varnish as my proxy cache.
Once installed, Varnish will keep a cache of all objects requested by internet users (e.g. post-generated PHP pages, CSS, javascripts, images) with the goal [...]]]></description>
			<content:encoded><![CDATA[<p>Okay I lied, eAccelerator gives a pretty darn high ROI, but setting up a proxy cache gives a comparable or higher ROI.  I chose to use Varnish as my proxy cache.</p>
<p>Once installed, Varnish will keep a cache of all objects requested by internet users (e.g. post-generated PHP pages, CSS, javascripts, images) with the goal of off-loading some work from your web server (remember: we won&#8217;t want big Apache to do the work only if it has to).  Also Varnish takes full advantage of the OS&#8217;s virtual memory and advanced I/O features on FreeBSD 6.x making it the optimal choice for my setup.</p>
<p>There were many confusing instructions on the web about how to configure Varnish.  Here are the steps I took to setting up Varnish for a signal machine running both Varnish and the web server:<span id="more-59"></span></p>
<p>1) Port install Varnish.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>varnish<span style="color: #000000; font-weight: bold;">/</span>; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></div></div>
<p>2)  Change Apache&#8217;s port to 8080 by modifying this line in /usr/local/etc/apache/httpd.conf</p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Listen 8080</pre></div></div>
<p>3) Restart Apache</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>apache22 restart</pre></div></div>
<p>4) Start the Varnish daemon.  Substitute the IP below with your machine&#8217;s internal network IP address.  If you are hosting at home, it is most likely 192.168.0.* but you can run ifconfig to find out what it is.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">varnishd <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">&lt;</span>your-machines-internal-ip-address<span style="color: #000000; font-weight: bold;">&gt;</span>:<span style="color: #000000;">80</span> <span style="color: #660033;">-b</span> localhost:<span style="color: #000000;">8080</span></pre></div></div>
<p>That&#8217;s it!  From now, all requests on port 80 should now be routed through the Varnish proxy cache.  A proxy cache miss will seemlessly make Apache calls to serve the internet user without the user ever knowing it!  A proxy cache hit would not access Apache (and therefore not access MySQL) lessening your machine CPU usage and increasing the speed &amp; efficiency of serving objects to user.</p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-proxy-caching-part-7/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Setting up a FreeBSD 6.2 Web Server: Optimizing PHP (Part 6)</title>
		<link>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-php-part-6/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-php-part-6/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 05:40:38 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/09/09/setting-up-a-freebsd-62-web-server-optimizing-php-part-6/</guid>
		<description><![CDATA[This was by far the easiest step in my optimization process.  To optimize PHP, I used the software called eAccelerator.  Compared to all of the other steps, this one had the best ROI for me.
When a PHP script is executed, the PHP interpreter will spend some time interpreting the script then compile the [...]]]></description>
			<content:encoded><![CDATA[<p>This was by far the easiest step in my optimization process.  To optimize PHP, I used the software called <a href="http://eaccelerator.net/" rel="nofollow" >eAccelerator</a>.  Compared to all of the other steps, this one had the best ROI for me.</p>
<p>When a PHP script is executed, the PHP interpreter will spend some time interpreting the script then compile the interpretations into opcodes for execution.  eAccelerator will precompile your PHP code into ready executable opcodes and manage that opcode cache for you.  If your PHP script does not change, Apache will directly call the precompiled opcodes (saving interpretation and compilation time).</p>
<p>This is what I did to set it up:<span id="more-58"></span></p>
<p>1) Port install eAccelerator</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>eaccelerator; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></div></div>
<p>2) Inject these lines into /usr/local/etc/php.ini</p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">; eAccelerator Stuff
extension=&quot;eaccelerator.so&quot;
eaccelerator.shm_size=&quot;16&quot;
eaccelerator.cache_dir=&quot;/tmp/eaccelerator&quot;
eaccelerator.enable=&quot;1&quot;
eaccelerator.optimizer=&quot;1&quot;
eaccelerator.check_mtime=&quot;1&quot;
eaccelerator.debug=&quot;0&quot;
eaccelerator.filter=&quot;&quot;
eaccelerator.shm_max=&quot;0&quot;
eaccelerator.shm_ttl=&quot;0&quot;
eaccelerator.shm_prune_period=&quot;0&quot;
eaccelerator.shm_only=&quot;0&quot;
eaccelerator.compress=&quot;1&quot;
eaccelerator.compress_level=&quot;9&quot;
eaccelerator.allowed_admin_path = &quot;/usr/local/www/apache22/data&quot;</pre></div></div>
<p>3) Make cache directory writable</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>eaccelerator
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>eaccelerator</pre></div></div>
<p>4) Restart Apache</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>apache22 restart</pre></div></div>
<p>That&#8217;s it!  This 10 minute optimization slashed my page generation time by 25%!   But if that&#8217;s still not fast enough for you, I will show you how to do <a href="http://omninoggin.com/2007/09/10/setting-up-a-freebsd-62-web-server-proxy-caching-part-7/">Proxy Caching</a> next.</p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-php-part-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a FreeBSD 6.2 Web Server: Optimizing MySQL (Part 5)</title>
		<link>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-mysql-part-5/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-mysql-part-5/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 22:24:53 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[analog]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/09/08/setting-up-a-freebsd-62-web-server-optimizing-mysql-part-5/</guid>
		<description><![CDATA[Similar to Apache, you do not want MySQL to start hogging all the memory in your system.  To configure your MySQL settings, open your /etc/my.cnf file for editing.  Under the [mysqld] section of the file modify the following variables:
max_connections = 10
max_user_connections = 10
These numbers are a bit tricky to setup.   The [...]]]></description>
			<content:encoded><![CDATA[<p>Similar to Apache, you do not want MySQL to start hogging all the memory in your system.  To configure your MySQL settings, open your /etc/my.cnf file for editing.  Under the [mysqld] section of the file modify the following variables:<span id="more-57"></span></p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">max_connections = 10
max_user_connections = 10</pre></div></div>
<p>These numbers are a bit tricky to setup.   The value depends on the ratio of dynamic requests and static requests.  Dynamic requests are typically PHP pages that make MySQL queries and get regenerated every time you access a page.  Static requests are typically files that are loaded/imported (e.g. *.js, *.css, *.jpg, *gif, etc) .  The average ratio for this is usually 1 dynamic request for every 5 requests, but I recommend you using a log analyzing software to find the exact number.</p>
<p>I used <a href="http://www.analog.cx/" rel="nofollow" >Analog</a> to help me find this number.  After you&#8217;ve ran Analog on your /var/log/httpd-access.log file, you should get a report file.  In the report file, find the section &#8220;File Type Report&#8221; and note the percent of calls made to the *.php file type.  That is your ratio.</p>
<p>Multiply your ratio by the number of maximum connections you&#8217;ve configured for Apache.  For example, if my max number of Apache connections is 27 (from previous post) and my ratio is 1/6, my MySQL max_connections should be CEILING(27 * 1/6) = 5.  I multiplied that number by 2 for safety measures to get max_connections = 10.</p>
<p>You have to set max_user_connections = 10 too because sometimes MySQL thinks that Apache is just 1 user and you do not want Apache to be limited to only one connection.</p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">max_allowed_packet=1M</pre></div></div>
<p>I&#8217;ve set max_allowed_packet to 1M as a measure to prevent run-away queries.  I&#8217;m pretty sure that I won&#8217; be querying anything that will returning a data packet greater than 1M.</p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">table_cache=100</pre></div></div>
<p>The table cache setting helps speed up MySQL queries.  The value set should be max_user_connections multiplied by the number of JOINs your heaviest MySQL query contains (In my case, 10 JOINs).</p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">query-cache-type=1
query-cache-size=10M</pre></div></div>
<p>This enables the query-cache feature.  Wordpress doen&#8217;t need a big query cache so I&#8217;ve set mine at 10M.</p>
<p>After all this, restart MySQL and watch your Wordpress page generation time dip by 50%.  Ooo sweet sweet reward.  Next I will show you how to <a href="http://omninoggin.com/2007/09/09/setting-up-a-freebsd-62-web-server-optimizing-php-part-6/">optimize PHP</a>!</p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-mysql-part-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up a FreeBSD 6.2 Web Server: Optimizing Apache (Part 4)</title>
		<link>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-apache-part-4/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-apache-part-4/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 05:27:19 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[optimize]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/09/05/setting-up-a-freebsd-62-web-server-optimizing-apache-part-4/</guid>
		<description><![CDATA[After my WAMP days were over I declare that I shall no longer fall victim to an inefficient/unoptimized lifestyle.  So here is my home brew optimization tutorial (yes, I really did it myself this time!).
Preface
Before you do anything, I recommend you add the following lines of code into footer.php of your Wordpress blog:
&#60;?php echo [...]]]></description>
			<content:encoded><![CDATA[<p>After my WAMP days were over I declare that I shall no longer fall victim to an inefficient/unoptimized lifestyle.  So here is my home brew optimization tutorial (yes, I really did it myself this time!).<span id="more-56"></span></p>
<p><strong>Preface</strong></p>
<p>Before you do anything, I recommend you add the following lines of code into footer.php of your Wordpress blog:</p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_num_queries<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> queries
<span style="color: #000000; font-weight: bold;">&lt;?php</span> timer_stop<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> seconds</pre></div></div>
<p>This will tell you the number of MySQL queries called and the number of seconds it took to generate the page you are on.</p>
<p>Once you&#8217;ve played a little bit with the timer_stop(1) function, you will notice that the first time generation of a page will take longer than successive tries.  This is because Wordpress has an internal cache mechanism built in and it is on by default.   If you are happy with the page generation time then you should just ignore my tutorial.  To me, I cannot stand leaving anything unoptimized because why be wasteful when you don&#8217;t have to be?  Also in case your blog gets dugg, you will have the pleasure of seeing that your blog can withstand hundreds of visitors without crashing like most others.</p>
<p><strong>Optimizing Apache</strong></p>
<p>For the record, my blog is hosted on a dedicated 2.0GHz P4 with 1GB of DDR RAM.   This information (at least the memory part) is important to figuring out how to optimize your Apache.  One of the most common reasons why blogs crash is because Apache is able to run loose and spawn an infinite number of httpd threads; thus, killing the memory and the machine.  We need to tell Apache to STOP when we know we have reached our physical limitation.  This is easily done by modifying your Apache configs in your httpd.conf file.  Here is what I added to my httpd.conf:</p>
<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">MaxKeepAliveRequests</span> <span style="color: #ff0000;">0</span>
<span style="color: #00007f;">KeepAliveTimeout</span> <span style="color: #ff0000;">0</span></pre></div></div>
<p>KeepAlives is a feature that keeps a connection open for the duration specified by &#8220;KeepAliveTimeout&#8221;.  When enabled this will alleviate the visitor of the overhead needed to create a new thread request if the next request occurs within the KeepAliveTimeout.  You should turn this off because the overhead is minuscule and leaving it on will waste memory.</p>
<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">ServerLimit <span style="color: #ff0000;">27</span></pre></div></div>
<p>This setting is important because it would stop Apache from spawning too many httpd threads and fill up all the memory.  Once the memory is filled up, your system will automatically start using swap space.  It is VERY BAD for a web server to be served from swap space!  The setting above tells apache to not spawn more than 27 httpd threads.  Here are the formulas to help you find out what your server limit should be.</p>
<blockquote><p>If you are sharing your machine with anything else (e.g. MySQL database) you should use the formula below:</p>
<blockquote><p>MaxClients = Total RAM / (2 * Apache Process Memory Size)</p></blockquote>
<p>If you are using your machine solely for Apache you should use the following formula:</p>
<blockquote>
<p ALIGN="left">MaxClients = Total RAM / Apache Process Memory Size</p>
</blockquote>
</blockquote>
<p>My RAM is 1024MB and my Apache processes are about 19MB each.  I also run MySQL on the same machine so using the first formula gives me ~27.</p>
<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">MinSpareServers</span> <span style="color: #ff0000;">15</span>
<span style="color: #00007f;">MaxSpareServers</span> <span style="color: #ff0000;">20</span></pre></div></div>
<p>These 2 settings mean just what they say.  MinSpareServer specifies the minimum number of httpd threads to be left for spare usage at any given time.  MaxSpareServer specifies the maximum.  The trick is to adjust this to best suit your traffic.  The general rule of thumb is that if Apache needs to spawn more than 4 threads at any given time then you should increase your MinSpareServers value.  MaxSpareServers is used to keep spawned spare threads in check.  For example, if visitors are actively using 5 of your servers, you will have 15 spare servers sitting in the background in case usage increases dramatically.  When visitor usage increases to 8, Apache might increase the number of spare threads to 20.  Once usage increases to 10, Apache will not spawn anymore spare threads.</p>
<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">MaxClients</span> <span style="color: #ff0000;">27</span></pre></div></div>
<p>If you know that your machine cannot handle 100 users then you should cap it to what you think it can handle.  I&#8217;ve changed my max clients to 27 (1 per httpd thread).</p>
<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">ListenBacklog</span> <span style="color: #ff0000;">27</span></pre></div></div>
<p>This setting tells Apache to listen to the next 27 requests.  If you know you cannot handle those extra requests it is better to deny the user right away instead of having them wait for a server timeout.</p>
<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">MaxRequestsPerChild</span> <span style="color: #ff0000;">4000</span></pre></div></div>
<p>Contrary to what this looks like, this is the number of requests the child handles until it dies.  With the setting above, one httpd thread will handle 4000 requests then it will die.  If you keep the original setting (0, unlimited), the child process will never die and it might cause memory leakage issues later on.</p>
<p>After saving your httpd.conf, restart your Apache server and the changes should take effect.  Now, you can move onto the next step, <a href="http://omninoggin.com/2007/09/08/setting-up-a-freebsd-62-web-server-optimizing-mysql-part-5/">MySQL optimization</a>.</p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-optimizing-apache-part-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting up a FreeBSD 6.2 Web Server: Migrating Wordpress from WinXP to FreeBSD (Part 3)</title>
		<link>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-migrating-wordpress-from-winxp-to-freebsd-part-3/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-migrating-wordpress-from-winxp-to-freebsd-part-3/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 05:34:01 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server Migration]]></category>
		<category><![CDATA[wamp]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/08/30/setting-up-a-freebsd-62-web-server-migrating-wordpress-from-winxp-to-freebsd-part-3/</guid>
		<description><![CDATA[Background
I previously made a an awfully painful choice to host this site on my WindowsXP machine using WAMP (FYI, WAMP = Windows, Apache, MySQL, PHP packaged into one install).  WAMP and I had a 10-month-long love-hate relationship:
Month 1
- WAMP quickly attracted me with its sexy promises of hitting it off quickly.
- There was no [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Background</strong></p>
<p>I previously made a an awfully painful choice to host this site on my WindowsXP machine using WAMP (FYI, WAMP = Windows, Apache, MySQL, PHP packaged into one install).  WAMP and I had a 10-month-long love-hate relationship:<span id="more-54"></span></p>
<p><em>Month 1</em></p>
<blockquote><p>- WAMP quickly attracted me with its sexy promises of hitting it off quickly.<br />
- There was no need to set up a separate OS/machine and learn it.<br />
- I loved the fact that it took me less than 30 minutes to get my server up.<br />
- Website administration is a lot easier since it&#8217;s on the local machine.</p></blockquote>
<p><em>Months 2 &#8211; 10 </em></p>
<blockquote><p>- I had to set up VNC, FTP, and SSH to be able to remotely administer my website if I am not home.<br />
The longer Apache and MySQL processes stay alive, the more memory they hog (memory leaks).  I had to keep restarting the services every day to maintain acceptable performance.<br />
- Windows keeps crashing or auto-updating causing my server to restart without notice.  I had to turn off auto-update.  As for the random crashing, all I was able to do was hope that it won&#8217;t crash.<br />
- WAMP started to get fat and lazy once I added more content into to the site.  I had 8 second page generation times!<br />
- When I tried to follow optimization guides for Apache, MySQL, and PHP, I found out that Apache packaged with WAMP had limited httpd.conf functionality.  I tried MySQL optimization and it did not help the time much.  Lastly, I could not find a PHP accelerator software for windows PHP5.  This was the straw the broke the camel&#8217;s back.</p></blockquote>
<p>As you can see, this story is like the story of meeting a supermodel girl.  She might be fun in the beginning but after the first month, you find out that she&#8217;s actually a high maintenance airhead who doesn&#8217;t know how to do anything but strut her stuff.  After 10 months I was ready to get myself a house wife that will cook, clean, and quickly serve pages.</p>
<p><strong>How I Broke up with WAMP</strong></p>
<p>Here is a general outline of the steps I took to migrate my site over from Windows XP WAMP platform to FreeBSD.</p>
<ol>
<li><strong>Upgrade Wordpress:</strong> Lazy me, I had an older version of Wordpress.  I had to take this extra step to upgrade my Wordpress because the newer version will most likely make modifications to MySQL.</li>
<li><strong>Export old MySQL data</strong>: You can either do a mysqldump or you can be chicken like me and use phpMyAdmin to export everything in my old MySQL server to a localhost.sql file.</li>
<li><strong>Import data to the new MySQL server:</strong> On the command line of the FreeBSD machine I did:
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">&lt;</span> localhost.sql</pre></div></div>
<p>Of course this did not work the first time.  It might work for you the first try but in my case, I had an error about root not being able to access some of the tables and databases.  I had to go and modify localhost.sql and add GRANT permissions for &#8220;root&#8221;@&#8221;localhost&#8221; to all of the tables &amp; databases.  After I did that, everything imported fine.</li>
<li><strong>Migrating Wordpress:</strong> I copied all files over from the old machine and everything worked like a charm (Keep in mind that I kept my database users/passwords the same).  Also, MAKE SURE YOU BACKUP EVERYTHING BEFORE YOU DO THIS!</li>
</ol>
<p>I was FREE AT LAST!</p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-migrating-wordpress-from-winxp-to-freebsd-part-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up a FreeBSD 6.2 Web Server: Apache, MySQL, etc (Part 2)</title>
		<link>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-apache-mysql-etc-part-2/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-apache-mysql-etc-part-2/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 07:32:14 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[dd-wrt]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web server]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/08/28/setting-up-a-freebsd-62-web-server-apache-mysql-etc-part-2/</guid>
		<description><![CDATA[I admit that I cheated, but since I&#8217;m newbie in FreeBSD, I am allowed to follow another very nice tutorial on deploying a server found on Open Addict.  My job is not to recite the tutorial to you.  Instead I will comment on the tutorial&#8217;s instructions and point out any roadblocks I ran [...]]]></description>
			<content:encoded><![CDATA[<p>I admit that I cheated, but since I&#8217;m newbie in FreeBSD, I am allowed to follow another <a href="http://www.openaddict.com/deploying_a_freebsd_6_2_server.html" rel="nofollow" >very nice tutorial on deploying a server</a> found on Open Addict.  My job is not to recite the tutorial to you.  Instead I will comment on the tutorial&#8217;s instructions and point out any roadblocks I ran into during my installation process.<span id="more-49"></span></p>
<p><strong>Setup Useful Daemons</strong></p>
<p>The only daemon I use is ntcd used for time synchronization.  &#8220;net-snmp&#8221; will be paired with Cacti (a nice network graphic utility with a web interface) so it *could* be useful to you, but for the time being, it doesn&#8217;t do much for me.  I will most likely revisit net-snmp &amp; Cacti later as my site gets more popular.</p>
<p><strong>Configuring Mail Services</strong></p>
<p>I have to admit that I was not able to figure out how to configure mail services on this server.  I&#8217;m pretty sure I followed all the steps correctly, so either something is wrong in the steps or I have an invisible firewall somewhere on my network that doesn&#8217;t allow me to send mail from my server.  In any case, you might be better off looking for a different tutorial online about setting up mail services on FreeBSD.  For you experts, please let me know if any of you have had experience setting up a mail service on FreeBSD or know of a reliable tutorial.<br />
<strong>*Update* &#8211; </strong>10/10/2007<br />
I was able to successfully setup sendmail and wrote a quick guide about it, <a href="http://omninoggin.com/2007/10/10/setting-up-sendmail-on-freebsd-62/">Setting up Sendmail on FreeBSD 6.2</a>.  Enjoy!</p>
<p><strong>Configuring Web Services</strong></p>
<p>Overall the Apache instructions are pretty good.  Again I skipped the squirrelmail install since I was not able to get mail services to work.</p>
<p>I also ran into a minor problem because my Wordpress&#8217;s &#8220;Lazyest Gallery&#8221; plugin needs PHP GD2 Library to work.  There are no instructions on how to do this in the tutorial or on the internet (based on the saying, &#8220;There is so much information out on the net that it is very hard to find the information you need.&#8221;) .  After a couple trial-and-errors, this is what I did to get GD2 Library to work with PHP5:</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>lang<span style="color: #000000; font-weight: bold;">/</span>php5-extensions<span style="color: #000000; font-weight: bold;">/</span>; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></div></div>
<p>A customization screen will pop up with default extensions to install.  I unchecked everything and then check the GD Library option.  After that, I restarted Apache and it worked like magic.  Also, if you ever need to come back and reconfigure php5-extension, all you have to do is the following:</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>lang<span style="color: #000000; font-weight: bold;">/</span>php5-extensions<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> config <span style="color: #666666; font-style: italic;"># this will bring up the customization screen</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></div></div>
<p><strong>Configure System Graphing, powered by MySQL</strong></p>
<p>I followed the MySQL instructions and it worked like a charm.  Again I skipped Cacti setup for reasons I previously mentioned in the first paragraph.</p>
<p><strong>Configure Bind</strong></p>
<p>I skipped this step since I have a really nice router doing DNS resolution for me.</p>
<p>For the record, I have a Linksys WRT54G router with the DD-WRT firmware.  There are many after-market router firmwares out there promising the world.  I&#8217;ve tried a few high rated ones but in the end I chose DD-WRT for a couple important reasons.</p>
<ol>
<li>It&#8217;s so stable that uptimes of greater than 3 months is common.  The reason why it&#8217;s usually never more than 1 year is because I live in California.  Damn that Arnold.</li>
<li>It has so many built-in features that you would otherwise have to setup on an independent Unix machine.  Some uncommon things I&#8217;ve used it for are traffic tunneling, DNS resolution, dynamic DNS updating (works with Zonedit and other dynamic DNS services), QoS, and Samba mount.</li>
</ol>
<p>Okay, I&#8217;m out of my soap box now.</p>
<p><strong>Conclusion</strong></p>
<p>Setting up Apache, MySQL, PHP was not as hard as I thought.  Little did I know that the hardest part will come when I start <a href="http://omninoggin.com/2007/09/05/setting-up-a-freebsd-62-web-server-optimizing-apache-part-4/">optimizing the server.</a></p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-apache-mysql-etc-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting up a FreeBSD 6.2 Web Server: Installing OS (Part 1)</title>
		<link>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-part-1/</link>
		<comments>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-part-1/#comments</comments>
		<pubDate>Sun, 26 Aug 2007 08:15:07 +0000</pubDate>
		<dc:creator>Thaya Kareeson</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">http://omninoggin.com/2007/08/26/setting-up-a-freebsd-62-web-server-part-1/</guid>
		<description><![CDATA[This post will cover installing FreeBSD 6.2.  FreeBSD was recommended to me by my friend Ben Connelly because it is known to be the most stable and secure Unix OS out there.  After I installed it, I became even more pleased at my decision because of the package manager and BSD ports.  [...]]]></description>
			<content:encoded><![CDATA[<p>This post will cover installing FreeBSD 6.2.  FreeBSD was recommended to me by my friend Ben Connelly because it is known to be the most stable and secure Unix OS out there.  After I installed it, I became even more pleased at my decision because of the package manager and BSD ports.  If installing using the package manager doesn&#8217;t work, you can most likely make port-install work on the same software.  Also since it is so stable, you are 99% sure that anything you install WILL work.  <span id="more-48"></span></p>
<p>I followed this really <a href="http://www.openaddict.com/installing_freebsd_6_2.html" rel="nofollow" >nice tutorial</a> about installing a FreeBSD 6.2 OS.  When you want to setup a server, it is typically best to perform a minimal installation (as shown how to do in the tutorial at Open Addict).  I have to admit that there were a few typos in the tutorial that jump up and bit me later on in the process.  I will try to point those out here since there aren&#8217;t many question &amp; answers about this tutorial in the Open Addict forums.</p>
<p>All of the instructions are good up until the section called &#8220;Rebuild the World, and Recompile the Kernel&#8221;.  Rebuilding the world is usually done if you want to upgrade your OS (kind of like a windows update, except a lot more involved than clicking &#8220;Install&#8221;).  If you have just downloaded your FreeBSD OS, you probably have the latest version of the OS with the latest patch and you probably won&#8217;t have to rebuild the world.  Even if you do not need to rebuild the world you should perform some of the steps shown in the tutorial just because it will save you time later on.</p>
<p><strong>Installing Basic Packages</strong></p>
<p>In the step below:</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pkg_add <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">bash</span>; pkg_add <span style="color: #660033;">-r</span> cvsup-without-gui; pkg_add <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">nano</span></pre></div></div>
<p>I recommend omitting &#8220;pkg_add -r nano&#8221; because:<br />
1. FreeBSD minimal install already comes with &#8220;vi&#8221; as a text editor.<br />
2. &#8220;nano&#8221; is a crappy text editor (IMHO).<br />
3. &#8220;vi&#8221; is the industry standard (I&#8217;ve used &#8220;vi&#8221; since college).<br />
4. The longer you use &#8220;vi&#8221; the more powerful it becomes as you learn tricks to speed up your productivity.</p>
<p>So if you heavily use &#8220;vi&#8221; like me, I would recommend doing &#8220;pkg_add -r vim&#8221; instead.  (FYI, vim = &#8220;VI-Improved&#8221;)</p>
<p><strong>Setting Bash as the Default Shell</strong></p>
<p>I like bash, so I recommend this step also.</p>
<p><strong>Updating Source and Ports Tree</strong></p>
<p>If you see you need to upgrade your FreeBSD then you will need to update your source tree.  The tutorial said I should use RELENG as release tag.  I&#8217;ve tried it and it doesn&#8217;t work.  I had to use RELENG_6_2 to get my source tree updated.  I found some helpful documentation and update servers for cvsup.</p>
<p>You should update your ports tree as it will be very useful later when you are setting up things like Apache, MySQL and other software.</p>
<p><strong>Rebuilding the World</strong></p>
<p>You may skip this step if you do not want to update your the FreeBSD with the latest patches.  The tutorial is pretty good here except for one typo about &#8220;ZUES&#8221;.  Just replace that with &#8220;ATHENA&#8221; and it will make a lot more sense.  Also if you are not going to rebuild the world, it is good to do the last two steps:</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pkg_add <span style="color: #660033;">-r</span> ncftp; pkg_add <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">wget</span>
adduser <span style="color: #000000; font-weight: bold;">&lt;</span>yourname<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>
<p><strong>Conclusion</strong></p>
<p>Now I have a rad OS, on to <a href="http://omninoggin.com/2007/08/28/setting-up-a-freebsd-62-web-server-apache-mysql-etc-part-2/">setting up services!</a></p>
<hr />
<small>Copyright &copy; Thaya Kareeson 2007-2009. <a href="http://omninoggin.com/terms-of-use/">Terms of Use</a>.<br /> This feed is for personal, non-commercial use only. The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright.<br/>(Digital Fingerprint: 3c9448923b0370185951175e004b25f5 (38.107.191.90) )</small>]]></content:encoded>
			<wfw:commentRss>http://omninoggin.com/freebsd/setting-up-a-freebsd-62-web-server-part-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
