<?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>dragffy.com &#187; HowTo</title>
	<atom:link href="http://dragffy.com/blog/posts/tag/howto/feed" rel="self" type="application/rss+xml" />
	<link>http://dragffy.com/blog</link>
	<description>The development, documentation, and blogging domain of Gabriel Dragffy.</description>
	<lastBuildDate>Sun, 29 Apr 2012 11:55:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Resize all images in current directory using ImageMagick</title>
		<link>http://dragffy.com/blog/posts/resize-all-images-in-current-directory-using-imagemagick</link>
		<comments>http://dragffy.com/blog/posts/resize-all-images-in-current-directory-using-imagemagick#comments</comments>
		<pubDate>Tue, 11 Mar 2008 17:02:15 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[photo manipulation]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/posts/resize-all-images-in-current-directory-using-imagemagick</guid>
		<description><![CDATA[find . -iname "*.jpg" -print0&#124;xargs -0 -I {} convert -quality 60 -resize 461x317 {} {}]]></description>
			<content:encoded><![CDATA[<p><code>find . -iname "*.jpg" -print0|xargs -0 -I {} convert -quality 60 -resize 461x317 {} {}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/resize-all-images-in-current-directory-using-imagemagick/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping user data seperate from system data on Apple OS X</title>
		<link>http://dragffy.com/blog/posts/keeping-user-data-seperate-from-system-data-on-apple-os-x</link>
		<comments>http://dragffy.com/blog/posts/keeping-user-data-seperate-from-system-data-on-apple-os-x#comments</comments>
		<pubDate>Mon, 25 Feb 2008 12:54:13 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tiger]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/posts/keeping-user-data-seperate-from-system-data-on-apple-os-x</guid>
		<description><![CDATA[One of the things I grew to like about Linux was the /home directory. Any data for a user was always stored there. Furthermore, you could easily have that home directory on a different disc so when you deleted your system, you didn&#8217;t lose your user data too. Under Windows I did the same thing [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I grew to like about Linux was the /home directory. Any data for a user was always stored there. Furthermore, you could easily have that home directory on a different disc so when you deleted your system, you didn&#8217;t lose your user data too.</p>
<p><span id="more-18"></span></p>
<p>Under Windows I did the same thing by relocating &#8216;My Documents&#8217; but it was never very succesful because remnants of your data always remained intermingled with the system. Having moved to OS X I found the default installation was to dump everything on one partition. OS X is a superior system and doesn&#8217;t suffer as badly , but you are still inconvenienced  if you want to reformat and start afresh.</p>
<p>I did read several articles on the net about keeping your user data seperate, but all were complicated. I have developed a method that is very safe and easy to do. You will need to use the Terminal application to type several commands.</p>
<p>The easiest way to go about this is to wait until you are ready to reformat again. Make sure you <strong>BACKUP ALL YOUR DATA ON TO AN EXERNAL DRIVE</strong>. Restart with the installation disc. Once it starts up go to Utilities and choose Disk Utility.  From the left pane select your internal hard drive in my case &#8220;74.5GB ST98823AS&#8221; and now you can choose the &#8220;Partition&#8221; tab. Under &#8220;volume scheme&#8221; choose a 2 partition layout. It will now show your disc split in two at about half way, drag the slider up/down so that you end up giving about 20GB to the top part. This is where your system and applications will be installed. Name the paritions if you so wish and apply changes. Then continue the installation as normal.</p>
<p>When you boot in to your new system start up the Terminal application. What follows next are some commands for you to type in to the terminal. These will be run as a super-user (hence sudo) and will require you to enter your password to execute properly. Ensure you get these commands correct as you will regret doing a rush-job here. Firstly, you should remember how you named your partitions, if you can&#8217;t remember then have a look in Finder. Or even better: type the following in the terminal:</p>
<p><code>ls /Volumes</code></p>
<p>I will refer to the paritions as &#8220;system&#8221; and &#8220;userpart&#8221;, replace these with the correct names of your partitions. Now, move your user folders off the system partition on to userpart:</p>
<p><code>sudo mv /Volumes/system/Users/ /Volumes/userpart/</code></p>
<p>Then move the old &#8220;Users&#8221; folder out of the way, and create a link back to it:</p>
<p><code>sudo mv /Users /Users.bk<br />
sudo ln -s /Volumes/userpart/Users /Users</code></p>
<p>What you have done is to move the Users directory on to another partition and then create a softlink back to it. This means that all applications and OS X will still continue to use /Users on the system drive, but that just points to the user drive. The advantage is you don&#8217;t need to perform any special configuration to inform OS X or your applications of the change, they are unware of any change.</p>
<p>If you have any problems don&#8217;t blame me!</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/keeping-user-data-seperate-from-system-data-on-apple-os-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache 2 with SSL on FreeBSD 6</title>
		<link>http://dragffy.com/blog/posts/apache-2-with-ssl-on-freebsd-62</link>
		<comments>http://dragffy.com/blog/posts/apache-2-with-ssl-on-freebsd-62#comments</comments>
		<pubDate>Mon, 15 Oct 2007 15:30:37 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/articles/apache-2-with-ssl-on-freebsd-62</guid>
		<description><![CDATA[It wasn&#8217;t exactly trivial installing and configuring Apache 2 on FreeBSD. Much of the configuration had to be done manually, which depending on your point-of-view is good or bad. This describes how I went about getting Apache 2 with SSL support up and running on FreeBSD 6. I did this on 6.2 but it should [...]]]></description>
			<content:encoded><![CDATA[<p>It wasn&#8217;t exactly trivial installing and configuring Apache 2 on FreeBSD. Much of the configuration had to be done manually, which depending on your point-of-view is good or bad. This describes how I went about getting Apache 2 with SSL support up and running on FreeBSD 6. I did this on 6.2 but it should equally apply to  6.x.<span id="more-3"></span></p>
<p>Note: These instructions use &#8220;www.example.com&#8221; as an example.</p>
<p>To Install Apache2:</p>
<p>After the UpdatePorts, install apache2 as follows:</p>
<p><code> cd /usr/ports/www/apache2 </code></p>
<pre>make install clean</pre>
<p>Enable Apache2 in <code>/etc/rc.conf</code> by adding the following&#8230;<br />
<code> </code></p>
<pre>apache2_enable="YES"

apache2ssl_enable="YES"</pre>
<p>Setup the certificates:</p>
<pre>mkdir /usr/local/etc/apache2/ssl.crt

mkdir /usr/local/etc/apache2/ssl.key</pre>
<p>Edit <code>/usr/local/etc/apache2/ssl.conf</code> and set the following&#8230;</p>
<pre>SSLCertificateFile /usr/local/etc/apache2/ssl.crt/server.crt

SSLCertificateKeyFile /usr/local/etc/apache2/ssl.key/server.key</pre>
<p>After saving the certificates in their appropriate directories run:</p>
<p><code>chmod -R 700 /usr/local/etc/apache2/ssl.key</code></p>
<p>Edit <code>/usr/local/etc/apache2/httpd.conf</code> and set the following:</p>
<pre>ServerAdmin mshurst@engmail.uwaterloo.ca
UseCanonicalName On
DocumentRoot "/homepages"
UserDir disabled
ServerSignature Off</pre>
<p>In <code>&lt;Directory "/homepages"&gt;</code> set&#8230;</p>
<pre>Options FollowSymlinks Multiview Includes ExecCGI

AllowOverride All</pre>
<p>Comment out the <code>&lt;Directory /home/*/public_html&gt;</code> section and replace it with&#8230;</p>
<pre>&lt;Directory /u1/*/public_html&gt;
   Options All -Indexes
   AllowOverride All
   Order allow,deny
   Allow from all
&lt;/Directory&gt;

&lt;Directory /u2/*/public_html&gt;
   Options All -Indexes
   AllowOverride All
   Order allow,deny
   Allow from all
&lt;/Directory&gt;

&lt;Directory /u3/*/public_html&gt;
   Options All -Indexes
   AllowOverride All
   Order allow,deny
   Allow from all
&lt;/Directory&gt;

&lt;Directory /u4/*/public_html&gt;
   Options All -Indexes
   AllowOverride All
   Order allow,deny
   Allow from all
&lt;/Directory&gt;</pre>
<p>Restart apache2 to start using the new certificate&#8230;</p>
<p><code><br />
/usr/local/etc/rc.d/apache2.sh stop<br />
/usr/local/etc/rc.d/apache2.sh start<br />
</code></p>
<p>To enable CGIWrap<br />
Allows execution of cgi scripts using user permissions</p>
<p>To install cgiwrap&#8230;</p>
<pre>cd /usr/ports/www/cgiwrap
make
make install</pre>
<p>Add AddHandler cgi-script .cgi to <code>/usr/local/etc/apache2/httpd.conf</code>.</p>
<p>Access control files are required for cgiwrap. To allow open access&#8230;</p>
<p><code>touch /usr/local/etc/cgiwrap.deny</code></p>
<p>To enable the &#8220;debug&#8221; version of cgiwrap&#8230;</p>
<p><code>chmod 4755 /usr/local/www/cgi-bin/cgiwrapd</code></p>
<p>In <code>&lt;Directory "/usr/local/www/cgi-bin"&gt;</code> set&#8230;</p>
<pre>  <code>Options ExecCGI</code></pre>
<p>To restrict &#8220;debug&#8221; access to on-campus only, add the following to httpd.conf&#8230;</p>
<p><code> &lt;Location /cgi-bin/cgiwrapd&gt; </code></p>
<pre>     order deny,allow
     deny from all
     allow from 129.97
&lt;/Location&gt;

&lt;Location /cgi-bin/nph-cgiwrapd&gt;
     order deny,allow
     deny from all
     allow from 129.97
&lt;/Location&gt;</pre>
<p>To enable Server Side Includes<br />
Allows server side parsing of html files.</p>
<p>Make the following changes in <code>/usr/local/etc/apache2/httpd.conf</code>&#8230;</p>
<p>uncomment (or add)</p>
<p><code>AddType text/html .shtml</code></p>
<p><code>AddHandler server-parsed .shtml</code></p>
<p>Allow <code>index.shtml</code> to be a default page</p>
<p><code>DirectoryIndex index.html ... index.shtml</code></p>
<p>Add the &#8220;Includes&#8221; option</p>
<p><code>Options Indexes FollowSymLinks MultiViews ExecCGI Includes</code></p>
<p><strong>Customized Virtual Host settings</strong></p>
<pre>   * Make the following changes to <code>/usr/local/etc/apache2/ssl.conf</code>...</pre>
<pre>#&lt;VirtualHost _default_:443&gt;

&lt;VirtualHost www.eng.uwaterloo.ca:443&gt;
DocumentRoot "/homepages"
ServerName www.eng.uwaterloo.ca

ServerAdmin mshurst@engmail.uwaterloo.ca</pre>
<pre>   * Configure logging to include the virtual host name by adding %v to the end of the LogFormat entry in httpd.conf</pre>
<p><code>LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\" %v" combined</code></p>
<pre>   * Add the following CustomLog entry to the www.example.com virtual host entry.</pre>
<p><code>CustomLog /var/log/httpd-sydewww.log combined</code></p>
<pre>   * Update the <code>rollapachelogs.csh</code> script to include the <code>httpd-sydewww.log</code> files.</pre>
<p>==<br />
Rolling the Apache logs ==<br />
The logs must be rolled occasionally to prevent the disk from filling with logs. This isn&#8217;t as trivial as it should be, because:</p>
<pre>   * If you roll the logs, and send a SIGTERM to httpd, all httpd processes will abort, possibly resulting in incomplete database updates etc

   * If you roll the logs, and send a SIGUSR1 to httpd, you must wait some unknown period of time to allow all child httpd processes to complete, before compressing logs.</pre>
<p>Alternatives:</p>
<pre>   * Don't compress the logs, and use newsyslog with signal 30 (USR1)

   * pipe the logs in httpd.conf through some other process

   * use a custom log roller script</pre>
<p>To do the latter, run:</p>
<p><code> fetch -o /usr/local/bin/rollapachelogs.csh <a href="http://www.freebsd.uwaterloo.ca/rollapachelogs.csh" class="external free" title="http://www.freebsd.uwaterloo.ca/rollapachelogs.csh" rel="nofollow">http://www.freebsd.uwaterloo.ca/rollapachelogs.csh</a></code></p>
<pre>chmod u+x /usr/local/bin/rollapachelogs.csh</pre>
<p>Add to <code>/etc/crontab</code>:<br />
<code> </code></p>
<pre># rotate apache logs

0       3       *       *       *       root    /usr/local/bin/rollapachelogs.csh</pre>
<p>Configuring Name-based virtual hosting</p>
<p>Set the folloowing in <code>/usr/local/etc/apache2/httpd.conf</code>&#8230;</p>
<p><code> NameVirtualHost *</code></p>
<pre># Default VirtualHost is listed here

# others are listed in /usr/local/etc/apache2/Includes/vhosts.conf

&lt;VirtualHost *&gt;
   ServerName www.eng.uwaterloo.ca
   ServerAlias www.eng
   DocumentRoot /homepages
   UserDir public_html
   ErrorDocument 403 /lookup.cgi
   ErrorDocument 404 /lookup.cgi
   ErrorDocument 410 /lookup.cgi
&lt;/VirtualHost&gt;</pre>
<p>Then add the other virtual hosts to <code>/usr/local/etc/apache2/Includes/vhosts.conf</code>&#8230;</p>
<pre>   ServerName www.engcomp.uwaterloo.ca
   ServerAlias www.engcomp www.engineeringcomputing.uwaterloo.ca www.engineeringcomputing
   DocumentRoot /u2/engcomp/public_html

   &lt;Directory /u2/engcomp/public_html&gt;      Options All
      AllowOverride All
      Order allow,deny
      Allow from all
   &lt;/Directory&gt;

   ScriptAlias /cgi-bin/ "/u2/eng_comp/public_html/cgi-bin/"
   &lt;Directory "/u2/eng_comp/public_html/cgi-bin/"&gt;
      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
   &lt;/Direcotry&gt;</pre>
<p>Restrict access to printman pages</p>
<pre>&lt;Directory "/u2/eng_comp/public_html/printers"&gt;
   Order deny,allow
   Deny from all
   Allow from 129.97
&lt;/Directory&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/apache-2-with-ssl-on-freebsd-62/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to DNS</title>
		<link>http://dragffy.com/blog/posts/introduction-to-dns</link>
		<comments>http://dragffy.com/blog/posts/introduction-to-dns#comments</comments>
		<pubDate>Sun, 30 Sep 2007 16:07:35 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[guide]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/posts/introduction-to-dns</guid>
		<description><![CDATA[If you are a beginner with DNS then you might find this quick article useful. Recently I have had to play with various DNS records to get mail servers and web servers working. Introduction to DNS DNS stands for Domain Name System. In simple terms it&#8217;s like this: people are good at remembering and writing [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a beginner with DNS then you might find this quick article useful. Recently I have had to play with various DNS records to get mail servers and web servers working. <span id="more-10"></span></p>
<h4>Introduction to DNS</h4>
<p>DNS stands for Domain Name System. In simple terms it&#8217;s like this: people are good at remembering and writing names. Computers are great with numbers and calculations. When you open your browser you may type in an address such as <em>google.com</em> or <em>fartymarty.com</em>, but that is not what the computers use. They use numbers, each and every computer on the internet has a unique number assigned to it. This is called an IP address. This is where DNS comes in to play, it translates your names into numbers (computer addresses). For example if you go to <em>google.com</em> your browser will send a DNS query, the reply comes back has the numeric IP address of the google server, which in my case is 72.14.207.99. If you were to go to this IP or type in google.com you would get to the same place!</p>
<p>If you have your own domain name you may need to configure the DNS for it, so people typing in <em>yourdomain.com</em> are given back the correct IP address of your server &#8211; otherwise they won&#8217;t be able to find your site!</p>
<h4>&#8216;A&#8217; record</h4>
<p>Firstly we will concern ourselves with three DNS record types, the most commonly used ones. Perhaps the most useful is the A record. This is what will convert your domain <em>mydomain.com</em> in to a numbered address that computers use (IP address). Thus, if you have a web server (for example) listening at the address 12.34.56.78 and you want to be able to type in <em>mydomain.com</em> to your browser to visit it, you will need to create an A record. The cool thing is that mail servers will fall back to using it in the event you haven&#8217;t created an MX record&#8230; something that we are going to move on to.</p>
<h4>MX record</h4>
<p>MX record stands for &#8216;mail exchanger&#8217; and it is unique to email servers. If you have an email server at 12.34.56.78 and you want it to be able to receive emails that people address to you at <em>mydomain.com</em> you will want to create an MX DNS record. This record includes the hostname, the priority and the domain. Your first MX entry will probably want to have a priority of 0 or 10. The hostname for the mail server can be (for example) <em>mail.mydomain.com</em> and your domain can be <em>mydomain.com</em>. Whatever hostname you use for the mail server must also have an appropriate A record. So you might end up with something like this:</p>
<table>
<tr>
<th>NAME</th>
<th>TYPE</th>
<th>DATA</th>
</tr>
<tr>
<td>mydomain.com</td>
<td>A</td>
<td>12.34.56.78</td>
</tr>
<tr>
<td>mail.mydomain.com</td>
<td>A</td>
<td>12.34.56.78</td>
</tr>
<tr>
<td>mydomain.com</td>
<td>MX</td>
<td>10 mail.mydomain.com.</td>
</tr>
</table>
<p>Notice the &#8217;10&#8242; for the MX server, denoting priority. You can configure backup mail servers in case the primary one fails. You would create another MX record for the same name, with a higher priority (20 for example) and the address of another server. So ultimately you could have:</p>
<table>
<tr>
<th>NAME</th>
<th>TYPE</th>
<th>DATA</th>
</tr>
<tr>
<td>mydomain.com</td>
<td>A</td>
<td>11.11.11.11</td>
</tr>
<tr>
<td>mail.mydomain.com</td>
<td>A</td>
<td>11.11.11.11</td>
</tr>
<tr>
<td>mail2.mydomain.com</td>
<td>A</td>
<td>22.22.22.22</td>
</tr>
<tr>
<td>mydomain.com</td>
<td>MX</td>
<td>10 mail.mydomain.com.</td>
</tr>
<tr>
<td>mydomain.com</td>
<td>MX</td>
<td>20 mail2.mydomain.com.</td>
</tr>
</table>
<h4>CNAME record</h4>
<p>That leaves CNAME records. These are easy and are basically aliases. They come in useful when you want to create wildcards and subdomains. It is normally a good idea to create at least one CNAME for <em>www</em> so that if someone types in <em>www.mydomain.com</em> they will still get to <em>mydomain.com</em>:</p>
<table>
<tr>
<th>NAME</th>
<th>TYPE</th>
<th>DATA</th>
</tr>
<tr>
<td>www</td>
<td>CNAME</td>
<td>mydomain.com.</td>
</tr>
</table>
<p>And that&#8217;s it for the basics. Just be sure you use IP addresses for some things and hostnames for the others. &#8216;A&#8217; records always resolve to an IP address. MX and CNAME records resolve to a hostname. Hope that helps you.</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/introduction-to-dns/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 5 Server on FreeBSD</title>
		<link>http://dragffy.com/blog/posts/mysql-5-server-on-freebsd</link>
		<comments>http://dragffy.com/blog/posts/mysql-5-server-on-freebsd#comments</comments>
		<pubDate>Fri, 28 Sep 2007 15:35:29 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[guide]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/articles/mysql-5-server-on-freebsd-6</guid>
		<description><![CDATA[MySQL is a very popular relational database. It can be used by many different applications and thankfully the installation procedure is a snap. For this tutorial we will be compiling MySQL 5.0.45 from ports with some custom options. I did this on FreeBSD 6.2 release but it should work on FreeBSD 6.3 and 6.x.Change to [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL is a very popular relational database. It can be used by many different applications and thankfully the installation procedure is a snap. For this tutorial we will be compiling MySQL 5.0.45 from ports with some custom options. I did this on FreeBSD 6.2 release but it should work on FreeBSD 6.3 and 6.x.<span id="more-6"></span>Change to the MySQL ports directory</p>
<pre><code>cd /usr/ports/databases/mysql50-server</code></pre>
<h4>Compile and install with custom options</h4>
<p>The following should be typed all on one line, the double backslash (\\) indicates that it has been broken up for better viewing on the internet.</p>
<pre><code>make WITH_CSV=yes WITH_FEDERATED=yes WITH_ARCHVIVE=yes \\
WITH_CHARSET=utf8 WITH_COLLATION=utf8__general_ci install clean</code></pre>
<p>This sets it up to use UTF8 as the default character sets and collations, of course you can change these. It also gives support to alternative database formats such as CSV, I don&#8217;t actually use them at the moment but thought I&#8217;d add them for good measure. For a production system it is good practice to install only what is absolutely necessary, so if you don&#8217;t need them for a production environment you might want to leave them out.</p>
<h4>Starting MySQL on boot</h4>
<p>To start the server you will need to make sure it is enabled in rc.conf, this will also make it start on boot-up:</p>
<pre><code>echo 'mysql_enable="YES"' &gt;&gt; /etc/rc.conf</code></pre>
<p>Now you will be able to start the server:</p>
<pre><code>/usr/local/etc/rc.d/mysql-server start</code></pre>
<h4>Securing MySQL</h4>
<p>By default MySQL is installed in an insecure way. The root user (different to the system root) can authenticate without a password. It is best to set a good password for the MySQL root user&#8230;</p>
<pre><code>mysql -u root -p</code></pre>
<p>It will now prompt you for the current password.  After you enter the current password, you will enter the mysql client where you should use something like the following query to change your password:</p>
<pre><code>SET PASSWORD FOR root = PASSWORD('secret');</code></pre>
<p>In this case root&#8217;s password is changed to the word &#8220;secret&#8221;.  There is only one problem with this.  It will only change root&#8217;s password for connections from wherever you are currently connected from, probably localhost.  mysql usually has another entry for root for myhost.www.example.org.  To change this you can use the following query:</p>
<pre><code>SET PASSWORD FOR root@"myhost.www.example.org" = PASSWORD('secret');</code></pre>
<p>Of course you could also use a different password if you would like, although I&#8217;m not sure what purpose this would serve.  If you want to try out this second password you can connect in the following way:</p>
<pre><code>mysql -h myhost.www.example.org -u root -p</code></pre>
<p>If you want to check for all root entries you can do the following:</p>
<pre><code>mysql -u root -p mysql</code></pre>
<p>Then enter the following query:</p>
<pre><code>SELECT Host, User, Password FROM user WHERE User = 'root';</code></pre>
<h4>MySQL Config File</h4>
<p>If you want to use a config file for MySQL you can copy either <code>my-small.cnf</code>, <code>my-medium.cnf</code>, <code>my-large.cnf</code>, or <code>my-huge.cnf</code> to <code>/etc</code>:</p>
<pre><code>cp /usr/local/share/mysql/my-small.cnf /etc/my.cnf</code></pre>
<p>Edit at will!</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/mysql-5-server-on-freebsd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Lighttpd 1.4 and PHP 5 to work on FreeBSD</title>
		<link>http://dragffy.com/blog/posts/getting-lighttpd-14-and-php-5-to-work-on-freebsd</link>
		<comments>http://dragffy.com/blog/posts/getting-lighttpd-14-and-php-5-to-work-on-freebsd#comments</comments>
		<pubDate>Wed, 26 Sep 2007 15:58:37 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/posts/getting-lighttpd-14-and-php-5-to-work-on-freebsd</guid>
		<description><![CDATA[Firstly let me just say that I had quite a few problem with Lighttp (aka Lighty), and some of them related to PHP. However, I now have Lighty, PHP, and MySQL playing nicely and&#8230; it&#8217;s fast! This was tested with: Lighty 1.4.18 and PHP 5.2.3_1 on FreeBSD 6.2.For the installation of these programs it is [...]]]></description>
			<content:encoded><![CDATA[<p>Firstly let me just say that I had quite a few problem with Lighttp (aka Lighty), and some of them related to PHP. However, I now have Lighty, PHP, and MySQL playing nicely and&#8230; it&#8217;s fast! This was tested with: Lighty 1.4.18 and PHP 5.2.3_1 on FreeBSD 6.2.<span id="more-8"></span>For the installation of these programs it is almost a must to install from the latest ports snapshot. Installing from ports allows you to compile with certain options, for example CGI support, and it also ensures you have the very latest release. This is important since even right now the latest PHP5 in ports (5.2.3_1) has security problems, and so too does Lighttpd 1.4.18. Therefore it is vital that these can be updated at the soonest possible time. Personally, I don&#8217;t mind a few security niggles, and while Lighty retains a fairly small percentage of the server market it shouldn&#8217;t be subjected to bad attacks.</p>
<p>For me, I wanted to use Lighty and PHP with MySQL. The easiest way to install PHP and PHP MySQL support is to just install the php5-extensions. So change to their directory:</p>
<pre><code>cd /usr/ports/lang/php5-extensions</code>

<code>make config</code></pre>
<p>Now choose all the different extensions you want, which would normally include MySQL. When asked about PHP options make sure you enable FastCGI.</p>
<ul>For me I chose to install:</p>
<li>CLI</li>
<li>CGI</li>
<li>Suhosin</li>
<li>IPV6</li>
<li>FastCGI</li>
<li>Path Info</li>
</ul>
<p>If you don&#8217;t want all the fluff you can just change directory to</p>
<pre><code>cd /usr/ports/lang/php5</code>

<code>make config</code></pre>
<p>Choose the options here. In either case after running:</p>
<pre><code>make config</code></pre>
<p>you need to run:</p>
<pre><code>make install clean</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/getting-lighttpd-14-and-php-5-to-work-on-freebsd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mounting A Directory in Two or More Places without copying (for Linux)</title>
		<link>http://dragffy.com/blog/posts/mounting-a-directory-in-two-or-more-places-without-copying-for-linux</link>
		<comments>http://dragffy.com/blog/posts/mounting-a-directory-in-two-or-more-places-without-copying-for-linux#comments</comments>
		<pubDate>Sat, 01 Sep 2007 16:03:45 +0000</pubDate>
		<dc:creator>Gabe</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[Operating System]]></category>

		<guid isPermaLink="false">http://dragffy.com/blog/posts/mounting-a-directory-in-two-or-more-places-without-copying-for-linux</guid>
		<description><![CDATA[Have you ever wanted to show the contents of another user&#8217;s directory in a folder of your own? Or perhaps for whatever reason wanted to have the contents of a directory in two places at once, but without copying across? Well in Linux there is a way. Directories can be bound to other directories. The [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to show the contents of another user&#8217;s directory in a folder of your own? Or perhaps for whatever reason wanted to have the contents of a directory in two places at once, but without copying across? Well in Linux there is a way. Directories can be bound to other directories. The contents of one directory shows up in another, change one, and you change them both. Say for example you had the following directory <code>/usr/home/fred</code> but you wanted it to appear in Tom&#8217;s home directory also. <span id="more-9"></span>First you need to create the destination folder that you will later bind the directory to:</p>
<p><code>mkdir /usr/home/tom/freds_folder</code></p>
<p>Now we use the <code>mount</code> command with the bind option to bind Fred&#8217;s folder in to the folder inside Tom&#8217;s home directory:</p>
<p><code>mount -o bind /usr/home/fred /usr/home/tom/freds_folder</code></p>
<p>Voilla! You now have the same folder in two locations. Just remember that the permissions will stay exactly the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://dragffy.com/blog/posts/mounting-a-directory-in-two-or-more-places-without-copying-for-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

