<?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>gHacks technology news &#187; Tutorials Advanced</title>
	<atom:link href="http://www.ghacks.net/category/tutorials-advanced/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 20:00:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create your own customized Ubuntu Live CD</title>
		<link>http://www.ghacks.net/2009/11/16/create-your-own-customized-ubuntu-live-cd/</link>
		<comments>http://www.ghacks.net/2009/11/16/create-your-own-customized-ubuntu-live-cd/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 01:03:20 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[custom CD]]></category>
		<category><![CDATA[customized Linux]]></category>
		<category><![CDATA[live cd]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=18528</guid>
		<description><![CDATA[Here on Ghacks I have mentioned a few tools that allow you to create various types of Linux CDs. Most of these tools allow you to create Live CDs that are either images of your current working distribution or tools to create a Live CD with special packages. But none of these tools, so far, [...]]]></description>
			<content:encoded><![CDATA[<p>Here on Ghacks I have mentioned a few tools that allow you to create various types of Linux CDs. Most of these tools allow you to create Live CDs that are either images of your current working distribution or tools to create a Live CD with special packages. But none of these tools, so far, have allowed you to really get customized with your Live CD. You can&#8217;t specify desktop backgrounds or other configuration options. These are tasks that can really make creating a customized Live CD worth the effort.</p>
<p>In this article I am going to show you how to take a downloaded Ubuntu 9.10 iso image, mount it, customize it, and rebuild the Live CD from your newly customized image. This process can be time consuming, but is worth it. This entire process will be done from the command line, so get your fingers ready to type.</p>
<p><span id="more-18528"></span>The first thing you are going to need is an ISO image of a recent release. So hop on over to <a title="Ubuntu" href="http://www.ubuntu.com" target="_blank">Ubuntu&#8217;s web site</a> and download a fresh copy of 9.10. Once that is done you are ready to get to work.</p>
<p>Before you continue with the customization, you need to install some tools that will be necessary. From the command line issue this command:</p>
<p><code>sudo aptitude install squashfs-tools genisoimage</code></p>
<p>Now create an empty directory that will be used to work with the ISO image. Let&#8217;s create this in your users home directory, so issue the command:</p>
<p><em>mkdir ~/LIVECD</em></p>
<p>Now move that freshly downloaded iso image to the new directory and get ready to work.</p>
<p>The first thing to do is to mount the ISO image with the command. You will need to create a subdirectory to mount the image to, so issue the command:</p>
<p><em>mkdir ~/LIVECD/mount</em></p>
<p>Now mount the iso with the command:</p>
<p><em>sudo mount -o loop ubuntu-9.10-desktop-i386.iso ~/LIVECD/mount/</em></p>
<p>Now you will need to create yet another directory that you will then extract the contents of ~/LIVECD/mount to. Issue the command:</p>
<p><em>mkdir ~/LIVECD/extract-cd</em></p>
<p>And then extract with the command:</p>
<p><code>rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd</code></p>
<p>Now extract the squashfs file system with the command:</p>
<p><em>sudo unsquashfs mount/casper/filesystem.squashfs</em></p>
<p><code>sudo mv squashfs-root edit</code></p>
<p>The former of the above two commands will take some time. That is normal.<br />
If you will need network access with this system (and you probably will) you will need to edit the <strong>/etc/resolv.conf</strong> file so it has the proper DNS addresses. To do this just copy your current working <strong>resolve.conf </strong>file into the <strong>~/LIVECD/edit/etc </strong>directory with the command:</p>
<p><em>sudo cp /etc/resolve.conf ~/LIVECD/edit/etc/</em></p>
<p>Now to mount some important directories on your system:</p>
<p><code>sudo mount --bind /dev/ edit/dev<br />
sudo chroot edit<br />
mount -t proc none /proc<br />
mount -t sysfs none /sys<br />
mount -t devpts none /dev/pts</code></p>
<p>It will be very important later on to unmount these directories.</p>
<p>Next we make it so we avoid any locale issues and allow us to import GPG keys (if necessary) we issue the commands:</p>
<p><em>export HOME=/root</em></p>
<p><em>export LC_ALL=C</em></p>
<p>Now you can view all packages installed on the mounted ISO with the command:</p>
<p><code>dpkg-query -W --showformat='${Package}\n' | sort -nr | less</code></p>
<p>You can go through that list and delete any package you don&#8217;t want on the Live CD with the command:</p>
<p><em>aptitude purge PACKAGE_NAME</em></p>
<p>Where <em>PACKAGE_NAME</em> is the name of the package you want to remove. You can then install new packages on the Live CD by issuing the command:</p>
<p><em>aptitude install PACKAGE_NAME</em></p>
<p>Where <em>PACKAGE_NAME</em> is the name of the package to install.</p>
<p>What about desktop background images? Yes, you can customize this as well. If you look at the file <strong>/usr/share/gnome-background-properties/ubuntu-wallpapers.xml</strong> you will see where the default background is configured. You can edit that file, but then you will have to make sure the .png file you want to use is located in<strong> <strong>/usr/share/gconf/defaults/16_ubuntu-wallpapers</strong><span style="font-weight: normal">. </span></strong></p>
<p><strong><span style="font-weight: normal">You can also edit the <strong>/etc/gconf/gconf.xml.defaults/%gconf-tree.xml </strong>file to make any additional customization changes (fonts, colors, panel options, etc) within that file. Understand that what this file is a blank file which you will add new default values to. If you would rather just use the gconftool to edit these values you can do so with a command like:</span></strong></p>
<p><strong><span style="font-weight: normal"><em>gconftool-2 &#8211;direct &#8211;config-source xml:readwrite:/etc/gconf/gconf.xml.defaults &#8211;type string &#8211;set KEY &#8220;VALUE&#8221;</em></span></strong></p>
<p><strong><span style="font-weight: normal">Where KEY is the key you want to change and VALUE is the value to set for the key.</span></strong></p>
<p><strong><span style="font-weight: normal">There are a ton of other possible configurations you can undertake here. But for the scope of this article, we&#8217;ll leave it with what we have.</span></strong></p>
<p><strong><span style="font-weight: normal">It&#8217;s time to make sure to remove any temporary files that might be left behind from any package installation with the command:</span></strong></p>
<p><strong><em><span style="font-weight: normal">aptitude clean</span></em></p>
<p><span style="font-weight: normal">You can also remove the /etc/resolv.conf file you added with the command:</span></p>
<p><em><span style="font-weight: normal">rm /etc/resolv.conf</span></em></p>
<p><span style="font-weight: normal">Time to unmount the directories:</span></p>
<p><code><span style="font-weight: normal">umount /proc<br />
umount /sys<br />
umount /dev/pts<br />
exit<br />
sudo umount edit/dev</span></code></p>
<p>Put it all back together</p>
<p><span style="font-weight: normal">Now it&#8217;s time to piece everything back together. First you have to regenerate the manifest:</span></p>
<p><code><span style="font-weight: normal">chmod +w extract-cd/casper/filesystem.manifest<br />
sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' &gt; extract-cd/casper/filesystem.manifest<br />
sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop<br />
sudo sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop<br />
sudo sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop</span></code></p>
<p><span style="font-weight: normal">Now to compress the file system:</span></p>
<p><code><span style="font-weight: normal">sudo rm extract-cd/casper/filesystem.squashfs<br />
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs</span></code></p>
<p><span style="font-weight: normal">The above command will take some time.</span></p>
<p><span style="font-weight: normal">Now open up the </span>~/LIVECD/extract-cd/README.diskdefines<span style="font-weight: normal"> file and make any necessary changes.</span></p>
<p><span style="font-weight: normal">The next step requires you to remove the old md5 sums and calculate new sums. Do this with the following commands:</span></p>
<p><code><span style="font-weight: normal">cd extract-cd<br />
sudo rm md5sum.txt<br />
find -type f -print0 | xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee md5sum.txt</span></code></p>
<p><span style="font-weight: normal">Now it&#8217;s time to create the ISO image. Do that with the following commands:</span></p>
<p><code><span style="font-weight: normal">sudo mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../ubuntu-9.04.1-desktop-i386-custom.iso .</span></code></p>
<p><span style="font-weight: normal">Now, in the </span>~/LIVECD <span style="font-weight: normal">directory you will have your new ISO to burn to disk and use.</span></p>
<p><span style="font-weight: normal">Congratulations, you just created your own customized Ubuntu Live CD! </span></p>

	Tags: <a href="http://www.ghacks.net/tag/custom-cd/" title="custom CD" rel="tag">custom CD</a>, <a href="http://www.ghacks.net/tag/customized-linux/" title="customized Linux" rel="tag">customized Linux</a>, <a href="http://www.ghacks.net/tag/live-cd/" title="live cd" rel="tag">live cd</a>, <a href="http://www.ghacks.net/tag/ubuntu/" title="ubuntu" rel="tag">ubuntu</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/01/03/ubuntu-privacy-remix/" title="Ubuntu Privacy Remix (January 3, 2009)">Ubuntu Privacy Remix</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/02/18/get-to-know-linux-live-cd/" title="Get To Know Linux: Live CD (February 18, 2009)">Get To Know Linux: Live CD</a> (6)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
	<li><a href="http://www.ghacks.net/2006/12/20/why-you-should-switch-your-parents-pc-to-ubuntu/" title="Why you should switch your parents pc to ubuntu (December 20, 2006)">Why you should switch your parents pc to ubuntu</a> (20)</li>
	<li><a href="http://www.ghacks.net/2005/11/11/why-every-windows-user-needs-a-linux-live-cd/" title="Why Every Windows User Needs a Linux Live CD (November 11, 2005)">Why Every Windows User Needs a Linux Live CD</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/11/16/create-your-own-customized-ubuntu-live-cd/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Set up a Gnumed backend server</title>
		<link>http://www.ghacks.net/2009/11/10/set-up-a-gnumed-backend-server/</link>
		<comments>http://www.ghacks.net/2009/11/10/set-up-a-gnumed-backend-server/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 19:25:50 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[backend server]]></category>
		<category><![CDATA[gnumed]]></category>
		<category><![CDATA[medical practice server]]></category>
		<category><![CDATA[medical software]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=18370</guid>
		<description><![CDATA[Recently I covered the front-end of the Gnumed software designed for the medical industry (see &#8220;Let your medical practice go open source with Gnumed.&#8221;) In that article I showed you how to start working with Gnumed, but limited the installation to using the public servers. Because these public servers can not safely and securely hold [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I covered the front-end of the Gnumed software designed for the medical industry (see &#8220;<a title="Let your medical practice go open source with Gnumed" href="http://www.ghacks.net/2009/10/20/let-your-medical-practice-go-open-source-with-gnumed/" target="_blank">Let your medical practice go open source with Gnumed</a>.&#8221;) In that article I showed you how to start working with Gnumed, but limited the installation to using the public servers. Because these public servers can not safely and securely hold patient data, it is necessary to be able to set up your own backend server for this purpose. That is where this tutorial comes in.</p>
<p>In this article you will learn how to install everything you need to get your Gnumed front end connected to a locally hosted Gnumed backend server. I will be illustrating this on Ubuntu 9.10 with the end result being a local-only installation. Of course the necessary modifications to make this a LAN-based installation shouldn&#8217;t be difficult for you, once you have the local install up and running.</p>
<p><span id="more-18370"></span>This article comes a good time because this month it was just announced that new versions of Gnumed will include both medication management and prescription handling as well it was announced (on the <a title="Gnumed on Blogspot" href="http://gnumed.blogspot.com/" target="_blank">Gnumed Blog</a>) that a company is working on a billing feature for inclusion in a future release of Gnumed. That is certainly good news.</p>
<p>But, for now, let&#8217;s get on with the server installation.</p>
<p>Before we continue, make sure you have a working installation of PostgreSQL up and running. For more information on this take a look at my article &#8220;<a title="Basic postgresql server setup" href="http://www.ghacks.net/2009/11/10/basic-postgresql-server-setup/" target="_blank">Basic postgresql server setup</a>.&#8221;</p>
<p>Once you have PostgreSQL up and running you are ready to go.</p>
<p><strong>Installing the backend</strong></p>
<p>Go do the Gnumed server download mirror page and download the <em>gnumed-server</em> deb file (just click on a mirror). Once that file is downloaded open up a terminal window, cd to the directory you saved the file to, and issue the command:</p>
<p><em>sudo dpkg -i gnumed-server*</em></p>
<p>which will install the server.</p>
<p>As soon as the server is installed you have to create the databases used by Gnumed. Fortunately the Gnumed server package includes a simple command for this. From your terminal window issue the command:</p>
<p><em>sudo gm-bootstrap_server</em></p>
<p>This command will take some time to run its course. And, in the end, it might seem like you have some errors. These errors most likely mention a password &#8211; it is safe to ignore those errors.</p>
<p><strong>Configuration</strong></p>
<p>There are only two configurations you have to take care of. The first is to copy the proper .conf file into the <strong>~/.gnumed</strong> directory. The file you want to copy will be <strong>/etc/gnumed/gnumed-client.conf</strong>. Copy that with the command:</p>
<p><em>sudo cp /etc/gnumed/gnumed-client.conf ~/.gnumed</em></p>
<p>You really only need to make one change in that file. Look for this section beginning with:</p>
<p><em>[profile local GNUmed database]</em></p>
<p><em>host =</em></p>
<p>You want to change the <em>host = </em>line to reflect:</p>
<p><em>host = localhost</em></p>
<p>Now you need to make a change to a PostgreSQL file. The file in question is <strong>/etc/postgres/8.4/main/pg_hba.conf</strong>. You have to add a section to a very specific section of this file. Look for this line:</p>
<p><em># TYPE  DATABASE    USER    CIDR-ADDRESS    METHOD</em></p>
<p>Underneath that line you need to add:</p>
<p><em>local   samegroup   +gm-logins   md5</em></p>
<p>Once you have added that, save the file, and restart PostgreSQL with the command:</p>
<p><em>sudo /etc/init.d/postgresql-8.4 restart</em></p>
<p><strong>Log in</strong></p>
<p>Now it&#8217;s time to start up Gnumed and log in to your local server. When you start you will want the following login information:</p>
<ul>
<li><span style="background-color: #ffffff">Backend: local Gnumed database</span></li>
<li><span style="background-color: #ffffff">Username: any-doc</span></li>
<li><span style="background-color: #ffffff">Password: any-doc</span></li>
</ul>
<p>Hit the OK button to begin the login process. You will have to walk through a couple of windows (such as the language mismatch settings). But after that you will up and running with your own Gnumed backend server.</p>
<p><strong>Final thoughts</strong></p>
<p>It would behoove anyone medical practitioner looking to cut some corners (and wanting to take care of their own tech) to deploy Gnumed. And with the upcoming features, Gnumed is an outstanding solution.</p>

	Tags: <a href="http://www.ghacks.net/tag/backend-server/" title="backend server" rel="tag">backend server</a>, <a href="http://www.ghacks.net/tag/gnumed/" title="gnumed" rel="tag">gnumed</a>, <a href="http://www.ghacks.net/tag/medical-practice-server/" title="medical practice server" rel="tag">medical practice server</a>, <a href="http://www.ghacks.net/tag/medical-software/" title="medical software" rel="tag">medical software</a>, <a href="http://www.ghacks.net/tag/postgresql/" title="postgresql" rel="tag">postgresql</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/10/20/let-your-medical-practice-go-open-source-with-gnumed/" title="Let your medical practice go open source with Gnumed (October 20, 2009)">Let your medical practice go open source with Gnumed</a> (8)</li>
	<li><a href="http://www.ghacks.net/2009/11/10/basic-postgresql-server-setup/" title="Basic postgresql server setup (November 10, 2009)">Basic postgresql server setup</a> (5)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/11/10/set-up-a-gnumed-backend-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic postgresql server setup</title>
		<link>http://www.ghacks.net/2009/11/10/basic-postgresql-server-setup/</link>
		<comments>http://www.ghacks.net/2009/11/10/basic-postgresql-server-setup/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 23:09:50 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database user]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=18345</guid>
		<description><![CDATA[So many tool require databases. If you are a web administrator or a company with large stores of information, then you know the importance of databases. One of the most oft-used databases available is MySQL. But that is not the only player on the court. Another cross platform object-relational database management tool is PostgreSQL. Many [...]]]></description>
			<content:encoded><![CDATA[<p>So many tool require databases. If you are a web administrator or a company with large stores of information, then you know the importance of databases. One of the most oft-used databases available is MySQL. But that is not the only player on the court. Another cross platform object-relational database management tool is <a title="PostgreSQL" href="http://www.postgresql.org/" target="_blank">PostgreSQL</a>. Many people refer to PostgreSQL as the Oracle of the open source world. That is because PostgreSQL is dense with features but not as fast as MySQL. And where MySQL is a simple to use database management tool, PostgreSQL is often seen as overly complicated.</p>
<p>Of course there are variations on that opinion. But that is neither here nor there. The purpose of this tutorial is to help you get a PostgreSQL server up and running quickly and easily. To make this simple we will make this a part of our Ubuntu Server series, so all you have to do is have your Ubuntu Server up and running (see my article &#8220;<a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8221; to get started.) Once you have that server up and running you are ready to get your PostgreSQL server up.</p>
<p><span id="more-18345"></span><strong>Installation</strong></p>
<p>The first thing you need to do is to install the necessary software. Since this is Ubuntu, it&#8217;s quite easy. Open up a terminal window and issue the command:</p>
<p><em>sudo apt-get install postgresql</em></p>
<p>Once the software is installed you are ready to set it all up.</p>
<p><strong>Change the default user password</strong></p>
<p>One of the first steps you want to take is to change the default password for the user postgres. Sine we are using Ubuntu you will have to use the sudo command to change to the postgres user like so:</p>
<p><em>sudo su &#8211; postgres</em></p>
<p>You will have to enter your sudo password after which you will now be issuing commands as the user postgres. The next step is to gain access to the postgresql command prompt with the command:</p>
<p><em>psql</em></p>
<p>Your new command prompt will look like:</p>
<p><em>postgres=#</em></p>
<p>NOTE: The only user that can open the PostgreSQL prompt without defining a database to work with is the user postgres. Other users would have to gain access to the command prompt with a command like:</p>
<p><em>psql DB_NAME</em></p>
<p>Where <em>DB_NAME </em>is the name of an existing database.</p>
<p>Changing the password is as simple as issuing the command:</p>
<p><em>\password postgres</em></p>
<p>You will then be asked to enter a password and then verify that password.</p>
<p>Your default password has not been changed. You can exit from the PostgreSQL prompt by issuing the command:</p>
<p><em>\q</em></p>
<p><strong>Create a database</strong></p>
<p>Now, while still logged in as the postgres user, let&#8217;s create a database. For this you do not have to be logged into the PostgreSQL command prompt. Instead just issue the command:</p>
<p><em>createdb testdb</em></p>
<p>Where <em>testdb</em> is the name of the database you want to create. To check to make sure that database was created go back to the PostgreSQL command prompt (remember, the command <em>psql</em>) and enter:</p>
<p><em>\l</em></p>
<p>You should see a listing for your new database like:</p>
<p><code>testdb | postgres | UTF8 | en_US.UTF-8  | en_US.UTF-8</code></p>
<p>Once again, log out of the PostgreSQL command prompt with the command:</p>
<p><em>\q</em></p>
<p><strong>Create a user</strong></p>
<p>By default, the only user that can connect to a database is the postgres user. This will be of no help when you need to connect with another user. To create a new user (that can connect to databases) you would issue the command (as the user <em>postgres</em>):</p>
<p><em>createuser &#8211;superuser USERNAME</em></p>
<p>Where <em>USERNAME </em>is the name of the user you want to create.</p>
<p><strong>Final thoughts</strong></p>
<p>Now you should have a basic PostgreSQL installation with a test database and a user, besides postgres, that can work with the tools. Next time we work with PostgreSQL we&#8217;ll discuss more challenging issues with this outstanding database tool.</p>

	Tags: <a href="http://www.ghacks.net/tag/database/" title="database" rel="tag">database</a>, <a href="http://www.ghacks.net/tag/database-user/" title="database user" rel="tag">database user</a>, <a href="http://www.ghacks.net/tag/mysql/" title="mysql" rel="tag">mysql</a>, <a href="http://www.ghacks.net/tag/postgresql/" title="postgresql" rel="tag">postgresql</a>, <a href="http://www.ghacks.net/tag/ubuntu-server/" title="ubuntu server" rel="tag">ubuntu server</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/04/09/set-up-mysql-database-replication/" title="Set up MySQL database replication (April 9, 2009)">Set up MySQL database replication</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/" title="Install phpmyadmin for easy MySQL administration (December 20, 2008)">Install phpmyadmin for easy MySQL administration</a> (6)</li>
	<li><a href="http://www.ghacks.net/2008/11/05/have-wordpress-back-ups-emailed/" title="Have WordPress back-ups emailed (November 5, 2008)">Have WordPress back-ups emailed</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/07/30/database-monitoring-software-db2rss/" title="Database Monitoring Software Db2rss (July 30, 2009)">Database Monitoring Software Db2rss</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/01/12/backup-mysql-databases-in-linux-regularly/" title="Backup MySQL Databases In Linux Regularly (January 12, 2009)">Backup MySQL Databases In Linux Regularly</a> (11)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/11/10/basic-postgresql-server-setup/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Connect to your Samba server from Linux</title>
		<link>http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/</link>
		<comments>http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:03:42 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[samba shares]]></category>
		<category><![CDATA[smb.conf]]></category>
		<category><![CDATA[smbclient]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=18072</guid>
		<description><![CDATA[I have written a few articles on Samba here on Ghacks. And most people know how to connect to Samba shares via Windows. Generally speaking (when all is set up correctly) it&#8217;s just a matter of opening up Explorer and entering \\ADDRESS_OF_SAMBA_SERVER\SHARENAME to get to your Samba shares. But what about in Linux? How do [...]]]></description>
			<content:encoded><![CDATA[<p>I have written a few articles on Samba here on Ghacks. And most people know how to connect to Samba shares via Windows. Generally speaking (when all is set up correctly) it&#8217;s just a matter of opening up Explorer and entering \\ADDRESS_OF_SAMBA_SERVER\SHARENAME to get to your Samba shares. But what about in Linux? How do you go about connecting to Samba shares with the same operating system that is running the Samba server?</p>
<p>One would think that an easy task. It actually is, once you know how it is done.  And in this article I am going to show you two different ways of making the connection to your Samba server. You will need to have a working knowledge of how the Samba server is set up as well as a username/password configured on the Samba server. There are also a few steps to take on the desktop for one certain method of connection.</p>
<p>The two methods I will describe are: Using GNOME&#8217;s Connect To Server dialog and the command line. The latter will be used to show you how to set up auto mounting for Samba.</p>
<p><span id="more-18072"></span></p>
<p><strong>The graphical method</strong></p>
<div id="attachment_18074" class="wp-caption alignleft" style="width: 190px"><a rel="attachment wp-att-18074" href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/connect_to_server/"><img class="size-thumbnail wp-image-18074 " src="http://www.ghacks.net/wp-content/uploads/2009/11/connect_to_server-300x300.png" alt="Figure 1" width="180" height="180" /></a><p class="wp-caption-text">Figure 1</p></div>
<p>If you take a look at the GNOME Places menu you will see an entry labeled &#8220;Connect to server&#8230;&#8221;. This is what you want to use in order to connect to your Samba server. When you click on that a new window will open. From the Service type drop-down select &#8220;Windows share&#8221; (see Figure 1).</p>
<p>When you select that entry some of the configuration options will change. As you can see (in Figure 1), I have entered the necessary options to connect to a Samba server on my internal network. You will want to replace the information so it reflects your needs. The only tricky bit of information might be the Folder entry. If you are connecting to the root directory on the share you will not need to enter anything there. Say, for instance, you share is <strong>/media/samba/user<em>. </em><span style="font-weight: normal">If you want to connect to that directory leave the Folder entry blank. Say, however, you want to connect directly to a sub-folder within that share &#8211; you can enter that folder here. This, of course, isn&#8217;t needed because you can always traverse the sub-directories with simple navigation. <span style="background-color: #ffffff"><strong><span style="font-weight: normal">You can also choose to add a bookmark instantly, from in this window. </span></strong></span></span></strong></p>
<p><strong><span style="font-weight: normal"><span style="background-color: #ffffff"><strong><span style="font-weight: normal"> </span></strong></span></span></strong></p>
<p><strong><strong> </strong></strong></p>
<p><strong><strong> </strong></strong></p>
<div id="attachment_18075" class="wp-caption alignright" style="width: 190px"><a rel="attachment wp-att-18075" href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/connect_to_server_password/"><img class="size-thumbnail wp-image-18075 " src="http://www.ghacks.net/wp-content/uploads/2009/11/connect_to_server_password-300x300.png" alt="Figure 2" width="180" height="180" /></a><p class="wp-caption-text">Figure 2</p></div>
<p>Once you have all of the information entered click Connect and you will be greeted with a new window that requires you to enter a password. Also, if you do not supply a Domain name in the previous window, you will be required to enter it here.</p>
<p>You can also set this up to remember your password either until you logout or until, well, forever. Once you have entered the password/domain click the Connect button and a new Nautilus window will open inside of your Samba Share.</p>
<p><strong>Using the command line</strong></p>
<p>Now we&#8217;re going to use the command line to accomplish a similar goal. The biggest difference is that we are going to actually mount the Samba share into another directory, very much the same way we would mount a second hard drive.</p>
<p>There are a few pieces to put together before we actually take care of the mounting. First let&#8217;s create a directory that the Samba share will be mounted to. So from the terminal window issue the following command:</p>
<p><em>sudo mkdir /media/samba</em></p>
<p>Now let&#8217;s make sure our users can read/write to this directory with the command:</p>
<p><em>sudo chmod -R u+rw /media/samba</em></p>
<p>Okay now let&#8217;s make sure we can see the Samba shares from the command line. We&#8217;ll do that with the <em>smbclient </em>command like so:</p>
<p><em>smbclient -L //SAMBA_SERVER_ADDRESS</em></p>
<p>Where <em>SAMBA_SERVER_ADDRESS</em> is the actual IP address of the Samba server.</p>
<div id="attachment_18089" class="wp-caption alignleft" style="width: 190px"><a rel="attachment wp-att-18089" href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/smbclient/"><img class="size-thumbnail wp-image-18089 " src="http://www.ghacks.net/wp-content/uploads/2009/11/smbclient-300x300.png" alt="Figure 3" width="180" height="180" /></a><p class="wp-caption-text">Figure 3</p></div>
<p>You will be prompted for your username and password. If you get an error it could be that the usernames don&#8217;t match on each end. If that&#8217;s the case you could add the <em>-U </em>switch to the command like so:</p>
<p><em>smbclient &#8211;user=jlwallen -L  //SAMBA_SERVER_ADDRESS</em></p>
<p>You should see output similar to that shown in Figure 3.</p>
<p>Now it&#8217;s time to try to mount the Samba share to the <strong>/media/samba</strong> directory. To do this issue the command:</p>
<p><em>sudo mount -t cifs //SAMBA_SERVER_ADDRESS/SHARE -o username=USERNAME /media/samba/</em></p>
<p>Where:</p>
<ul>
<li><span style="background-color: #ffffff">SAMBA_SERVER_ADDRESS is the IP address of the Samba server.</span></li>
<li><span style="background-color: #ffffff">SHARE is the share name.</span></li>
<li><span style="background-color: #ffffff">USERNAME is the username to connect with.</span></li>
</ul>
<p>If that works you can now make this an automated mount by adding the following line to your <strong>/etc/fstab</strong> file:</p>
<p><code>//SAMBA_SERVER_ADDRESS/SHARE     /media/samba    cifs  credentials=/etc/samba/user.cred 0 0 </code></p>
<p>Where SAMBA_SERVER_ADDRESS is the IP address of the Samba server and SHARE is the share name.</p>
<p>Notice the user.cred file. This is one last thing we need to create. With your text editor create this file and place into it:</p>
<p><em>username=USER</em></p>
<p><em>password=PASSWORD</em></p>
<p>Where USER is the username to log in with and PASSWORD is the password to use for authentication. The final step is the give this new file the proper permissions with the command:</p>
<p>sudo chmod 600 /etc/samba/user.cred</p>
<p>You can ensure this works by issuing the command <em>mount -a</em> which should mount your Samba share.</p>
<p><strong>Final thoughts</strong></p>
<p>You should now have an auto-mounting Samba share &#8211; or the ability to easily connect your GNOME desktop to a Samba share. Samba is a very powerful tool that not only can share files with Windows machines, but with Linux machines as well.</p>

	Tags: <a href="http://www.ghacks.net/tag/gnome/" title="GNOME" rel="tag">GNOME</a>, <a href="http://www.ghacks.net/tag/samba/" title="samba" rel="tag">samba</a>, <a href="http://www.ghacks.net/tag/samba-shares/" title="samba shares" rel="tag">samba shares</a>, <a href="http://www.ghacks.net/tag/smbconf/" title="smb.conf" rel="tag">smb.conf</a>, <a href="http://www.ghacks.net/tag/smbclient/" title="smbclient" rel="tag">smbclient</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/" title="Set up your new Ubuntu Server as a Samba Server (September 4, 2009)">Set up your new Ubuntu Server as a Samba Server</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/" title="Get To Know Linux: Understanding smb.conf (February 6, 2009)">Get To Know Linux: Understanding smb.conf</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/04/19/auto-mounting-a-samba-share-in-linux/" title="Auto mounting a Samba share in Linux (April 19, 2009)">Auto mounting a Samba share in Linux</a> (5)</li>
	<li><a href="http://www.ghacks.net/2009/11/24/walk-through-installation-of-opensuse-11-2/" title="Walk-through installation of OpenSuSE 11.2 (November 24, 2009)">Walk-through installation of OpenSuSE 11.2</a> (0)</li>
	<li><a href="http://www.ghacks.net/2009/04/03/simple-gnome-note-taking-with-tomboy/" title="Simple GNOME Note Taking with Tomboy (April 3, 2009)">Simple GNOME Note Taking with Tomboy</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Xbox Media Center on Linux</title>
		<link>http://www.ghacks.net/2009/10/28/xbox-media-center-on-linux/</link>
		<comments>http://www.ghacks.net/2009/10/28/xbox-media-center-on-linux/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 16:04:09 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music and Video]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[media center]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[video playback]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=17827</guid>
		<description><![CDATA[The Xbox Media Center arrived in 2004 and became popular so quickly that it became clear more ports would be needed. So the XBMC team allowed this tool to evolve into a cross platform media center that would run on just about anything you can think of.  But, of course, the purpose of this article [...]]]></description>
			<content:encoded><![CDATA[<p>The <a title="XBMC" href="http://xbmc.org/" target="_blank">Xbox Media Center</a> arrived in 2004 and became popular so quickly that it became clear more ports would be needed. So the XBMC team allowed this tool to evolve into a cross platform media center that would run on just about anything you can think of.  But, of course, the purpose of this article is to install XBMC on Linux. Although XBMC can be installed on most Linux distributions, the Ubuntu installation is the least painful. I&#8217;ll first illustrate the installation on Ubuntu and then on Fedora. Once installed, you will find XBMC meets many (if not all) of your media center needs similar to that of Windows Media Center.</p>
<p>Of course, ideally, you will want to install XBMC on a machine intended for multi-media use. It will work on lower-end video cards, but the interface will be somewhat slower. For a complete listing of supported hardware check out the <a title="XBMC supported hardware" href="http://xbmc.org/wiki/?title=Supported_hardware" target="_blank">XBMC hardware page</a>. Now, let&#8217;s get on with the installation.</p>
<p><span id="more-17827"></span><strong>Ubuntu</strong></p>
<p>I will give you a warning here: The most recently supported Ubuntu is 8.10. That does not, however, mean it will not install on anything later. I have XBMC installed and working fine on Ubuntu 9.04. With that in mind here are the installation steps for Ubuntu.</p>
<p>Open up your <strong>/etc/apt/sources.list</strong> file and add the following to the end:<br />
<code>deb http://ppa.launchpad.net/team-xbmc-hardy/ubuntu hardy main<br />
deb-src http://ppa.launchpad.net/team-xbmc-hardy/ubuntu hardy main</code></p>
<p>Save that file and then issue the command:</p>
<p><em>sudo apt-get update</em></p>
<p>Once the update is complete issue the following command:<br />
<em> </em></p>
<p><em>sudo apt-get install xbmc</em></p>
<p>If you want to install extra skins, issue this command:</p>
<p><em>sudo apt-get install xbmc-skin-*</em></p>
<div id="attachment_17833" class="wp-caption alignleft" style="width: 190px"><a rel="attachment wp-att-17833" href="http://www.ghacks.net/2009/10/28/xbox-media-center-on-linux/xbmc/"><img class="size-thumbnail wp-image-17833" src="http://www.ghacks.net/wp-content/uploads/2009/10/xbmc-300x300.png" alt="Figure 1" width="180" height="180" /></a><p class="wp-caption-text">Figure 1</p></div>
<p>You will find the XBMC menu entry in the Sound And Video sub-menu of the Applications menu. When XBMC opens you will see a very user-friendly interface (see Figure 1).</p>
<p>Now it&#8217;s time for a less than user-friendly installation. Because there have been no rpm files created for Fedora, the installation requires a number of steps which will lead you to compiling XBMC. These steps will work for Fedora 8, 9, and 10 as well as CentOS 5.2. Here we go. NOTE: You will need to be the root user for this installation.</p>
<p>If you don&#8217;t already have Subversion install, do so now with the command:</p>
<p><em>yum install subversion</em></p>
<p>Once Subversion is installed, check out XBMC from subversion with the command:</p>
<p><em>svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk</em></p>
<p>Now install the rpmfusion repository with one of the following commands:</p>
<p>Fedora:</p>
<p><em>rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm</em></p>
<p>and</p>
<p><em>rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rmpfusion-nonfree-release-stable.noarch.r</em>pm</p>
<p>CentOS 5 (32 bit):<br />
<em>rpm -Uvh http://apt.sw.be/redhat/e15/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.e15.rf.i386.rpm</em></p>
<p>CentOS 5 (64 bit):</p>
<p><em>rpm -Uvh http://apt.sw.be/redhat/e15/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.e15.rf.x86_64.rpm</em></p>
<p>Now the fun begins. This installation command is all one line:<br />
<code>yum install SDL* glew glew-devel libmad-devel tre tre-devel libogg libogg-devel libvorbis libvorbis-devel boost boost-devel bzip2-devel bzip2-libs fribidi* lzo lzo-devel mysql-libs mysql-devel jasper jasper-devel faac faac-devel enca enca-devel hal hal-devel hal-libs cmake gperf nasm libXmu-devel fontconfig-devel freetype-devel libXinerama-devel pcre-devel gcc-c++ sqlite-devel curl-devel mysql-devel libcdio-devel libmms-devel faad2-devel flac-devel libsmbclient-devel libXtst-devel</code></p>
<p>The next step creates a symbolic link for the libmysqlclient.so file. The command is one of these two (depending upon your architecture):</p>
<p>For i386:</p>
<p><em>sudo ln -s /usr/lib/mysql/libmysqlclient.so.15.0.0 /usr/lib/libmysqlclient.so </em></p>
<p>For x64:<br />
<em>sudo ln -s /usr/lib64/mysql/libmysqlclient.so.15.0.0 /usr/lib64/libmysqlclient.so</em></p>
<p>Now cd into the XBMC directory (should be in the directory you are currently working in) and issue the following commands:</p>
<p><em>./bootstrap</em></p>
<p>and</p>
<p><em>./configure</em></p>
<p>and</p>
<p><em>make</em></p>
<p>If you see an error related to jpegint.h, then you might have to issue the following command:</p>
<p><em>cp XBMC/xbmx/lib/cximage-6.0/jpeg/jpegint.h /usr/include</em></p>
<p>If you have to issue the above command, then issue the <em>make </em>command again.</p>
<p>Finally issue the command:</p>
<p><em>make install</em></p>
<p>And XBMC will install.</p>
<p>On Fedora distributions you might have an issue with SELinux. If so you will need to issue the following commands:<br />
<code>chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/avutil-50-i486-linux.so'<br />
chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/avcodec-52-i486-linux.so'<br />
chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/avformat-52-i486-linux.so'<br />
chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/swscale-0.6.1-i486-linux.so'</code></p>
<p>That&#8217;s it for the Fedora/CentOS installation. You should find XBMC in your Video menu. If you can&#8217;t seem to find a menu entry you can always enter <em>xbmc </em>in either a terminal window or the run dialog.</p>
<p><strong>Final thoughts</strong></p>
<p>XBMC is an outstanding media center software. It will play your CDs and DVDs flawlessly. If you have the hardware for this software, it is a much better solution than most other Linux video solutions.</p>

	Tags: <a href="http://www.ghacks.net/tag/media-center/" title="media center" rel="tag">media center</a>, <a href="http://www.ghacks.net/tag/multimedia/" title="multimedia" rel="tag">multimedia</a>, <a href="http://www.ghacks.net/tag/video-playback/" title="video playback" rel="tag">video playback</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/08/14/xbox-media-center-cross-platform-alpha/" title="Xbox Media Center Cross Platform Alpha (August 14, 2008)">Xbox Media Center Cross Platform Alpha</a> (2)</li>
	<li><a href="http://www.ghacks.net/2008/11/20/xbmc-media-center-final/" title="XBMC Media Center Final (November 20, 2008)">XBMC Media Center Final</a> (13)</li>
	<li><a href="http://www.ghacks.net/2006/09/02/the-perfect-multimedia-device/" title="The perfect multimedia device (September 2, 2006)">The perfect multimedia device</a> (3)</li>
	<li><a href="http://www.ghacks.net/2006/04/09/ten-video-sharing-services-compared/" title="Ten Video Sharing Services Compared (April 9, 2006)">Ten Video Sharing Services Compared</a> (1)</li>
	<li><a href="http://www.ghacks.net/2007/09/08/smplayer-0551/" title="SMPlayer 0.5.51 (September 8, 2007)">SMPlayer 0.5.51</a> (17)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/10/28/xbox-media-center-on-linux/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Stop SPAM in Postfix with Spamassassin</title>
		<link>http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/</link>
		<comments>http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 20:46:31 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[email filtering]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[SPAM scoring]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=17653</guid>
		<description><![CDATA[So you have your Ubuntu server up and running with a Postfix mail server (see &#8220;Install Postfix for reliable email delivery&#8220;). You have also set up Postfix for antivirus with the help of ClamAV (see &#8220;Add antivirus to Post fix with ClamAV&#8220;). Finally you have Postfix set up to relay (see &#8220;Mail relaying made simple [...]]]></description>
			<content:encoded><![CDATA[<p>So you have your Ubuntu server up and running with a Postfix mail server (see &#8220;<a title="Install Postfix for reliable email delivery" href="http://www.ghacks.net/2009/10/24/install-postfix-for-reliable-email-delivery/" target="_blank">Install Postfix for reliable email delivery</a>&#8220;). You have also set up Postfix for antivirus with the help of ClamAV (see &#8220;<a title="Add antivirus to Postfix with ClamAV" href="http://www.ghacks.net/2009/10/24/install-postfix-for-reliable-email-delivery/" target="_blank">Add antivirus to Post fix with ClamAV</a>&#8220;). Finally you have Postfix set up to relay (see &#8220;<a title="Mail relaying made simple with Postfix" href="http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/" target="_blank">Mail relaying made simple with Postfix</a>&#8220;). The last trick in this bag is to add SPAM prevention to Postfix.</p>
<p>Fortunately there is a tool for that. The tool? <a title="Spamassassin" href="http://spamassassin.apache.org/" target="_blank">Spamassassin</a>. Spamassassin is a very versatile SPAM tool that is part of the <a title="Apache Foundation" href="http://www.apache.org/" target="_blank">Apache Foundation</a>. Spamassassin uses numerous means to detect SPAM including: DNS and Checksum based SPAM detection as well as Bayesian filtering, external programs, black lists, and online databases. These tools together make for a fairly powerful detection system.</p>
<p>In this article you are going to see how to install and configure Spamassassin to work in conjunction with Postfix to further enhance your email server.</p>
<p><span id="more-17653"></span><strong>Installing Spamassassin</strong></p>
<p>Obviously the first thing you need to do is install Spamassassin. You will find Spamassassin in the Ubuntu repositories. And since this entire series has been laid on top of a Ubuntu Server installation, that is quite convenient. So, to install Spamassassin, open up your terminal window and issue the following command:</p>
<p><em>sudo apt-get install spamassassin</em></p>
<p>There may or may not be some dependencies to install in order for the Spamassassin  installation to complete. Go ahead and OK those. Once this installation is complete you are ready to start configuring.</p>
<p><strong>Configuration</strong></p>
<p>Before we actually get to the configuration it is important to understand the SPAM scoring system. With Spamassassin, messages are tagged as SPAM only when they have enough SPAM-matching characteristics (according to a scoring level). The scoring level is 0-5, however it&#8217;s not as simple as saying a 0 means it is 0% SPAM. The system is set up so that every characteristic can add to the overall score. For example a message tested to find a base64 attachment does not have a file name filtered with both bayes+net will add 0.224 to the over all score of the message. When all of the characteristic scores are added up, if they exceed the default score you have set in the configuration file, that message is considered SPAM.</p>
<p>Now that you have a basic understand of how the scoring system works. Let&#8217;s start configuring Spamassassin.</p>
<p>The main configuration file is <strong>/etc/spamassassin/local.cf. </strong>The first option you want to configure is the default score. Look for the line:</p>
<p><em> # required_score 5.0</em></p>
<p>The first thing you want to do is uncomment that line (by removing the &#8220;#&#8221; character) and then changing the score. A score of 5 is pretty high and sure to be SPAM. Understand the more you lower that score the likely you are of missing message messages that are tagged false-positives. A score of 3.5 is a fairly reliable score that will catch a lot of SPAM but not a lot of false positives.</p>
<p>Above this line are a couple of other options that are important. The first is the option to set the option:</p>
<p>report_safe</p>
<p>To 0. This option can be set to either 0 or 1. A zero means that if a message is found to be SPAM the message will not be deleted, but instead the subject line will be rewritten to include a message marking it as SPAM.  This is handy to prevent users from losing important messages to false positives. This also allows you to set a lower score threshold.</p>
<p>To do this first look for the line:</p>
<p><em># report_safe 1</em></p>
<p>Uncomment this line by removing the &#8220;#&#8221; character and then change the &#8220;1&#8243; to &#8220;0&#8243; (no quotes).</p>
<p>The next step is to uncomment the line:</p>
<p># rewrite_header Subject *****SPAM*****</p>
<p>Now you can alter the &#8220;*****SPAM*****&#8221; section of this line to reflect what you&#8217;d prefer it to say. Just make sure it is clear to your users that a message with this rewritten subject line is most likely SPAM.</p>
<p>Now restart the Spamassassin daemon with the command:</p>
<p><em>sudo /etc/init.d/spamassassin restart </em></p>
<p><strong>Configure Postfix</strong></p>
<p>The last step is to set up Postfix to use Spamassassin. To do this open up the file <strong>/etc/postfix/master.cf<em> </em><span style="font-weight: normal">and look for the line:</span></strong></p>
<p><strong><span style="font-weight: normal"><em>smtp     inet    n   &#8211;   &#8211;   &#8211;   &#8211;   smtpd</em></span></strong></p>
<p>You need to alter this line to look like:</p>
<p><code>smtp      inet   n   -   -   -   -   smtpd -o content_filter=spamassassin</code></p>
<p>Finally, at the end of this file add the following:</p>
<p><code>spamassassin<br />
unix - n n - - pipe<br />
flags=R<br />
user=spamd<br />
argv=/usr/bin/spamc<br />
-e /usr/sbin/sendmail<br />
-oi -f ${sender} ${recipient}</code></p>
<p>Now all you need to do is restart Postfix with the command:</p>
<p><em>sudo /etc/init.d/postfix restart</em></p>
<p>Your mail server should now be scoring incoming message as SPAM or HAM.</p>
<p><strong>Final thoughts</strong></p>
<p>The mail server is a tricky beast. You have to ensure that users are getting their mail, but you have to make sure they aren&#8217;t receive SPAM or viruses. After completing this series of articles, you should have a pretty solid server running that will send out mail that is safe for users eyes.</p>

	Tags: <a href="http://www.ghacks.net/tag/email/" title="Email" rel="tag">Email</a>, <a href="http://www.ghacks.net/tag/email-filtering/" title="email filtering" rel="tag">email filtering</a>, <a href="http://www.ghacks.net/tag/postfix/" title="Postfix" rel="tag">Postfix</a>, <a href="http://www.ghacks.net/tag/spam/" title="spam" rel="tag">spam</a>, <a href="http://www.ghacks.net/tag/spam-scoring/" title="SPAM scoring" rel="tag">SPAM scoring</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/07/01/trap-spammers-with-project-honey-pot/" title="Trap Spammers with Project Honey Pot (July 1, 2009)">Trap Spammers with Project Honey Pot</a> (4)</li>
	<li><a href="http://www.ghacks.net/2008/08/28/tinymail-email-protection/" title="Tinymail Email Protection (August 28, 2008)">Tinymail Email Protection</a> (18)</li>
	<li><a href="http://www.ghacks.net/2008/02/26/reduce-spam-by-using-alternative-google-mail-address/" title="Reduce Spam by using alternative Google Mail Address ? (February 26, 2008)">Reduce Spam by using alternative Google Mail Address ?</a> (8)</li>
	<li><a href="http://www.ghacks.net/2006/01/25/phishing-explained/" title="Phishing Explained (January 25, 2006)">Phishing Explained</a> (4)</li>
	<li><a href="http://www.ghacks.net/2006/05/09/introduction-series-part-1-spam/" title="Introduction Series Part 1: Spam (May 9, 2006)">Introduction Series Part 1: Spam</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add antivirus to Postfix with ClamAV</title>
		<link>http://www.ghacks.net/2009/10/25/add-antivirus-to-postfix-with-clamav/</link>
		<comments>http://www.ghacks.net/2009/10/25/add-antivirus-to-postfix-with-clamav/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 15:46:17 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[anti virus]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[virus definitions]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=17707</guid>
		<description><![CDATA[By now you have your Postfix mail server up and running (see &#8220;Install Postfix for reliable email delievery&#8220;). You even have relaying working (see &#8220;Mail relaying made simple with Postfix&#8220;). But one of the most important features you can add to a mail server is an system to prevent viruses from being passed to users. [...]]]></description>
			<content:encoded><![CDATA[<p>By now you have your Postfix mail server up and running (see &#8220;<a title="Install Postfix for reliable email delievery" href="http://www.ghacks.net/2009/10/24/install-postfix-for-reliable-email-delivery/" target="_blank">Install Postfix for reliable email delievery</a>&#8220;). You even have relaying working (see &#8220;<a title="Mail relaying made simple with Postfix" href="http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/" target="_blank">Mail relaying made simple with Postfix</a>&#8220;). But one of the most important features you can add to a mail server is an system to prevent viruses from being passed to users. Naturally, the Linux fan will say &#8220;But Linux isn&#8217;t affected by viruses!&#8221;. Although that may, for the most part, be true, this is a mail SERVER which could be serving up mail to Windows users. And Windows machines ARE effected by viruses. To that end, anti-virus measures are a necessity on a Linux email server.</p>
<p>One of the best anti-virus systems for a Postfix server is <a title="ClamAV" href="http://www.clamav.net/" target="_blank">ClamAV</a>. This anti-virus tool kit is open sourced and can be used on all UNIX-like operating systems. It&#8217;s easy to install and effective. In this article we will be following our series started way back in the <a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04 article</a>. Of course we will be installing ClamAV on a Ubuntu server running LAMP and Postfix. With that in mind, let&#8217;s get busy!</p>
<p><span id="more-17707"></span><strong>Installation</strong></p>
<p>The first thing to take care of is the installation of ClamAV. There are a number of tools you will need to install. Open up a terminal window and issue the command:</p>
<p><code>sudo apt-get install clamav clamav-freshclam clamsmtp</code></p>
<p>The above command should also pick up all of the necessary dependencies. The installation will also start the clamav daemon. You will restart that momentarily</p>
<p><strong>Configuration</strong></p>
<p>Once installed you have some configurations to take care of. There are three files you are going to have to edit:</p>
<ul>
<li><span style="background-color: #ffffff"><strong>/etc/clamsmtpd.conf</strong></span></li>
<li><span style="background-color: #ffffff"><strong>/etc/postfix/main.cf</strong></span></li>
<li><span style="background-color: #ffffff"><strong>/etc/postfix/master.cf</strong></span></li>
</ul>
<p>The first file to configure is the <strong>clamsmtpd.conf </strong>file. The configuration in this file is simple. Look for the lines:</p>
<p><em>OutAddress: 10025</em></p>
<p><em><em>127.0.0.1:10026</em></em></p>
<p>Change them to:</p>
<p><em>OutAddress: 10026</em></p>
<p><em><em>127.0.0.1:10025</em></em></p>
<p>That&#8217;s it for the <strong>clamsmtpd.conf </strong>file. Now let&#8217;s move on to the heavier configurations.</p>
<p>Open up the <strong>/etc/postfix/main.cf </strong>file. Scroll down to the bottom of this file and add the following:</p>
<p><em>content_filter = scan:127.0.0.1:10025</em></p>
<p><em>receive_override_options = no_address_mappings</em></p>
<p>Save that file and now move on over to the <strong>/etc/postfix/master.cf</strong> file. Again, scroll down to the bottom of this file and add the following:</p>
<p><code># AV scan filter (used by content_filter)<br />
scan      unix  -       -       n       -       16      smtp<br />
-o smtp_send_xforward_command=yes<br />
# For injecting mail back into postfix from the filter<br />
127.0.0.1:10026 inet  n -       n       -       16      smtpd<br />
-o content_filter=<br />
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks<br />
-o smtpd_helo_restrictions=<br />
-o smtpd_client_restrictions=<br />
-o smtpd_sender_restrictions=<br />
-o smtpd_recipient_restrictions=permit_mynetworks,reject<br />
-o mynetworks_style=host<br />
-o smtpd_authorized_xforward_hosts=127.0.0.0/8</code></p>
<p>Save that file.</p>
<p><strong>Restarting</strong></p>
<p>The first thing you need to do is restart Postfix with the command:</p>
<p><em>sudo /etc/init.d/postfix restart</em></p>
<p>Once that has restarted you need to restart clamsmtpd with the command:</p>
<p><em>sudo /etc/init.d/clamsmtpd restart</em></p>
<p>Now, if nothing has gone horribly wrong, you should have a virus protected Postfix mail server.</p>
<p><strong>Updating signatures</strong></p>
<p>You should never go without updating your virus signatures. This is critical for keeping your mail server virus-free as new viruses are created or old viruses mutate. Fortunately ClamAV has its own tool for this. You will need to go back to that terminal window and issue the command:</p>
<p><em>sudo freshclam</em></p>
<p>Which will update the signatures.</p>
<p>You might even add the <em>freshclam</em> command into the root users crontab for regular signature updates.</p>
<p><strong>Final thoughts</strong></p>
<p>Your Postfix mail server is getting better and stronger each day. Adding anti-virus is a critical step in the grand scheme of Postfix things. In our next addition to the Postfix series, we will add Spamassassin for anti-spam measures.</p>

	Tags: <a href="http://www.ghacks.net/tag/anti-virus/" title="anti virus" rel="tag">anti virus</a>, <a href="http://www.ghacks.net/tag/postfix/" title="Postfix" rel="tag">Postfix</a>, <a href="http://www.ghacks.net/tag/virus-definitions/" title="virus definitions" rel="tag">virus definitions</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2007/04/10/what-is-your-security-concept/" title="What is your Security Concept ? (April 10, 2007)">What is your Security Concept ?</a> (9)</li>
	<li><a href="http://www.ghacks.net/2007/01/01/test-your-anti-virus-program/" title="Test your Anti-virus program (January 1, 2007)">Test your Anti-virus program</a> (10)</li>
	<li><a href="http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/" title="Stop SPAM in Postfix with Spamassassin (October 26, 2009)">Stop SPAM in Postfix with Spamassassin</a> (1)</li>
	<li><a href="http://www.ghacks.net/2007/01/11/secure-windows-xp/" title="Secure Windows XP (January 11, 2007)">Secure Windows XP</a> (0)</li>
	<li><a href="http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/" title="Mail relaying made simple with Postfix (September 23, 2009)">Mail relaying made simple with Postfix</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/10/25/add-antivirus-to-postfix-with-clamav/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Backup your Linux box with rsync</title>
		<link>http://www.ghacks.net/2009/10/11/backup-your-linux-box-with-rsync/</link>
		<comments>http://www.ghacks.net/2009/10/11/backup-your-linux-box-with-rsync/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 14:13:15 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[automated backup]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[linux backup]]></category>
		<category><![CDATA[secure shell]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=17157</guid>
		<description><![CDATA[In this Linux backup series we have taken a look at Flyback (&#8221;Quick and easy backups with Flyback&#8220;), Backerupper (&#8221;Simple gui backup tool Backerupper&#8220;), and Back In Time (&#8221;Linux Back In Time: Backup made easy&#8220;). But what Linux series would be complete without a command line entry? Not this one.
There is one thing that most [...]]]></description>
			<content:encoded><![CDATA[<p>In this Linux backup series we have taken a look at Flyback (&#8221;<a title="Flyback" href="http://www.ghacks.net/2009/10/08/quick-and-easy-backups-with-flyback/" target="_blank">Quick and easy backups with Flyback</a>&#8220;), Backerupper (&#8221;<a title="Backerupper" href="http://www.ghacks.net/2009/10/09/simple-gui-backup-tool-backerupper/" target="_blank">Simple gui backup tool Backerupper</a>&#8220;), and Back In Time (&#8221;<a title="Back In Time" href="http://www.ghacks.net/2009/10/10/linux-back-in-time-backup-made-easy/" target="_blank">Linux Back In Time: Backup made easy</a>&#8220;). But what Linux series would be complete without a command line entry? Not this one.</p>
<p>There is one thing that most Linux backup tools have in common and that is their underlying technologies. In most cases one of the tools that make the GUI backup tools possible is the venerable rsync. Rsync is an incredibly fast and lightweight file copy tool that can not only copy files to and from a local machine, it can also copy over a network connection &#8211; which makes rsync an ideal candidate for user-generated backup scripts or cron jobs.</p>
<p>In this tutorial you will learn how easy it is to use rysnc to not only back up specified directories to an external usb drive, but also to backup over a network connection via ssh.</p>
<p><span id="more-17157"></span><strong>Command structure</strong></p>
<p>The structure of the rsync command is:</p>
<p>rsync [OPTIONS] <strong>SOURCE</strong> <em>DESTINATION</em></p>
<p>Where SOURCE is the location of the directory to be backed up and DESTINATION is where the backup will be placed.</p>
<p>Now the structure of the command changes when you are employing a network facility such as ssh. At that point the command structure would look like:</p>
<p>rsync [OPTIONS] ssh <strong>SOURCE </strong><em>user@destination:/directory</em></p>
<p>Where <em>user </em>is the user name on the remote machine, <em>destination</em> would be either an IP address or domain, and <em>/directory</em> is the explicit path to the directory you want to back up to.</p>
<p><strong>Usage</strong></p>
<p>For the first example we are going to backup the directory <strong>/home/jlwallen/Documents</strong> to the directory <strong>/media/disk/BACKUPS</strong>. This destination is a directory located on an external USB drive obviously mounted to <strong>/media/disk</strong>. The command for this backup will be:</p>
<p><code>rsync -avh /home/jlwallen/Documents /media/disk/BACKUPS</code></p>
<p>This is where we run into our first &#8220;gotcha&#8221;. What happens with the above command is that any subdirectory in <strong>/home/jlwallen/Documents</strong> will be created on <strong>/media/disk/BACKUPS</strong>. So if you want to create a similar directory structure on the destination you should first create a parent directory similar to that of the source. So before you run the rsync command issue this command:</p>
<p><em>mkdir /media/disk/BACKUPS/Documents</em></p>
<p>The new rsync command would be:</p>
<p><code>rsync -avh /home/jlwallen/Documents /media/disk/BACKUPS/Documents</code></p>
<p>The options used in the above command are:</p>
<ul>
<li>a: Archive mode</li>
<li>v: Verbose mode</li>
<li>h: Output in human readable format.</li>
</ul>
<p>Now let&#8217;s backup the same source to a remote location with the help of secure shell. It will help your cause to first make sure you can log into the remove machine via ssh. Once you have that working you are ready to backup. Using our same example we are going to backup to user jlwallen at the IP address 192.168.1.10 to the directory <strong>/home/jlwallen/BACKUPS/Documents</strong>. To do this the command would look like:</p>
<p><code>rsync -avhe ssh /home/jlwallen/Documents jlwallen@192.168.1.10:/home/jlwallen/BACKUPS/Documents</code></p>
<p>The added option is e which allows you to specify the remote shell to use.</p>
<p>You will be prompted for the remote users&#8217; password and then the coping will begin. But what if you don&#8217;t want to have to use a password? If you are wanting to set up automated, remote backups you will have to allow this process to happen without entering a password. To do this you have to create an SSH key without a password. Here are the steps for this:</p>
<p>create an ssh key on the source machine with the command:</p>
<p><em>ssh-keygen -t dsa</em></p>
<p>Press enter when prompted for a password.</p>
<p>Once the key is created copy that key to the destination key with the following command:</p>
<p><code>ssh-copy-id -i .ssh/id_dsa.pub username@destination</code></p>
<p>Where username is the user on the remote machine and destination is the IP or domain of the remote machine.</p>
<p>Now rsync copying can be done without having to enter a password.</p>
<p><strong>Final thoughts</strong></p>
<p>The nice thing about this setup is you can now use rsync to create a cron job for backup automation. Rsync is an incredibly flexible and reliable means for backing up your directories and files. It should be since it is the foundation that so many other backup tools were based on.</p>

	Tags: <a href="http://www.ghacks.net/tag/automated-backup/" title="automated backup" rel="tag">automated backup</a>, <a href="http://www.ghacks.net/tag/backup/" title="backup" rel="tag">backup</a>, <a href="http://www.ghacks.net/tag/linux-backup/" title="linux backup" rel="tag">linux backup</a>, <a href="http://www.ghacks.net/tag/secure-shell/" title="secure shell" rel="tag">secure shell</a>, <a href="http://www.ghacks.net/tag/ssh/" title="ssh" rel="tag">ssh</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/02/17/get-to-know-linux-secure-shell/" title="Get To Know Linux: Secure Shell (February 17, 2009)">Get To Know Linux: Secure Shell</a> (4)</li>
	<li><a href="http://www.ghacks.net/2007/02/17/zip-encrypt-ftp-backups/" title="Zip Encrypt Ftp Backups (February 17, 2007)">Zip Encrypt Ftp Backups</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/10/03/yadis-backup-software/" title="Yadis! Backup Software (October 3, 2009)">Yadis! Backup Software</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/04/24/windows-backup-software-backup-maker/" title="Windows Backup Software: Backup Maker (April 24, 2009)">Windows Backup Software: Backup Maker</a> (18)</li>
	<li><a href="http://www.ghacks.net/2008/10/02/windows-backup-software-deltacopy/" title="Windows Backup Software DeltaCopy (October 2, 2008)">Windows Backup Software DeltaCopy</a> (11)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/10/11/backup-your-linux-box-with-rsync/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Speed up your IDE/ATA hard drive with hdparm</title>
		<link>http://www.ghacks.net/2009/10/07/speed-up-your-ideata-hard-drive-with-hdparm/</link>
		<comments>http://www.ghacks.net/2009/10/07/speed-up-your-ideata-hard-drive-with-hdparm/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 20:35:06 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[ATA drives]]></category>
		<category><![CDATA[drive throughput]]></category>
		<category><![CDATA[IDE drives]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=17031</guid>
		<description><![CDATA[The Linux operating system has a really nice tool for testing and optimizing your hard drive. This tool is called hdparm and can work with both IDE and ATA drives. NOTE: hdparm does NOT work with SATA drives. The hdparm tool is a command line only tool, and even though it should be only used [...]]]></description>
			<content:encoded><![CDATA[<p>The Linux operating system has a really nice tool for testing and optimizing your hard drive. This tool is called hdparm and can work with both IDE and ATA drives. NOTE: hdparm does NOT work with SATA drives. The hdparm tool is a command line only tool, and even though it should be only used by those who know their systems well, it&#8217;s not terribly difficult to use.</p>
<p>But why would you want to speed up your drive when modern drives are already fast enough? Some Linux installations default to slower defaults which, effectively, slow down your drives. Of course using such a tool must come with a warning. WARNING: Using hdparm incorrectly could cause corruption of data.</p>
<p><span id="more-17031"></span>You do not have to worry about installing hdparm as it should already be installed by default. The basic usage of hdparm is:</p>
<p><em>hdparm [OPTIONS] [DEVICE]</em></p>
<p>Of course, by DEVICE, I mean in the Linux vernacular which will be something like <strong>/dev/hda</strong>.</p>
<p>To get the basic information about your drive you would issue the command:</p>
<p><em>hdparm /dev/HDA</em></p>
<p>Where <em>HDA</em> is the actual name of the hard drive you want to work with.</p>
<p>When I run the command:</p>
<p><em>sudo hdparm /dev/hda</em></p>
<p>I see the following:</p>
<p><code>jlwallen@jlwallen-laptop:~$ sudo hdparm /dev/hda<br />
[sudo] password for jlwallen:<br />
/dev/hda:</code></p>
<p><code>multcount     =  8<br />
using_dma     =  0<br />
IO_support    =  0 (default)<br />
readonly      =  0 (off)<br />
readahead     = 256 (on)<br />
geometry      = 19457/255/63, sectors = 312581808, start = 0</code></p>
<p>What is really important in the above output is the IO_Support line. It is set to 0 which is 16-bit. Modern drives support IO mode 1 which is 32-bit mode. By changing this you can nearly double the throughput of your hard drive. But how exactly do you set this? Patience. Before we make this change we want to test the speeds of our drive. To run a standard test issue the command:</p>
<p><em>sudo hdparm -Tt /dev/HDA</em></p>
<p>Where <em>SDA</em> is the actual location of your drive. The results should look something like:</p>
<p><code>/dev/hda:<br />
Timing cached reads:   868 MB in  2.00 seconds = 434 MB/sec<br />
Timing buffered disk reads:  68 MB in  3.01 seconds =  22.52 MB/sec</code></p>
<p>As you can see the speeds are so-so at best, so let&#8217;s kick them up a notch. To do the following:</p>
<p>Enable DMA</p>
<p>Change the IO mode from 16-bit to 32-bit.</p>
<p>Change the maximum number of disk sectors to transfer in a single request.</p>
<p>issue the command:</p>
<p><em>sudo hdparm -d1 -c1 -m16 /dev/hda</em></p>
<p>Now when I issue the command:</p>
<p><em>sudo hdparm /dev/hda</em></p>
<p>I see:</p>
<p><code>jlwallen@jlwallen-laptop:~$ sudo hdparm /dev/hda<br />
[sudo] password for jlwallen:<br />
/dev/hda:</code></p>
<p><code>multcount     =  16 (on)<br />
using_dma     =  1 (on)<br />
IO_support    =  1 (32-bit)<br />
readonly      =  0 (off)<br />
readahead     = 256 (on)<br />
geometry      = 19457/255/63, sectors = 312581808, start = 0</code></p>
<p>When the drive speeds are tested now, they should nearly be doubled.</p>
<p><strong>What about SATA?</strong></p>
<p>Naturally there is a tool for the same tricks, but for SATA drives. The <em>sdparm </em>tool is similar in use to the <em>hdparm</em> tool. The <em>sdparm</em> tool, however, is a bit more complex and not nearly as necessary as most SATA drives will give you pretty swift throughput. If you want to use <em>sdparm</em> you will notice that it is not installed by default. You can install <em>sdparm</em> with the command:</p>
<p><em>sudo apt-get install sdparm</em></p>
<p>I will dive into <em>sdparm</em> at a later date.</p>
<p><strong>Final thoughts</strong></p>
<p>If you are dealing with older, slower ATA/IDE drives you will probably notice a significant improvement when you use hdparm to speed up your throughput. Give this a go, but I suggest testing it on a non-production machine first.</p>
<p><em><br />
</em></p>

	Tags: <a href="http://www.ghacks.net/tag/ata-drives/" title="ATA drives" rel="tag">ATA drives</a>, <a href="http://www.ghacks.net/tag/drive-throughput/" title="drive throughput" rel="tag">drive throughput</a>, <a href="http://www.ghacks.net/tag/ide-drives/" title="IDE drives" rel="tag">IDE drives</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/10/07/speed-up-your-ideata-hard-drive-with-hdparm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mail relaying made simple with Postfix</title>
		<link>http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/</link>
		<comments>http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 01:17:26 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[mail relaying]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16586</guid>
		<description><![CDATA[Have you installed the Postfix as an easier to use, more secure alternative to Sendmail only to find yourself having trouble with the old &#8220;unable to relay&#8221; errors? This can be very frustrating and have you pulling out your hair in no time.
MTAs (Mail Transfer Agents) can be a tricky lot to set up. Add [...]]]></description>
			<content:encoded><![CDATA[<p>Have you installed the Postfix as an easier to use, more secure alternative to Sendmail only to find yourself having trouble with the old &#8220;unable to relay&#8221; errors? This can be very frustrating and have you pulling out your hair in no time.</p>
<p>MTAs (Mail Transfer Agents) can be a tricky lot to set up. Add in to the mix something like relaying and you have all the ingredients for an installation NOT working. Fortunately <a title="Postfix" href="http://www.postfix.org/" target="_blank">Postfix</a> isn&#8217;t nearly as complicated as Sendmail, so relaying isn&#8217;t something you need guru-level access to solve. In this tutorial I am going to show you how to set up Postfix for easy relaying. You can always add this to the Ubuntu Server series that started with the article &#8220;<a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8220;.</p>
<p><span id="more-16586"></span><strong>Installing Postfix</strong></p>
<p>Just in case you haven&#8217;t already, you can install Postfix on your already running Ubuntu Server install with the command:</p>
<p><em>sudo apt-get install postfix</em></p>
<p>But I am going to assume you already have Postfix up and running already. And if you&#8217;re looking into relaying with Postfix, your problem is that you can receive mail, you just can&#8217;t send it. Let&#8217;s fix that problem.</p>
<p><strong>Configure Postfix</strong></p>
<p>The file you need to first take care of is <strong>/etc/postfix/main.cf</strong>. You will need sudo access so open this file with the command:</p>
<p><em>sudo nano /etc/postfix/main.cf</em></p>
<p>Now add this to the bottom of that file:</p>
<p><code># SMTP Authentication<br />
smtp_sasl_auth_enable = yes<br />
smtpd_sasl_type = dovecot<br />
smtpd_sasl_path = private/auth<br />
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd</code></p>
<p>NOTE: The portion starting with &#8220;smtpd_recipient_restrictions&#8221; and ending with &#8220;reject_unauth_destination&#8221; is actually one line.</p>
<p>NOTE: The portion starting with &#8220;reject_unauth&#8221; and ending with &#8220;sasl_passwd&#8221; is also only one line.</p>
<p>NOTE: The above assumes you are using Dovecot as your IMAP server.</p>
<p>The last line of the above should give you a hint as to what is next. Yes, you have to create a file, <strong>sasl_passwd</strong>, for Postfix to use as a password file. This file will be located in <strong>/etc/postfix/sasl/</strong> and will look like the following:</p>
<p>address.for.relaying   username:password</p>
<p>Where<em>:</em></p>
<ul>
<li><em>address.for.relaying </em>is the actual mail server you will use for relaying.</li>
<li><em>username</em> is the username for authentication on the relaying mail server.</li>
<li><em>password</em> is the password for authentication on the relaying mail server.</li>
</ul>
<p>The next step is to create the the sasl_passwd DB file so that Postfix has something it can read. To do this, issue the command:</p>
<p><em>sudo postmap hash:/etc/postfix/sasl/sasl_passwd</em></p>
<p>You should now see a new file in the <strong>/etc/postfix/sasl </strong>directory called <strong>sasl_passwd.db.</strong></p>
<p>One file step before restarting Postfix. Because the password file is plaintext it should be secured so that it can not be read by just any user. Say, for instance, you want Postfix to only be read by the root user. For this issue the command:</p>
<p><em>sudo chown root:root /etc/postfix/sasl/sasl_passwd &amp;&amp; chmod 600 /etc/postfix/sasl/sasl_passwd</em></p>
<p>Do the same thing with the <strong>sasl_passwd.db </strong>file like so:</p>
<p><em>sudo chown root:root /etc/postfix/sasl/sasl_passwd.db &amp;&amp; chmod 600 /etc/postfix/sasl/sasl_passwd.db</em></p>
<p>NOTE: If you have need for a different user, you can chown the file to whatever user you want&#8230;just make sure it is a secure user.</p>
<p>You&#8217;re finished. All that is left is to restart Postfix with the command:</p>
<p><em>sudo /etc/init.d/postfix restart</em></p>
<p>Open up your mail client and text to see if relaying is now working for you.</p>
<p><strong>Final thoughts</strong></p>
<p>Gone are the days of the overly complicated (and insecure) Sendmail configurations. Setting up relaying is simple when you are using Postfix.</p>

	Tags: <a href="http://www.ghacks.net/tag/mail-relaying/" title="mail relaying" rel="tag">mail relaying</a>, <a href="http://www.ghacks.net/tag/mail-server/" title="mail server" rel="tag">mail server</a>, <a href="http://www.ghacks.net/tag/postfix/" title="Postfix" rel="tag">Postfix</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/10/24/install-postfix-for-reliable-email-delivery/" title="Install Postfix for reliable email delivery (October 24, 2009)">Install Postfix for reliable email delivery</a> (8)</li>
	<li><a href="http://www.ghacks.net/2009/05/01/use-spamassassin-for-better-spam-detection/" title="Use Spamassassin for better SPAM detection (May 1, 2009)">Use Spamassassin for better SPAM detection</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/" title="Stop SPAM in Postfix with Spamassassin (October 26, 2009)">Stop SPAM in Postfix with Spamassassin</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/05/19/quickly-check-mails-without-downloading-them/" title="Quickly check mails without downloading them (May 19, 2008)">Quickly check mails without downloading them</a> (8)</li>
	<li><a href="http://www.ghacks.net/2009/06/05/make-sendmail-accept-mail-from-external-sources/" title="Make Sendmail accept mail from external sources (June 5, 2009)">Make Sendmail accept mail from external sources</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Build a custom firewall with fwbuilder</title>
		<link>http://www.ghacks.net/2009/09/18/build-a-custom-firewall-with-fwbuilder/</link>
		<comments>http://www.ghacks.net/2009/09/18/build-a-custom-firewall-with-fwbuilder/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 03:23:39 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[firewall builder]]></category>
		<category><![CDATA[fwbuilder]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux security]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16443</guid>
		<description><![CDATA[For the Linux operating system there are plenty of possibilities when it comes to firewalls. One possible option is Firestarter (You can read my &#8220;introductory&#8221; article &#8220;Firestarter: Simple to use desktop firewall&#8221; for an example of one such tool). You could also get very granular with the command line tool iptables. Of course most administrators [...]]]></description>
			<content:encoded><![CDATA[<p>For the Linux operating system there are plenty of possibilities when it comes to firewalls. One possible option is Firestarter (You can read my &#8220;introductory&#8221; article &#8220;<a title="Firestarter" href="http://www.ghacks.net/2009/09/15/firestarter-simple-to-use-powerful-desktop-firewall/" target="_blank">Firestarter: Simple to use desktop firewall</a>&#8221; for an example of one such tool). You could also get very granular with the command line tool iptables. Of course most administrators do not have the time or inclination to deal with such heavy-hitting tools as iptables (if you do have the time, however, iptables is incredibly powerful). So where do you go to get something user-friendly AND powerful? One such option is <a title="Fwbuilder" href="http://www.fwbuilder.org" target="_blank">fwbuilder</a>.</p>
<p>Fwbuilder is a powerful firewall creation tool that works by adding objects to build a customized firewall. An object can be just about anything from a firewall, a library, a host, interface, address, DNS name, etc. The idea is you piece objects together to form a cohesive whole that works together to form a complete firewall. The only problem most run into is, when you fire up fwbuilder, where do you start? It may seem a bit confusing at first, but you know where the first step is, the rest of the journey is pretty clear.</p>
<p><span id="more-16443"></span><strong>Installing fwbuilder</strong></p>
<p>I will touch briefly on installing fwbuilder, because it will not be found on your default system. And although you will find fwbuilder in your respository, it will be an outdated version. So to install the latest version first open up your <strong>/etc/apt/sources.list </strong>file and add the following (Note: I am installing this on Ubuntu 9.04.):</p>
<p><code>deb http://www.fwbuilder.org/deb/stable/ jaunty contrib</code></p>
<p>Before you update apt you will need to add the <a title="GPG key" href="http://www.fwbuilder.org/PACKAGE-GPG-KEY-fwbuilder.asc" target="_blank">GPG key</a>. Download that key and then issue the command:</p>
<p><em>sudo apt-key add PACKAGE-GPG-KEY-fwbuilder.asc</em></p>
<p>Now issue the command:</p>
<p><em>sudo apt-get update</em></p>
<p>Finally you can install with the command:</p>
<p><em>sudo apt-get install fwbuilder</em></p>
<p>Once installed you will find fwbuilder in the Administration sub-menu of the System menu (The entry will be labeled Firewall Builder).</p>
<p><strong>Building a firewall</strong></p>
<div id="attachment_16445" class="wp-caption alignleft" style="width: 473px"><a rel="attachment wp-att-16445" href="http://www.ghacks.net/2009/09/18/build-a-custom-firewall-with-fwbuilder/fwbuilder_main/"><img class="size-full wp-image-16445" src="http://www.ghacks.net/wp-content/uploads/2009/09/fwbuilder_main.png" alt="Figure 1" width="463" height="385" /></a><p class="wp-caption-text">Figure 1</p></div>
<p>When you start up fwbuilder the main window (see Figure 1) will not seem very intuitive. The first thing you need to do is create a new firewall. To create a new firewall click the Object drop-down which is the icon to the immediate left of the User drop-down. Or you click the Object menu and select New Object (which will open the Object drop-down menu). From this drop-down select New Firewall.</p>
<p>When you add a new firewall object a wizard will appear. Before you can move beyond the first screen you have to do the following:</p>
<ul>
<li>Name your firewall.</li>
<li>Select the firewall software the machine is running.</li>
<li>Select the OS the firewall is running on.</li>
</ul>
<p>In the first screen of this wizard is a very important option (if you want to make life easy for yourself). You can base your firewall on pre-configured templates. For new users this is always a good place to start. And even though you choose a pre-configured template, you can still customize this firewall.</p>
<p>But we&#8217;re building a customized firewall, so no templates here.</p>
<div id="attachment_16447" class="wp-caption alignright" style="width: 239px"><a rel="attachment wp-att-16447" href="http://www.ghacks.net/2009/09/18/build-a-custom-firewall-with-fwbuilder/fwbuilder_devices-2/"><img class="size-full wp-image-16447" src="http://www.ghacks.net/wp-content/uploads/2009/09/fwbuilder_devices1.png" alt="Figure 2" width="229" height="269" /></a><p class="wp-caption-text">Figure 2</p></div>
<p>The next screen asks you how you want to define your interfaces. There are two methods: Manually and using SNMP to automatically discover the interfaces. Manually is the most reliable method of course so select that option and click Next.</p>
<p>In the device setup window (see Figure 2) you will enter the information for your networking device. Once you have entered this click Add. If you can&#8217;t figure out the MAC address you can always use the Networking Tool application under the Administration sub-menu of the System menu.</p>
<p>Once you have added the device click the Finish button. If you have a machine with two networking devices add your second device and then click Finish. You will now be in the window where you will add rules to your firewall. In the upper left pane click on the name of the firewall to open up the Desktop/Policy window (see Figure 3).</p>
<div id="attachment_16448" class="wp-caption alignleft" style="width: 366px"><a rel="attachment wp-att-16448" href="http://www.ghacks.net/2009/09/18/build-a-custom-firewall-with-fwbuilder/fwbuilder_desktop/"><img class="size-full wp-image-16448" src="http://www.ghacks.net/wp-content/uploads/2009/09/fwbuilder_desktop.png" alt="Figure 3" width="356" height="233" /></a><p class="wp-caption-text">Figure 3</p></div>
<p>What you want to do is right click within the upper right pane and select &#8220;Insert Rule&#8221;. When the rule is inserted it will be fairly worthless. You will notice much of the policies are listed as &#8220;Any&#8221; or &#8220;All&#8221;. In order to change this you have to add new objects. Let&#8217;s say, for example, we want to create an address range that will cover our entire LAN to be used as a destination. To do this click on the Object drop-down and select New Address Range. The lower right pane will change where you can enter the values for your range. I will enter the following:</p>
<ul>
<li>Name: Internal LAN</li>
<li>Range Start: 192.168.1.1</li>
<li>Range End: 192.168.1.200</li>
</ul>
<p>You can add a comment if you like.</p>
<div id="attachment_16449" class="wp-caption alignright" style="width: 366px"><a rel="attachment wp-att-16449" href="http://www.ghacks.net/2009/09/18/build-a-custom-firewall-with-fwbuilder/fwbuilder_new_object/"><img class="size-full wp-image-16449" src="http://www.ghacks.net/wp-content/uploads/2009/09/fwbuilder_new_object.png" alt="Figure 4" width="356" height="233" /></a><p class="wp-caption-text">Figure 4</p></div>
<p>Now click Apply and that object has been created. This is where the fun begins. As you can see (in Figure 4) my new object is listed in the lower left pane. What I do is click and drag that object into the section of the new rule I want to apply that object to. So I want the Internal Lan object to apply to the Destination section of the rule so I will drag it to that section to apply it.</p>
<p>Now create as many objects as you need for your firewall and click and drag them to apply them. But don&#8217;t think you have to limit yourself to one rule. You can add as many rules to this firewall as you need.</p>
<p>Once you have completed building your firewall right click the firewall name (in my example it would be Desktop from the upper left pane) and click &#8220;Compile&#8221;.  This will open up a compilation wizard that is simple to walk through. The compilation will create a file with the same name as the firewall and an extension of .fw.  After the compilation is complete right click the firewall name and select Install. The installation wizard is also a simple walkthrough of steps. You will have to give a user for the firewall to run under as well as the password for that user. Also you will have to select if you are going to run in test mode or not. If you are install the firewall in test mode it will not be permanent. If you install in regular mode fwbuilder will ask you how soon you want to reboot your machine (so the firewall can take effect.) I suggest running in test most first. If this works then go back through the Install process and allow for full installation (including reboot).</p>
<p><strong>Final thoughts</strong></p>
<p>Fwbuilder is a powerful tool that allows you to create very customized firewalls. I highly recommend this tool for anyone serious about Linux security.</p>
<p><strong><br />
</strong></p>

	Tags: <a href="http://www.ghacks.net/tag/firewall-builder/" title="firewall builder" rel="tag">firewall builder</a>, <a href="http://www.ghacks.net/tag/fwbuilder/" title="fwbuilder" rel="tag">fwbuilder</a>, <a href="http://www.ghacks.net/tag/iptables/" title="iptables" rel="tag">iptables</a>, <a href="http://www.ghacks.net/tag/linux-security/" title="linux security" rel="tag">linux security</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/09/15/firestarter-simple-to-use-powerful-desktop-firewall/" title="Firestarter: Simple to use, powerful desktop firewall (September 15, 2009)">Firestarter: Simple to use, powerful desktop firewall</a> (6)</li>
	<li><a href="http://www.ghacks.net/2009/03/25/build-a-quick-and-reliable-firewall-with-fwbuilder/" title="Build a Quick and Reliable Firewall with fwbuilder (March 25, 2009)">Build a Quick and Reliable Firewall with fwbuilder</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/03/use-this-iptables-script-for-webmail-server-security/" title="Use this iptables script for Web/Mail server security (October 3, 2009)">Use this iptables script for Web/Mail server security</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/03/27/configure-a-linux-firewall-with-webmin/" title="Configure a Linux Firewall with Webmin (March 27, 2009)">Configure a Linux Firewall with Webmin</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/18/build-a-custom-firewall-with-fwbuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Track Google Keyword Rankings In Google Analytics</title>
		<link>http://www.ghacks.net/2009/09/12/how-to-track-google-keyword-rankings-in-google-analytics/</link>
		<comments>http://www.ghacks.net/2009/09/12/how-to-track-google-keyword-rankings-in-google-analytics/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 21:01:51 +0000</pubDate>
		<dc:creator>Martin</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[check keywords]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[google rankings]]></category>
		<category><![CDATA[keyword rankings]]></category>
		<category><![CDATA[keywords]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[serps]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16272</guid>
		<description><![CDATA[Professional webmasters, and also many other website owners, need a way to keep track of keyword rankings of their website. Keyword ranking simple means the position in selected search engines of a website for a specific keyword. Ghacks is for example ranking on the first spot in Google, and probably in every other search engine [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/google_analytics.jpg" alt="google analytics" title="google analytics" width="225" height="48" class="alignleft size-full wp-image-16273" />Professional webmasters, and also many other website owners, need a way to keep track of keyword rankings of their website. Keyword ranking simple means the position in selected search engines of a website for a specific keyword. Ghacks is for example ranking on the first spot in Google, and probably in every other search engine out there, for the term ghacks. Many webmasters want to keep track of rankings to be able to analyze their website&#8217;s performance and be ready for future optimizations to increase the traffic and thus the reach of the website.</p>
<p>SEO tools like WebCEO or SEO Elite are normally used to track rankings of keywords. It is also possible to check them manually which is fine for a few selected keywords but impossible for webmasters who track hundreds or even thousands of keywords.</p>
<p><span id="more-16272"></span>I recently came upon a post on a <a href="http://yoast.com/track-seo-rankings-and-sitelinks-with-google-analytics-ii/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=track-seo-rankings-and-sitelinks-with-google-analytics-ii">blog</a> that explained how to track Google rankings in Google Analytics. It did not work at first and I had to fix an error before the ranking tracking was actually working. Below is now the explanation on how to track a website&#8217;s ranking in Google.</p>
<p>You start by adding a new profile to an existing website. Start by clicking on the Add New Profile link on the right side of the overview of all websites that have been added to Google Analytics.</p>
<p><a href="http://www.ghacks.net/wp-content/uploads/2009/09/google_analytics1.jpg"><img src="http://www.ghacks.net/wp-content/uploads/2009/09/google_analytics1-500x252.jpg" alt="google analytics" title="google analytics" width="500" height="252" class="alignnone size-medium wp-image-16274" /></a></p>
<p>Now select to add a profile for an existing domain, select the domain from the drop down list and give it a unique name, e.g. website rankings. A click on continue will create the new website profile which will initially track the same data that the original profile is tracking.</p>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/google_analytics_new_profile-500x274.jpg" alt="google analytics new profile" title="google analytics new profile" width="500" height="274" class="alignnone size-medium wp-image-16275" /></p>
<p>You will be taken back to the profile overview page. Click on the edit link next to the newly created profile. Click on the Add Filter link on the right lower side of the profile detail page.</p>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/google_analytics_add_filter.jpg" alt="google analytics add filter" title="google analytics add filter" width="381" height="273" class="alignnone size-full wp-image-16276" /></p>
<p>We need to create three new filters:</p>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/filter1.jpg" alt="filter1" title="filter1" width="484" height="367" class="alignnone size-full wp-image-16277" /></p>
<blockquote><p>Filter name: Ranking 1<br />
Filter type: Custom filter &#8211; Include<br />
Filter field: Campaign Medium<br />
Filter pattern: organic</p></blockquote>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/filter2-500x366.jpg" alt="filter2" title="filter2" width="500" height="366" class="alignnone size-medium wp-image-16278" /></p>
<blockquote><p>
Filter name: Ranking 2<br />
Filter type: Custom filter &#8211; Include<br />
Filter field: Campaign Source<br />
Filter pattern: google</p></blockquote>
<p><img src="http://www.ghacks.net/wp-content/uploads/2009/09/filter3-500x341.jpg" alt="filter3" title="filter3" width="500" height="341" class="alignnone size-medium wp-image-16279" /></p>
<blockquote><p>Filter name: Ranking 3<br />
Filter type: Custom filter &#8211; Advanced<br />
Field A -> Extract A: Campaign term, (.*)<br />
Field B -> Extract B: Referral, (\?|&#038;)cd=([^&#038;]*)<br />
Output To -> User Defined: $A1 (position: $B2)</p></blockquote>
<p>It then takes a few hours before the first rankings can be checked as the new profile will start tracking traffic beginning with the time it was created.</p>
<p>The rankings are then accessible by clicking on Visitors > User Defined when checking the stats of a website. They look like this</p>
<p><a href="http://www.ghacks.net/wp-content/uploads/2009/09/google_rankings.jpg"><img src="http://www.ghacks.net/wp-content/uploads/2009/09/google_rankings-500x275.jpg" alt="google rankings" title="google rankings" width="500" height="275" class="alignnone size-medium wp-image-16280" /></a></p>
<p>And there you have it. A dead easy way to track keyword rankings in Google.</p>

	Tags: <a href="http://www.ghacks.net/tag/check-keywords/" title="check keywords" rel="tag">check keywords</a>, <a href="http://www.ghacks.net/tag/google-analytics/" title="google analytics" rel="tag">google analytics</a>, <a href="http://www.ghacks.net/tag/google-rankings/" title="google rankings" rel="tag">google rankings</a>, <a href="http://www.ghacks.net/tag/keyword-rankings/" title="keyword rankings" rel="tag">keyword rankings</a>, <a href="http://www.ghacks.net/tag/keywords/" title="keywords" rel="tag">keywords</a>, <a href="http://www.ghacks.net/tag/seo/" title="seo" rel="tag">seo</a>, <a href="http://www.ghacks.net/tag/serps/" title="serps" rel="tag">serps</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/08/11/test-googles-next-generation-search-engine-infrastructure/" title="Test Google&#8217;s Next-Generation Search Engine Infrastructure (August 11, 2009)">Test Google&#8217;s Next-Generation Search Engine Infrastructure</a> (3)</li>
	<li><a href="http://www.ghacks.net/2008/10/10/blogging-tips/" title="Blogging Tips (October 10, 2008)">Blogging Tips</a> (10)</li>
	<li><a href="http://www.ghacks.net/2007/12/18/an-advice-on-buying-and-selling-websites/" title="An Advice on Buying and Selling Websites (December 18, 2007)">An Advice on Buying and Selling Websites</a> (0)</li>
	<li><a href="http://www.ghacks.net/2009/06/26/a-niche-marketers-seo-toolbox/" title="A Niche Marketer&#8217;s SEO Toolbox (June 26, 2009)">A Niche Marketer&#8217;s SEO Toolbox</a> (17)</li>
	<li><a href="http://www.ghacks.net/2009/04/16/wordpress-seo-advanced-nofollow/" title="Wordpress SEO: Advanced Nofollow (April 16, 2009)">Wordpress SEO: Advanced Nofollow</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/12/how-to-track-google-keyword-rankings-in-google-analytics/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Add a second drive to your Ubuntu server</title>
		<link>http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server/</link>
		<comments>http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 19:20:12 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ext3 file system]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[mount drives]]></category>
		<category><![CDATA[new linux drive]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16193</guid>
		<description><![CDATA[You have your Ubuntu Server up and running (with the help of &#8220;Installing Ubuntu Server 9.04&#8220;) but you&#8217;re afraid you&#8217;ll run out of room on your drive. To solve this problem you have installed a new hard drive, but because this is a GUI-less server you do not have access to the user-friendly GUI tools [...]]]></description>
			<content:encoded><![CDATA[<p>You have your Ubuntu Server up and running (with the help of &#8220;<a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8220;) but you&#8217;re afraid you&#8217;ll run out of room on your drive. To solve this problem you have installed a new hard drive, but because this is a GUI-less server you do not have access to the user-friendly GUI tools that make this job easy. So you&#8217;re going to have to install this drive with the help of the command line.</p>
<p>GASP!</p>
<p>Never fear, it&#8217;s not that hard. Just a few commands and you&#8217;ll be up and running with your new hard drive installed on your server. This article will assume the physical drive is already installed on your machine.</p>
<p><span id="more-16193"></span>I am going to make a couple of assumptions here, for the sake of simplicity for this article. The first assumption is that the new drive will be mounted to the directory <strong>/data</strong>. The next assumption is that you want this directory to be both readable and writable by all users on the system. Another assumption is that you will want the drive to be formatted with the ext3 file system with just one partition. Finally I will assume you want this drive to be automatically mounted upon boot of the system.</p>
<p>With that out of the way, let&#8217;s get down to business.</p>
<p>Once you boot the machine with the new drive log into the console and issue the command:</p>
<p><span style="background-color: #ffffff">dmesg</span></p>
<p>Near the bottom of the output you should see where the disk is located. it will be <span style="background-color: #ffffff">something like:</span></p>
<p><em>/dev/sdb</em></p>
<p>So let&#8217;s assume it is on <strong>/dev/sdb.</strong></p>
<p>If you can&#8217;t figure it out where the drive is located  with <em>dmesg</em> issue the command:</p>
<p><em>sudo fdisk -l</em></p>
<p>The above command will report something like:</p>
<p><code>/dev/sda1   *           1       18709   150280011   83  Linux<br />
/dev/sda2           18710       19457     6008310    5  Extended<br />
/dev/sda5           18710       19457     6008278+  82  Linux swap / Solaris</code></p>
<p>But will include a listing for your new drive. If you only see listings for <strong>/dev/sda*</strong> then your new drive has not been recognized and there is a problem with the physical installation.</p>
<p>Once you know where your drive is located (again we&#8217;ll use <strong>/dev/sdb</strong> for our example) it&#8217;s time to create a new directory where this drive will be mounted. We are mounting our drive to the directory <strong>/data </strong><span style="background-color: #ffffff">so we&#8217;ll create this directory with the following command:</span></p>
<p><em>sudo mkdir /data</em></p>
<p>Now let&#8217;s make it available to all users:</p>
<p><em>sudo chmod -R 777 /data</em></p>
<p>With a place to mount the drive, it&#8217;s time to format the new drive. The formatting will be done with the command:</p>
<p><em>sudo mkfs.ext3 /dev/sdb</em></p>
<p>When this is complete you are ready to mount the drive. Before you edit fstab entry (so the drive will be automatically mounted) make sure it can be successfully mounted <span style="background-color: #ffffff">with the command:</span></p>
<p><em>sudo mount /dev/sdb /data</em></p>
<p>If this is successful let&#8217;s create an entry in <strong>/etc/fstab</strong>. open that <span style="background-color: #ffffff">file with the command</span></p>
<p><em>sudo nano /etc/fstab</em></p>
<p>Now add the following entry at the end of that file:</p>
<p><code>/dev/sdb /data  ext3 defaults 0 0</code></p>
<p>Once you save that file, mount the drive (without having to reboot) with the command:</p>
<p><em>sudo mount -a</em></p>
<p>To make sure the drive mounted successfully issue the command:</p>
<p><em>df</em></p>
<p>The above should include in the report:</p>
<p><em>/dev/sdb   /data</em></p>
<p>If that&#8217;s the case, success! You can run one file test by trying to write a file to the new drive with the command:</p>
<p><em>touch /data/test</em></p>
<p>If you can write that file all is well.</p>
<p><strong>Final thoughts</strong></p>
<p>Yes it is a bit more complicated than adding a new drive when you have GUI tools available, but it&#8217;s not anything that can&#8217;t be accomplished by the average user. If you are not afraid of the command line, you can add a second drive in Ubuntu with ease.</p>

	Tags: <a href="http://www.ghacks.net/tag/ext3-file-system/" title="ext3 file system" rel="tag">ext3 file system</a>, <a href="http://www.ghacks.net/tag/fstab/" title="fstab" rel="tag">fstab</a>, <a href="http://www.ghacks.net/tag/mount-drives/" title="mount drives" rel="tag">mount drives</a>, <a href="http://www.ghacks.net/tag/new-linux-drive/" title="new linux drive" rel="tag">new linux drive</a>, <a href="http://www.ghacks.net/tag/ubuntu-server/" title="ubuntu server" rel="tag">ubuntu server</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/04/02/which-ubuntu-derivative-is-right-for-you/" title="Which Ubuntu Derivative Is Right For You? (April 2, 2009)">Which Ubuntu Derivative Is Right For You?</a> (16)</li>
	<li><a href="http://www.ghacks.net/2009/10/03/use-this-iptables-script-for-webmail-server-security/" title="Use this iptables script for Web/Mail server security (October 3, 2009)">Use this iptables script for Web/Mail server security</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/01/03/understanding-linux-etcfstab/" title="Understanding Linux /etc/fstab (January 3, 2009)">Understanding Linux /etc/fstab</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/04/06/keep-logged-in-users-informed-with-motd/" title="Keep logged in users informed with motd (April 6, 2009)">Keep logged in users informed with motd</a> (0)</li>
	<li><a href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" title="Installing Ubuntu Server 9.04 (September 3, 2009)">Installing Ubuntu Server 9.04</a> (20)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/10/add-a-second-drive-to-your-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Install Mantis Bug Tracking tool on your Ubuntu Server</title>
		<link>http://www.ghacks.net/2009/09/08/install-mantis-bug-tracking-tool-on-your-ubuntu-server/</link>
		<comments>http://www.ghacks.net/2009/09/08/install-mantis-bug-tracking-tool-on-your-ubuntu-server/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 11:32:14 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[bug tracking]]></category>
		<category><![CDATA[Mantis]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16128</guid>
		<description><![CDATA[Here we go again, building upon that rock solid Ubuntu Server installation. If you haven&#8217;t already done so, you should read the first article in this series (&#8221;Installing Ubuntu Server 9.04&#8220;). Once you&#8217;ve read that (and followed the steps), you are ready to go for installing one of the easiest to use and most reliable [...]]]></description>
			<content:encoded><![CDATA[<p>Here we go again, building upon that rock solid Ubuntu Server installation. If you haven&#8217;t already done so, you should read the first article in this series (&#8221;<a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8220;). Once you&#8217;ve read that (and followed the steps), you are ready to go for installing one of the easiest to use and most reliable bug tracking systems available from the open source community.</p>
<p><a title="Mantis" href="http://www.mantisbt.org" target="_blank">Mantis</a> is an open source bug tracking tool that is as feature-rich and stable as it is free. It is written in PHP and works with MySQL, MS SQL, and PostgreSQL databases. Mantis can be installed on Linux, Windows, and OS X and can use nearly any modern web browser.</p>
<p><span id="more-16128"></span><strong>Features</strong></p>
<p>Naturally, before you try a bug tracking software, you will want to see the feature listing. Mantis Bug Tracking includes such features as:</p>
<ul>
<li>Simple or Advanced issue pages.</li>
<li>Multiple projects per instances.</li>
<li>User access levels.</li>
<li>Projects, sub-projects, and category support.</li>
<li>Built in reporting.</li>
<li>Custom fields.</li>
<li>Email notification.</li>
<li>Issue monitoring.</li>
<li>Sponsorship support.</li>
<li>Issue report via email.</li>
</ul>
<p>And much, much more (for a full list see the <a title="Feature list" href="http://www.mantisbt.org/wiki/doku.php/mantisbt:features" target="_blank">Mantis Feature List page</a>). But enough said with the what, let&#8217;s get on with the how.</p>
<p><strong>Getting and installing</strong></p>
<p>The first step is to download the file. You can download the latest, stable release from the <a title="Mantis download" href="http://sourceforge.net/projects/mantisbt/files/mantis-stable/1.1.8/mantisbt-1.1.8.tar.gz/download" target="_blank">Mantis Sourceforge site</a>. Once you have that file move it into the Apache document root with the command:</p>
<p><em>sudo mv mantis-XXX.tar.gz /var/www/</em></p>
<p>Where XXX is the release number.</p>
<p>Now unpack the tar file with the command;</p>
<p><em>sudo tar xvzf mantisbt-XXX.tar.gz</em></p>
<p>Where XXX is the release number.</p>
<p>Now change the name of the mantis directory with the command:</p>
<p><em>mv mantisbt-XXX mantis</em></p>
<p>Where XXX is the release number.</p>
<p>Before you move on to the web-based installation, you need to create a database. I use phpmyadmin to do this (Read how to set this up in my article &#8220;<a title="Install phpmyadmin" href="http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/" target="_blank">Install phpmyadmin for easy MySQL administration</a>&#8220;.) Create a database called &#8220;bugtracker&#8221; (no quotes). Once you have done that you then need to go to the file <strong>/var/www/mantis/config_inc.php.sample </strong>and edit the Database Settings variables. You will need to edit the variables:</p>
<ul>
<li>g_hostname</li>
<li>g_db_username</li>
<li>g_db_password</li>
</ul>
<p>Make these reflect your particular installation. Once you have that finished change the name of that file to <strong>config_inc.php</strong> and you are ready to check your installation.</p>
<p>You are now ready to point your browser to:</p>
<p>http://ADDRESS_OF_SERVER/mantis/admin/</p>
<p>Where ADDRESS_OF_SERVER is the actual IP or URL for your server.</p>
<p>You will see four links:</p>
<ul>
<li>Check your installation.</li>
<li>Upgrade your installation.</li>
<li>Modify stylesheets.</li>
<li>System utilities.</li>
</ul>
<p>Click on the Check your installation link. This address will take you to the page that will check your server for all the necessary requirements for installation. Once that passes you are ready for the installation.</p>
<p><strong>Web-based setup</strong></p>
<div id="attachment_16131" class="wp-caption alignleft" style="width: 380px"><a rel="attachment wp-att-16131" href="http://www.ghacks.net/2009/09/08/install-mantis-bug-tracking-tool-on-your-ubuntu-server/mantis_install/"><img class="size-full wp-image-16131" src="http://www.ghacks.net/wp-content/uploads/2009/09/mantis_install.png" alt="Figure 1" width="370" height="203" /></a><p class="wp-caption-text">Figure 1</p></div>
<p>Now point your browser to http://ADDRESS_OF_SERVER/admin/install.php This page will walk you through the steps for the database setup (see Figure 1.)</p>
<p>Oddly enough it looks like you are being asked to create an admin acccount here. You&#8217;re not, for the Admin Username/Password you will want to use the same Username/Password that you used for the Database user.</p>
<p>Fill that information out and click the Install button. The next page will greet you with a bunch of information that informs you (Hopefully) that everything passes. At the bottom of that page is a small link to continue with login. Click that link and you will find yourself at the Mantis Log In screen. The default username/login for a mantis installation is:</p>
<p>Username: administrator</p>
<p>Password: root</p>
<p>The first thing you will want to do, upon logging in, is to change the account information for this login. Click on the My Account button and make the necessary changes.</p>
<p>You are now ready to start using your Mantis Bug Tracking system.</p>
<p><strong>Final thoughts</strong></p>
<p>I have found the Mantis Bug Tracking system to be one of the easiest to use in a category that is often filled with overly complicated tool (either to install or use). I think you will find that Mantis meets (or exceeds) all of your bug tracking needs.</p>

	Tags: <a href="http://www.ghacks.net/tag/bug-tracking/" title="bug tracking" rel="tag">bug tracking</a>, <a href="http://www.ghacks.net/tag/mantis/" title="Mantis" rel="tag">Mantis</a>, <a href="http://www.ghacks.net/tag/ubuntu/" title="ubuntu" rel="tag">ubuntu</a>, <a href="http://www.ghacks.net/tag/ubuntu-server/" title="ubuntu server" rel="tag">ubuntu server</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/04/02/which-ubuntu-derivative-is-right-for-you/" title="Which Ubuntu Derivative Is Right For You? (April 2, 2009)">Which Ubuntu Derivative Is Right For You?</a> (16)</li>
	<li><a href="http://www.ghacks.net/2009/04/06/keep-logged-in-users-informed-with-motd/" title="Keep logged in users informed with motd (April 6, 2009)">Keep logged in users informed with motd</a> (0)</li>
	<li><a href="http://www.ghacks.net/2009/06/08/how-to-install-nagios-on-ubuntu-server/" title="How to install Nagios on Ubuntu server (June 8, 2009)">How to install Nagios on Ubuntu server</a> (10)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
	<li><a href="http://www.ghacks.net/2006/12/20/why-you-should-switch-your-parents-pc-to-ubuntu/" title="Why you should switch your parents pc to ubuntu (December 20, 2006)">Why you should switch your parents pc to ubuntu</a> (20)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/08/install-mantis-bug-tracking-tool-on-your-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Configure your Ubuntu Server as a DHCP server</title>
		<link>http://www.ghacks.net/2009/09/07/configure-your-ubuntu-server-as-a-dhcp-server/</link>
		<comments>http://www.ghacks.net/2009/09/07/configure-your-ubuntu-server-as-a-dhcp-server/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 22:41:06 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[dhcp server]]></category>
		<category><![CDATA[dhcp3-server]]></category>
		<category><![CDATA[linux dhcp server]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16071</guid>
		<description><![CDATA[In my recent Ubuntu Server articles I have covered the following topics:
Installing Ubuntu Server 9.04
Set up your new Ubuntu Server as a Samba server
Add FTP service to your Ubuntu Server
Now it&#8217;s time to get a bit deeper in the trenches by configuring that same Ubuntu server to serve up DHCP addresses. You might think this [...]]]></description>
			<content:encoded><![CDATA[<p>In my recent Ubuntu Server articles I have covered the following topics:</p>
<p><a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a></p>
<p><a title="Set up your new Ubuntu Server as a Samba Server" href="http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/" target="_blank">Set up your new Ubuntu Server as a Samba server</a></p>
<p><a title="Add FTP service to your Ubuntu server" href="http://www.ghacks.net/2009/09/06/add-ftp-service-to-your-ubuntu-server/" target="_blank">Add FTP service to your Ubuntu Server</a></p>
<p>Now it&#8217;s time to get a bit deeper in the trenches by configuring that same Ubuntu server to serve up DHCP addresses. You might think this is a difficult setup, but it&#8217;s not. And many might be asking &#8220;Why do this when my router does the trick?&#8221; Most routers do a good job of serving up DHCP addresses. But there are times when those routers aren&#8217;t as configurable as we&#8217;d like them. Or maybe you want your DHCP server/router to also act as a much stronger firewall than what a standard router can handle. In these cases it&#8217;s nice to be able to set up your own DHCP server. And in this article, we will do just that.</p>
<p><span id="more-16071"></span><strong>Nuts and bolts</strong></p>
<p>The information you should know about the DHCP server in this article looks like this (for examples&#8217; sake):</p>
<ul>
<li>ethernet device: eth0</li>
<li>IP Address range: 192.168.1.100 &#8211; 192.168.1.200</li>
<li>Subnet address: 192.168.1.0</li>
<li>Netmask: 255.255.255.0</li>
<li>DNS Servers: 208.67.222.222 and 208.67.220.220 (OpenDNS for those who do not know)</li>
<li>Domain: my.example.net</li>
<li>Gateway Address: 192.168.1.1</li>
<li>Broadcast Address: 192.168.1.255</li>
</ul>
<p>What you will need to do install the dhcp3-server package in order to serve up the addresses. To install this issue the command:</p>
<p><em>sudo apt-get install dhcp3-server</em></p>
<p>You will need to enter your sudo password for the installation to begin. When the installation is complete you will have the configuration file (dhcp3-server) located in <strong>/etc/default/</strong> and the executable command (dhcp3-server) will be located in <strong>/etc/init.d/</strong>.</p>
<p>Before you fire up the server you first must handle some configuration.</p>
<p><strong>Configuration</strong></p>
<p>The first configuration is to set the ethernet device. Open up the configuration file with the command:</p>
<p><em>nano /etc/default/dhcp3-server</em></p>
<p>On line 11 of this file (Which is actually the last line because this file is basically empty) you will see the line:</p>
<p>INTERFACES=&#8221;"</p>
<p>Change this line to read:</p>
<p>INTERFACES=&#8221;eth0&#8243;</p>
<p>You are finished with this file. Save the file and then open up the file <strong>/etc/dhcp3/dhcpd.conf</strong>. The first line you will need to edit is line 16. This line will look like this:<br />
<code># option definitions common to all supported networks...<br />
option domain-name "example.org";<br />
option domain-name-servers ns1.example.org, ns2.example.org;</code></p>
<p><code>default-lease-time 600;<br />
max-lease-time 7200;</code></p>
<p>You need to comment out all of those lines so they look like:<br />
<code># option definitions common to all supported networks...<br />
#option domain-name "example.org";<br />
#option domain-name-servers ns1.example.org, ns2.example.org;</code></p>
<p><code>#default-lease-time 600;<br />
#max-lease-time 7200;</code></p>
<p>Now go down to line 53. Here you will see this section:<br />
<code># A slightly different configuration for an internal subnet.<br />
#subnet 10.5.5.0 netmask 255.255.255.224 {<br />
#  range 10.5.5.26 10.5.5.30;<br />
#  option domain-name-servers ns1.internal.example.org;<br />
#  option domain-name "internal.example.org";<br />
#  option routers 10.5.5.1;<br />
#  option broadcast-address 10.5.5.31;<br />
#  default-lease-time 600;<br />
#  max-lease-time 7200;<br />
#}</code></p>
<p>This section needs to be uncommented out and edited to reflect this:<br />
<code># A slightly different configuration for an internal subnet.<br />
subnet 192.168.1.0 netmask 255.255.255.0 {<br />
range 192.168.1.100 192.168.1.200;<br />
option domain-name-servers 208.67.222.222, 208.67.220.220;<br />
option domain-name "my.example.net";<br />
option routers 192.168.1.1;<br />
option broadcast-address 192.168.1.255;<br />
default-lease-time 600;<br />
max-lease-time 7200;<br />
}</code></p>
<p>Save this file and you are ready to fire up your DHCP server.</p>
<p><strong>Starting the service</strong></p>
<p>To start the DHCP server issue the command:</p>
<p><strong>/etc/init.d/dhcp3-server start</strong></p>
<p>You should see no errors. Once your server is up and running go to one of your machines and restart the networking. You should get a new IP address as well as the DNS addresses configured. If your machine does not find the server you may have to configure the DHCP server IP address. This should not be necessary, but it&#8217;s good to know in a pinch.</p>
<p><strong>Final thoughts</strong></p>
<p>You probably didn&#8217;t realize how simple it would be to set up a DHCP server did you? Now you know. This set up should make for a very reliable DHCP server for your internal network.</p>

	Tags: <a href="http://www.ghacks.net/tag/dhcp-server/" title="dhcp server" rel="tag">dhcp server</a>, <a href="http://www.ghacks.net/tag/dhcp3-server/" title="dhcp3-server" rel="tag">dhcp3-server</a>, <a href="http://www.ghacks.net/tag/linux-dhcp-server/" title="linux dhcp server" rel="tag">linux dhcp server</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/07/06/microsoft-rogue-detection-tool/" title="Microsoft Rogue Detection Tool (July 6, 2009)">Microsoft Rogue Detection Tool</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/07/configure-your-ubuntu-server-as-a-dhcp-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Set up your new Ubuntu Server as a Samba Server</title>
		<link>http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/</link>
		<comments>http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 16:58:23 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[file-sharing]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[samba server]]></category>
		<category><![CDATA[smb.conf]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=16023</guid>
		<description><![CDATA[I recently did an illustrated guide to installing Ubuntu Server 9.04 (&#8221;Installing Ubuntu Server 9.04&#8220;). I did that for two reasons: 1) It was requested and 2) It will serve as a base for future articles that will cover many different topics. Having that foundation will be key to getting other services up and running.
In [...]]]></description>
			<content:encoded><![CDATA[<p>I recently did an illustrated guide to installing Ubuntu Server 9.04 (&#8221;<a title="Installing Ubuntu Server 9.04" href="http://www.ghacks.net/2009/09/03/installing-ubuntu-server-9-04/" target="_blank">Installing Ubuntu Server 9.04</a>&#8220;). I did that for two reasons: 1) It was requested and 2) It will serve as a base for future articles that will cover many different topics. Having that foundation will be key to getting other services up and running.</p>
<p>In this article I am going to show you how to get a basic Samba Server up and running on top of that Ubuntu Server. Now, because the Ubuntu Server was set up as a headless server, the installation and configuration of Samba will be done completely from the command line. So get your fingers ready to type.</p>
<p><span id="more-16023"></span><strong>What is Samba?</strong></p>
<p>Samba is a very handy tool that can do many things. The primary task it serves is to enable a Windows machine to access a Linux machine serving as a file and/or print server. Samba uses the SMB/CIFS protocols to enable communication between the Windows and the Linux machine.</p>
<p>Samba has often been thought of as very difficult to get up and running. It&#8217;s not really that bad. Hopefully, by the end of this article, you will have a fairly good understanding of how to get it up and running.</p>
<p><strong>Installing Samba</strong></p>
<p>As I said, you will doing this completely from the command line. The command to issue is:</p>
<p><em>sudo apt-get install samba</em></p>
<p>You will have to enter your sudo password to continue with the installation. Depending upon your server installation, you might have to okay some dependencies. Go ahead and do this and then watch as Samba is installed.</p>
<p>Once installed you will have the Samba executable in <strong>/etc/init.d/</strong>. In order to start Samba you will issue the command:</p>
<p><em>/etc/init.d/samba star</em><em>t</em></p>
<p>Of course, before you start Samba, you will need to configure Samba. There are a few steps to take care of. Let&#8217;s first deal with the configuration file.</p>
<p><strong>Configuring Samba</strong></p>
<p>Before you get too deep into this you might want to first read my article &#8220;<a title="Understanding smb.conf" href="http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/" target="_blank">Get To Know Linux: Understanding smb.conf</a>&#8220;. The Samba configuration file is located in the <strong>/etc</strong><strong>/samba</strong> directory and is called <strong>smb.conf</strong>. When you first open up this file you may be overwhelmed. Let&#8217;s avoid that by making a backup of the original <strong>smb.conf </strong>file. Change to the <strong>/etc/samba</strong> directory with the command:</p>
<p><em>cd /etc/samba</em></p>
<p>Now issue the following command:</p>
<p><span style="background-color: #ffffff"><em>sudo cp smb.con smb.conf.bak</em></span></p>
<p><span style="background-color: #ffffff">Now you can open up the <strong>smb.conf</strong> file and erase the entirety of its contents. How do you do that? If you are using the Nano editor it&#8217;s simple. With the file open hold the Ctrl key and the &#8216;K&#8217; key down until the entire contents are gone. Or you can delete the file and create a new one. Your choice.</span></p>
<p><span style="background-color: #ffffff">With a fresh <strong>smb.conf </strong>you are ready to re-create a file based on your needs. A good configuration to start with looks like:</span></p>
<p><code>[global]<br />
netbios name = NETBIOS_NAME<br />
workgroup = WORKGROUP_NAME<br />
security = user<br />
encrypt passwords = yes<br />
smb passwd file = /etc/samba/smbpasswd<br />
interfaces = 192.168.1.1/8</code></p>
<p><code>[SHARE_NAME]<br />
comment = COMMENT<br />
path = /PATH/TO/SHARE<br />
writeable = yes<br />
create mode = 0600<br />
directory mode = 0700<br />
locking = yes</code></p>
<p><span style="background-color: #ffffff">Where everything in ALL CAPS (as well as the interfaces line) is unique to your needs.</span></p>
<p><span style="background-color: #ffffff">The SHARE_NAME is what you want to share out to your users. So if you are setting up a file server for a number of users you will want to have a directory, say <strong>/data</strong>, that is shared out through Samba. </span></p>
<p><span style="background-color: #ffffff">Once you have the <strong>smb.conf</strong> file configured to suit your needs you are ready for the last steps.</span></p>
<p><span style="background-color: #ffffff"><strong>Adding users</strong></span></p>
<p><span style="background-color: #ffffff">This is the step that most people skip and wonder why Samba isn&#8217;t working. For every user that needs to log in to the Samba server you have to add them with the help of the <em>smbpasswd </em>command. Let&#8217;s say I need to add the user &#8220;pickles&#8221;.  To add &#8220;pickles&#8221; I would issue the command:</span></p>
<p><span style="background-color: #ffffff"><em>sudo smbpasswd -L -a pickles</em></span></p>
<p>Now to make sure the users is enabled issue the command:</p>
<p><em>sudo smbpasswd -L -e pickels</em></p>
<p>Now restart Samba with the command:</p>
<p><em>sudo /etc/init.d/samba restart</em></p>
<p>Your Samba file server should be ready to go. Go to your windows machine and the Share should be visible. Double click on that share you and you will enter the username and password combination for any one of the users on the machine (as long as they were also added with smbpasswd). If you can not see it make sure your Windows machine is set up on the Workgroup.</p>

	Tags: <a href="http://www.ghacks.net/tag/file-sharing/" title="file-sharing" rel="tag">file-sharing</a>, <a href="http://www.ghacks.net/tag/samba/" title="samba" rel="tag">samba</a>, <a href="http://www.ghacks.net/tag/samba-server/" title="samba server" rel="tag">samba server</a>, <a href="http://www.ghacks.net/tag/smbconf/" title="smb.conf" rel="tag">smb.conf</a>, <a href="http://www.ghacks.net/tag/ubuntu/" title="ubuntu" rel="tag">ubuntu</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/02/06/get-to-know-linux-understanding-smbconf/" title="Get To Know Linux: Understanding smb.conf (February 6, 2009)">Get To Know Linux: Understanding smb.conf</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/05/03/connecting-linux-to-a-bubba-2/" title="Connecting Linux to a Bubba 2 (May 3, 2009)">Connecting Linux to a Bubba 2</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/11/04/connect-to-your-samba-server-from-linux/" title="Connect to your Samba server from Linux (November 4, 2009)">Connect to your Samba server from Linux</a> (4)</li>
	<li><a href="http://www.ghacks.net/2008/07/28/you-are-sharing-files/" title="You Are Sharing Files (July 28, 2008)">You Are Sharing Files</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/09/04/set-up-your-new-ubuntu-server-as-a-samba-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adding a widescreen monitor in Linux</title>
		<link>http://www.ghacks.net/2009/08/03/adding-a-widescreen-monitor-in-linux/</link>
		<comments>http://www.ghacks.net/2009/08/03/adding-a-widescreen-monitor-in-linux/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 19:42:13 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[nvidia-settings]]></category>
		<category><![CDATA[widescreen monitor]]></category>
		<category><![CDATA[xorg.conf]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=15013</guid>
		<description><![CDATA[Recently I purchased a 23&#8243; wide screen monitor for my primary desktop PC. I had a feeling there would be a bit of an issue when I plugged it into my Elive Compiz installation that isn&#8217;t as user-friendly as, say, a Ubuntu installation. When I did plug it in it wasn&#8217;t horrible. The biggest problem [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I purchased a 23&#8243; wide screen monitor for my primary desktop PC. I had a feeling there would be a bit of an issue when I plugged it into my Elive Compiz installation that isn&#8217;t as user-friendly as, say, a Ubuntu installation. When I did plug it in it wasn&#8217;t horrible. The biggest problem I had was the new aspect ratio of the monitor (16:9) was causing everything on the screen to seem stretched with the previous resolution (1280&#215;1024).</p>
<p>The monitor itself was reporting that the ideal resolution was 1920&#215;1080, so I figured it was just a matter of adding the correct mode to the &#8220;Screen&#8221; section of my <strong>/etc/X11/xorg.conf </strong>file (see more about this in my article &#8220;<a title="Understanding the xorg.conf file" href="http://www.ghacks.net/2009/02/04/get-to-know-linux-understanding-xorgconf/" target="_blank">Get to know Linux: Understanding the xorg.conf file</a>&#8220;). It wasn&#8217;t that easy.</p>
<p><span id="more-15013"></span><strong>The first attempt</strong></p>
<p>Normally, when I needed to change a resolution, or just hard-code a resolution, I would add a sub section in the xorg.conf file like:</p>
<p><code>SubSection "Display"<br />
Modes "1920x1080" "1440x900" "1600x1200" "1440x1440" "1280x1024"      "1280x960" "1280x800" "1152x864" "1024x768" "832x624" "800x600" "720x400" "640x480"<br />
EndSubSection</code></p>
<p>Normally this would work, picking up the 1920&#215;1080 mode first. In this instance, however, this did not work. I will tell you that I am working with an NVidia Geforce 8800 chipset, so support in Linux is quite good. I know this isn&#8217;t an issue with the video card.  But no matter what resolution I used I was having no luck fighting the aspect ratio. The screen was either stretched too far horizontally, cropped at the bottom, or cropped all around.</p>
<p>I remembered there was an application that would gather information about my monitor and report it back. Maybe that was the key. The application is <em>ddcprobe</em> will give you the following information:</p>
<ul>
<li>Monitor name</li>
<li>Monitor VertRefresh values and HorizSync rates range</li>
<li>dpms</li>
</ul>
<p>To install this application issue the command:</p>
<p><em>sudo apt-get install xresprobe</em></p>
<p>and you are ready to check. To do this issue the command</p>
<p><em>ddcprobe</em></p>
<p>which will return something like this:</p>
<p><code>vbe: VESA 3.0 detected.<br />
oem: NVIDIA<br />
vendor: Build    070809.2<br />
product: MCP67 - mcp68-02 Chip Rev<br />
memory: 65536kb<br />
mode: 640x400x256<br />
mode: 640x480x256<br />
mode: 800x600x16<br />
mode: 800x600x256<br />
mode: 1024x768x16<br />
mode: 1024x768x256<br />
mode: 1280x1024x16<br />
mode: 1280x1024x256<br />
mode: 320x200x64k<br />
mode: 320x200x16m<br />
mode: 640x480x64k<br />
mode: 640x480x16m<br />
mode: 800x600x64k<br />
mode: 800x600x16m<br />
mode: 1024x768x64k<br />
mode: 1024x768x16m<br />
mode: 1280x1024x64k<br />
mode: 1280x1024x16m<br />
edid:<br />
edidfail</code></p>
<p>Notice the edidfail at the end. What happens is sometimes hardware will not respond properly when the EDID is queried. If this happens try to probe a few more times, you should get more information. In my case, the Samsung 2333sw would never report the full information.</p>
<p>Back to square one.</p>
<p><strong>NVidia</strong></p>
<p>Remember I mentioned I was using an NVidia GeForce chipset? That&#8217;s a good thing because there is a handy application called <em>nvidia-settings</em> that I had used with much success before. The only reason I hadn&#8217;t automatically tried this was because I have had issues with the Elive Compiz distribution and X when trying to use tools not standard to the distribution. And besides the Elive resolution tool wasn&#8217;t picking up the new monitor so there was no hope there.</p>
<p>Installing the new tool was as simple as issuing:</p>
<p><em>sudo apt-get install nvidia-settings</em></p>
<p>Running the tool was equally as easy by issuing the command:</p>
<p><em>sudo nvidia-settings</em></p>
<div id="attachment_15014" class="wp-caption alignleft" style="width: 470px"><a rel="attachment wp-att-15014" href="http://www.ghacks.net/2009/08/03/adding-a-widescreen-monitor-in-linux/nvidia_settings/"><img class="size-full wp-image-15014" src="http://www.ghacks.net/wp-content/uploads/2009/08/nvidia_settings.png" alt="Figure 1" width="460" height="360" /></a><p class="wp-caption-text">Figure 1</p></div>
<p>When this application starts you will see a number of sections in the left pane (see Figure 1) that you can click on. Click on the X Server Display Configuration and you will then see a button for Detect Displays. Click on that and the new resolution should appear. The next step is to click the Save to X Configuration File which will write your changes.Finally click the Quit button to finish up.</p>
<p>In order to actually have the changes take effect you have to log out of X and log back in. Once you do you should see your new wide screen monitor in action.</p>
<p><strong>What did it write?</strong></p>
<p>The results of the <em>nvidia-settings</em> change to the xorg.conf file surprised me. It completely rewrote the &#8220;Screen&#8221; section of the Xorg configuration file. Here is the &#8220;Screen&#8221; section:</p>
<p><code>Section "Screen"<br />
Identifier     "Screen0"<br />
Device         "Videocard0"<br />
Monitor        "Monitor0"<br />
DefaultDepth    24<br />
Option         "TwinView" "0"<br />
Option         "TwinViewXineramaInfoOrder" "CRT-0"<br />
Option         "metamodes" "1920x1080 +0+0; 1440x900 +0+0; 1280x1024 +0+0; 1280x960 +0+0; 1280x800 +0+0; 1024x768 +0+0; 800x600 +0+0; 640x480 +0+0"<br />
SubSection     "Display"<br />
Depth       24<br />
EndSubSection<br />
EndSection</code></p>
<p>The TwinView option is usually used for dual head displays. In order for Xorg to get the 16:9 aspect ration it must use it and splice the two images together.</p>
<p><strong>Final thoughts</strong></p>
<p>Linux has come such a long way. But when you are attempting to configure a distribution that isn&#8217;t especially made to be Noobie-friendly don&#8217;t expect for tasks like attaching a widescreen monitor to be an out of the box experience. The good news is that there are plenty of tools to help you out of little situations such as this.</p>
<p>In the end the new monitor works and is as beautiful a display as I have seen.</p>

	Tags: <a href="http://www.ghacks.net/tag/nvidia-settings/" title="nvidia-settings" rel="tag">nvidia-settings</a>, <a href="http://www.ghacks.net/tag/widescreen-monitor/" title="widescreen monitor" rel="tag">widescreen monitor</a>, <a href="http://www.ghacks.net/tag/xorgconf/" title="xorg.conf" rel="tag">xorg.conf</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/02/04/get-to-know-linux-understanding-xorgconf/" title="Get To Know Linux: Understanding xorg.conf (February 4, 2009)">Get To Know Linux: Understanding xorg.conf</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/01/14/fedora-10-and-the-evolution-of-xorg/" title="Fedora 10 and the Evolution of Xorg (January 14, 2009)">Fedora 10 and the Evolution of Xorg</a> (8)</li>
	<li><a href="http://www.ghacks.net/2008/08/07/display-information-about-computer-monitors/" title="Display Information About Computer Monitors (August 7, 2008)">Display Information About Computer Monitors</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/08/03/adding-a-widescreen-monitor-in-linux/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Install VirtualBox with USB support</title>
		<link>http://www.ghacks.net/2009/08/01/install-virtualbox-with-usb-support/</link>
		<comments>http://www.ghacks.net/2009/08/01/install-virtualbox-with-usb-support/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 18:34:15 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[usb support]]></category>
		<category><![CDATA[virtual box]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=14956</guid>
		<description><![CDATA[If you&#8217;ve installed VirtualBox as instructed in my tutorial &#8220;Install and configure VirtualBox for virtual OSes&#8221; you most likely have discovered that the open source edition of VirtualBox does not have USB support. In fact there are a few other features the open source edition does not offer that the closed-source edition does (such as [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve installed VirtualBox as instructed in my tutorial &#8220;<a title="VirtualBox" href="http://www.ghacks.net/2009/06/14/installing-and-configuring-virtualbox-for-virtual-oses/" target="_blank">Install and configure VirtualBox for virtual OSes</a>&#8221; you most likely have discovered that the open source edition of VirtualBox does not have USB support. In fact there are a few other features the open source edition does not offer that the closed-source edition does (such as offering the Remote Display Protocol so you can connect to a virtual machine remotely). But to get these features you will have to uninstall your current VirtualBox OSE installation, install the closed source version, and then configure your set up to allow USB support. It&#8217;s not difficult so pretty much anyone can undertake this.  In this article you will see how to uninstall VirtualBox OSE, install VirtualBox, and configure VirtualBox to allow USB support. For the purposes of this article, I will using a Ubuntu 9.04 installation to make things easy. NOTE: If you have virtual machines installed you will lose the data on those VMs.<br />
<span id="more-14956"></span></p>
<p><strong>Remove VirtualBox OSE</strong></p>
<p>This is the easiest part of the tutorial. All you need to do is open up a terminal window and issue the command:</p>
<p><code>sudo apt-get autoremove virtualbox-ose</code></p>
<p>Once the OSE version has been removed it is time to install the closed source version of VirtualBox.</p>
<p><strong>Installing closed source VirtualBox</strong></p>
<p>The first thing to do is to add the proper sources to your <strong>/etc/apt/sources.list</strong> file. Open up that file, with your favorite editor, and add the following line to the end of that file:</p>
<p><code>deb http://download.virtualbox.org/virtualbox/debian jaunty non-free</code></p>
<p>Now save the <a title="VirtualBox key" href="http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc" target="_blank">VirtualBox repository key</a> on your machine (for the sake of simplicity place it in <strong>~/Downloads</strong>) and issue the following command:</p>
<p><code>sudo apt-key add ~/Downloads/sun_vbox.asc</code></p>
<p>which will add the repo key to your system. Before you run the install update apt with the command:</p>
<p><code>sudo apt-get update</code></p>
<p>Now you can install the closed source version of VirtualBox with the command:</p>
<p><code>sudo apt-get install virtualbox-2.2</code></p>
<p>During the installation you will also have to OK the compilation of the proper kernel module. If you do not do this you may not be able to create any VMs.</p>
<p>The last step for the installation is to add your user to the vboxusers group. Do this with the following command:</p>
<p><code>sudo gpasswd -a USERNAME vboxusers</code></p>
<p>Where USERNAME is your login. You will be prompted for your username.</p>
<p><strong>Configure USB</strong></p>
<p>Now it&#8217;s time to configure the system to allow USB support. You have to get the user ID of the vboxusers group. To do this issue the following command:</p>
<p><code>grep vboxusers /etc/group</code></p>
<p>which will report something like:</p>
<p><code>vboxusers:x:123:</code></p>
<p>What you need to now do is add a line to the <strong>/etc/fstab </strong>file. This line will be (if we stick with the user ID report you see above):</p>
<p><code>none /proc/bus/usb usbfs devgid=123,devmode=664 0 0</code></p>
<p>With that file saved you are ready to reboot and start up VirtualBox with USB support.</p>
<p><strong>Final thoughts</strong></p>
<p>There are a lot of reasons why you would want to have USB support added to VirtualBox. For those iPhone owners out there it will give you a means to administer your phone without having to have a separate machine (or dual boot) in order to do so. This also greatly expands the capabilities of VirtualBox. The only downfall is you are giving up the open source version in order to gain USB support. For many this will be a worth wile trade-off. For others, giving over to closed sourced software isn&#8217;t worth having USB support. It would be nice, however, if Sun would open source the USB supported version.</p>

	Tags: <a href="http://www.ghacks.net/tag/fstab/" title="fstab" rel="tag">fstab</a>, <a href="http://www.ghacks.net/tag/usb/" title="usb" rel="tag">usb</a>, <a href="http://www.ghacks.net/tag/usb-support/" title="usb support" rel="tag">usb support</a>, <a href="http://www.ghacks.net/tag/virtual-box/" title="virtual box" rel="tag">virtual box</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2007/06/15/use-pstart-to-access-your-portable-devices/" title="Use PStart to access your portable devices (June 15, 2007)">Use PStart to access your portable devices</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/03/05/usb-port-protection/" title="USB Port Protection (March 5, 2009)">USB Port Protection</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/03/08/usb-flashdrive-benchmark/" title="USB Flashdrive Benchmark (March 8, 2009)">USB Flashdrive Benchmark</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/08/19/usb-flash-drives-cleaner/" title="USB Flash Drives Cleaner (August 19, 2009)">USB Flash Drives Cleaner</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/04/03/usb-flash-drive-write-protection/" title="USB Flash Drive Write Protection (April 3, 2009)">USB Flash Drive Write Protection</a> (12)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/08/01/install-virtualbox-with-usb-support/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Install VirtualBox Guest Additions for Windows 7</title>
		<link>http://www.ghacks.net/2009/07/29/install-virtualbox-guest-additions-for-windows-7/</link>
		<comments>http://www.ghacks.net/2009/07/29/install-virtualbox-guest-additions-for-windows-7/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:21:28 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[virtual box]]></category>
		<category><![CDATA[virtual-machine]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[virtualbox guest additions]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=14883</guid>
		<description><![CDATA[You may have read my series on VirtualBox virtual machine manager. If not, here it is:
Installing and configuring VirtualBox for virtual OSes.
Installing Windows XP as a virtual machine in VirtualBox.
Install Guest Additions for a better VirtualBox experience.
A new way of thinking thanks to virtual machines.
Although the Guest Additions tool has been covered already, if you&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>You may have read my series on VirtualBox virtual machine manager. If not, here it is:</p>
<p><a title="Installing and configuring VirtualBox" href="http://www.ghacks.net/2009/06/14/installing-and-configuring-virtualbox-for-virtual-oses/" target="_blank">Installing and configuring VirtualBox for virtual OSes</a>.</p>
<p><a title="Installing Windows XP in VirtualBox" href="http://www.ghacks.net/2009/06/15/installing-a-windows-xp-as-a-virtual-machine-on-virtualbox/" target="_blank">Installing Windows XP as a virtual machine in VirtualBox</a>.</p>
<p><a title="Install Guest Additions" href="http://www.ghacks.net/2009/06/17/install-guest-additions-for-a-better-virtualbox-experience/" target="_blank">Install Guest Additions for a better VirtualBox experience</a>.</p>
<p><a title="Virtual Machines" href="http://www.ghacks.net/2009/07/27/a-new-way-of-thinking-thanks-to-virtual-machines/" target="_blank">A new way of thinking thanks to virtual machines</a>.</p>
<p>Although the Guest Additions tool has been covered already, if you&#8217;ve tried using <a href="http://windows7news.com/">Windows 7</a> in VirtualBox you will have most likely encountered some issues. The main issue is that Guest Additions isn&#8217;t supported. That doesn&#8217;t mean it can not be installed. It can, you just have to trick Windows 7 in order to do so. In this article I will show you just how to do so.</p>
<p><span id="more-14883"></span></p>
<p><strong>The basic installation</strong></p>
<p>The first thing you need to do is get Windows 7 installed as a virtual machine. You can follow the directions for installing Windows XP. The only difference will be selecting the version of Windows you will be installing. Even though Windows 7 is not yet officially supported, there is an entry for the latest Microsoft OS in the dropdown.</p>
<p>After Windows 7 is installed you might notice (depending upon your hardware) that you can not see the task bar. This is because, without the Guest Additions, VirtualBox can not handle the proper resolution for Windows 7. So, it&#8217;s obvious you will need this tool.</p>
<p><strong>The trick </strong></p>
<p>The trick for installing Guest Additions in Window 7 is to trick it into thinking it&#8217;s being installed in Vista. While Vista is running click on the Devices menu and select Install Guest Additions. You will go through the same steps as you would for installing the Guest Additions on Windows XP at this point. The difference is the actual installer won&#8217;t start up. This is where it gets a bit tricky.</p>
<p>The process of installing the Guest Additions will have downloaded a mountable file on your system. If you click on the Windows 7 Start Menu and then click on Computer you will see that file listed along with Local Disk and Floppy Drive (even if you don&#8217;t have a floppy drive). Right click the VirtualBox Guest Additions entry (it will probably be labeled as &#8220;D&#8221;) and select Open.</p>
<p>In the resulting window you will see a number of files. Among these files you will see listed entries for both x86 and 64bit. These files are called:</p>
<p>VBoxWindowsAdditions-amd64</p>
<p>VBoxWindowsAdditions-x86</p>
<div id="attachment_14893" class="wp-caption alignleft" style="width: 309px"><a rel="attachment wp-att-14893" href="http://www.ghacks.net/2009/07/29/install-virtualbox-guest-additions-for-windows-7/vbox_win7_compat/"><img class="size-medium wp-image-14893 " src="http://www.ghacks.net/wp-content/uploads/2009/07/vbox_win7_compat-499x340.png" alt="Figure 1" width="299" height="204" /></a><p class="wp-caption-text">Figure 1</p></div>
<p>Which file you use will depend upon what hardware you are using. Right click the one you want to use and select Troubleshoot Compatibility (see Figure 1). This will walk you through a Wizard that will attempt to solve the problem. Most likely it won&#8217;t, so you will have to do so manually. When the wizard has finished you will have two options: Try Recommended Settings and Troubleshoot Program. Select Troubleshoot Program and then, in the new window, select the first entry which is</p>
<div id="attachment_14894" class="wp-caption alignright" style="width: 310px"><a rel="attachment wp-att-14894" href="http://www.ghacks.net/2009/07/29/install-virtualbox-guest-additions-for-windows-7/vista/"><img class="size-medium wp-image-14894 " src="http://www.ghacks.net/wp-content/uploads/2009/07/vista-500x380.png" alt="Figure 2" width="300" height="228" /></a><p class="wp-caption-text">Figure 2</p></div>
<p>&#8220;The program worked in earlier versions of Windows but won&#8217;t install or run now.&#8221; After you select this option click the Next button and then select Vista from the list (see Figure 2). Once you have selected that option click Next and then, in the resulting window, click the &#8220;Start the Program&#8221; button. This will actually start the process of installing the Guest Additions for Windows 7. You can now finish this install as you would any other.</p>
<p><strong>Final thoughts</strong></p>
<p>I am confident when Windows 7 is finally released this process won&#8217;t be necessary. But if you need to test out Windows 7 now, this is the way to go.</p>

	Tags: <a href="http://www.ghacks.net/tag/virtual-box/" title="virtual box" rel="tag">virtual box</a>, <a href="http://www.ghacks.net/tag/virtual-machine/" title="virtual-machine" rel="tag">virtual-machine</a>, <a href="http://www.ghacks.net/tag/virtualbox/" title="virtualbox" rel="tag">virtualbox</a>, <a href="http://www.ghacks.net/tag/virtualbox-guest-additions/" title="virtualbox guest additions" rel="tag">virtualbox guest additions</a>, <a href="http://www.ghacks.net/tag/windows-7/" title="windows 7" rel="tag">windows 7</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2007/02/10/virtualbox-a-vmware-alternative/" title="VirtualBox a Vmware alternative (February 10, 2007)">VirtualBox a Vmware alternative</a> (9)</li>
	<li><a href="http://www.ghacks.net/2009/06/14/installing-and-configuring-virtualbox-for-virtual-oses/" title="Installing and configuring VirtualBox for virtual OSes (June 14, 2009)">Installing and configuring VirtualBox for virtual OSes</a> (15)</li>
	<li><a href="http://www.ghacks.net/2009/06/17/install-guest-additions-for-a-better-virtualbox-experience/" title="Install Guest Additions for a better VirtualBox experience (June 17, 2009)">Install Guest Additions for a better VirtualBox experience</a> (5)</li>
	<li><a href="http://www.ghacks.net/2009/08/28/connect-to-a-remote-virtual-machine-with-rdesktop/" title="Connect to a remote virtual machine with rdesktop (August 28, 2009)">Connect to a remote virtual machine with rdesktop</a> (5)</li>
	<li><a href="http://www.ghacks.net/2009/10/12/winshake-adds-aero-peek-and-share-to-windows-vista-and-xp/" title="WinShake Adds Aero Peek And Share To Windows Vista and XP (October 12, 2009)">WinShake Adds Aero Peek And Share To Windows Vista and XP</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/07/29/install-virtualbox-guest-additions-for-windows-7/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to: Install Zen Cart on a LAMP server</title>
		<link>http://www.ghacks.net/2009/07/24/how-to-install-zen-cart-on-a-lamp-server/</link>
		<comments>http://www.ghacks.net/2009/07/24/how-to-install-zen-cart-on-a-lamp-server/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 16:28:44 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Online Services]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[The Web]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[shopping cart]]></category>
		<category><![CDATA[zen cart]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=14675</guid>
		<description><![CDATA[If you have ever had a need for an on-line shopping cart, and have ever tried to install a shopping cart, you know that making a choice can be a challenge, and getting the shop up and running can be a challenge.
Not so much with Zen Cart. Zen Cart is an open source e-commerce solution [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever had a need for an on-line shopping cart, and have ever tried to install a shopping cart, you know that making a choice can be a challenge, and getting the shop up and running can be a challenge.</p>
<p>Not so much with Zen Cart. Zen Cart is an open source e-commerce solution that serves as a stand-alone shopping cart and is installed on top of a LAMP server. If you&#8217;re not sure how to install a LAMP server check out my article &#8220;<a title="Install a LAMP server" href="http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/" target="_blank">How to: Install a LAMP server</a>.&#8221; With that LAMP server up and running you are ready to install Zen Cart.</p>
<p><span id="more-14675"></span>The installation of Zen Cart will require you to use a few Linux commands: zip, mv, and chmod. But that is it. For the purposes of this article I will assume you are using phpmyadmin for the database creation. If you need help installing phpmyadmin check out my article &#8220;<a title="Install phpmyadmin for easy MySQL administration" href="http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/" target="_blank">Install phpmyadmin for easy MySQL administration</a>.&#8221;</p>
<p>With all of that in mind, let&#8217;s begin the installation.</p>
<p><strong>Getting Zen Cart</strong></p>
<p>The first thing you need to do is download Zen Cart. But don&#8217;t just open your browser to the download page. Instead ssh to the server that will house Zen Cart, cd to the server document root, and use <em>wget </em>to download the necessary file into the correct directory. The command to download Zen Cart is:</p>
<p><code>sudo wget "http://downloads.sourceforge.net/project/zencart/CURRENT_ Zen Cart 1.3.x Series/Zen Cart v1.3.8 - Full Release/zen-cart-v1.3.8a-full-fileset-12112007.zip"</code></p>
<p>NOTE: Since there are space in the path name you do have to make use of the &#8220;&#8221; when using wget to download the file.</p>
<p>With the file downloaded and in place it is time to unzip the file. To unzip the Zen Cart file issue this command:</p>
<p><code>sudo unzip zen-cart-v1.3.8a-full-fileset-12112007.zip</code></p>
<p>which will create the directory <strong>zen-cart-v1.3.8a-full-fileset-12112007</strong>. To make your life easier you will want to change the name of that directory to a much easier name. This directory is what you (and your customers) will use to access your shopping cart, so make it easy. I rename mine <strong>zencart</strong> or <strong>shopping</strong>. Rename this to suit your needs. Rename it with the command:</p>
<p><code>sudo mv zen-cart-v1.3.8a-full-fileset-12112007 zencart</code></p>
<p>Now it&#8217;s time to create the configuration file and make some changes to permissions.</p>
<p><strong>Configuration files and permissions</strong></p>
<p>Zen Cart does not unpack with the necessary configuration files in place. What you have to do is rename to files so they will serve as your configuration files. To do this issue the following commands (from within your Zen Cart directory):</p>
<p><code>sudo mv includes/dist-configure.php includes/configure.php</code></p>
<p>and</p>
<p><code>sudo mv admin/includes/dist-configure.php admin/includes/configure.php</code></p>
<p>The next step is to change the permissions of the configuration files like so:</p>
<p><code>sudo chmod 777 includes/configure.php</code></p>
<p>and</p>
<p><code>sudo chmod 777 admin/includes/configure.php</code></p>
<p>The configuration files are set. Time to change permissions of some directories.</p>
<p>Below are all of the commands you need to run to set the correct permissions for your installation:</p>
<p><code>sudo chmod 777 cache<br />
sudo chmod 777 includes/languages/english/html_includes<br />
sudo chmod 777 media<br />
sudo chmod 777 pub<br />
sudo chmod 777 admin/backups<br />
sudo chmod 777 admin/images/graphs</code></p>
<p>With this complete you are now ready to create your database and log into the web-based installer and install Zen Cart.</p>
<p><strong>Installing via web</strong></p>
<p>After you create your database (using phpmyadmin) log into the Zen Cart install like so:</p>
<p>http://IP_TO_SERVER/ZENCART/zc_install</p>
<p>Where IP_TO_SERVER is the actual IP address of your server and ZENCART is the name you have given your Zen Cart directory.</p>
<p>The web-based installation is very simple. You will only have to insert options like the MySQL user and password, name of site, administrator name/email, etc. Outside of some very easy questions, Zen Cart will most likely correctly guess all of the details of your installation.</p>
<p>After you have stepped through the installation wizard your Zen Cart installation is done. You will be directed to either immediately administer the site or view the site.</p>
<p><strong>Final thoughts</strong></p>
<p>Zen Cart is one of the better shopping cart systems available from the open source community. It is easy to install/administer, robust, feature-rich, and reliable. If you have a need for ecommerce make sure you check out Zen Cart first.</p>

	Tags: <a href="http://www.ghacks.net/tag/e-commerce/" title="e-commerce" rel="tag">e-commerce</a>, <a href="http://www.ghacks.net/tag/shopping-cart/" title="shopping cart" rel="tag">shopping cart</a>, <a href="http://www.ghacks.net/tag/zen-cart/" title="zen cart" rel="tag">zen cart</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/07/24/how-to-install-zen-cart-on-a-lamp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
