<?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>Brandon&#039;s Blog &#187; Gentoo</title>
	<atom:link href="http://www.brandonturner.net/blog/category/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonturner.net/blog</link>
	<description>Random thoughts on web applications, software development and Linux</description>
	<lastBuildDate>Thu, 08 Apr 2010 01:47:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Gentoo ebuild for qmail with JMS1 combined patch</title>
		<link>http://www.brandonturner.net/blog/2009/04/qmail-jms1-ebuild/</link>
		<comments>http://www.brandonturner.net/blog/2009/04/qmail-jms1-ebuild/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 05:07:00 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.brandonturner.net/blog/?p=255</guid>
		<description><![CDATA[In a previous post, I introduced a patch to add DKIM and DomainKeys support to Qmail with John Simpson&#8217;s combined patch. In this post I&#8217;ll introduce the ebuild I wrote (well, modified) to allow easily installing qmail-jms1 on a Gentoo system. Though this ebuild makes installing qmail with John&#8217;s patch a little easier, it doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://www.brandonturner.net/blog/2009/03/dkim-and-domainkeys-for-qmail/">previous post</a>, I introduced a patch to add DKIM and DomainKeys support to Qmail with <a href="http://qmail.jms1.net/patches/combined.shtml">John Simpson&#8217;s combined patch</a>.  In this post I&#8217;ll introduce the ebuild I wrote (well, modified) to allow easily installing <em>qmail-jms1</em> on a Gentoo system.</p>
<p>Though this ebuild makes installing qmail with John&#8217;s patch a little easier, it doesn&#8217;t make administering a qmail system child&#8217;s play.  Before merging this ebuild, you should read through <a href="http://qmail.jms1.net">John&#8217;s website</a>.  You may also want to read about <a href="http://www.gentoo.org/doc/en/qmail-howto.xml">netqmail on Gentoo</a>.  While this ebuild has nothing to do with netqmail, it does borrow some the conventions presented in the Gentoo doc concerning starting, stopping and controlling qmail.</p>
<p>I didn&#8217;t include any of John&#8217;s run scripts or configuration files.  Only the combined patch is applied to the base qmail image.  I&#8217;ve also included some additional patches I&#8217;ve found useful.  They are described in more detail on my <a href="http://www.bltweb.net/qmail">qmail patches page</a>.  Most of my extra patches are controlled by use flags (<code>dkim, ipv6</code>) and not applied by default.</p>
<p>For the impatient, here is a direct link to the ebuild:<br />
<a href="http://svn.bltweb.net/repos/public/gentoo_overlay/mail-mta/qmail-jms1/qmail-jms1-7.08-r1.ebuild">http://svn.bltweb.net/repos/public/gentoo_overlay/mail-mta/qmail-jms1/qmail-jms1-7.08-r1.ebuild</a></p>
<h4>Install my portage overlay</h4>
<p>The easiest way to use the qmail-jms1 ebuild is to use my <a href="http://www.brandonturner.net/blog/gentoo-overlay/">Gentoo Portage Overlay</a>.  Please see the <a href="http://www.brandonturner.net/blog/gentoo-overlay/">overlay page</a> for instructions on how to set it up.</p>
<p>You will need the following ebuilds from my overlay:</p>
<ul class="noseparation">
<li><a href="http://svn.bltweb.net/repos/public/gentoo_overlay/virtual/qmail/">virtual/qmail</a></li>
<li><a href="http://svn.bltweb.net/repos/public/gentoo_overlay/mail-mta/qmail-jms1/">mail-mta/qmail-jms1</a></li>
<li><a href="http://svn.bltweb.net/repos/public/gentoo_overlay/sys-apps/ucspi-tcp/">sys-apps/ucspi-tcp</a></li>
<li><a href="http://svn.bltweb.net/repos/public/gentoo_overlay/mail-filter/libdkim/">mail-filter/libdkim</a> (only needed if using the <code>dkim</code> use flag)</li>
</ul>
<h4>Install Qmail</h4>
<p>Once the overlay is set up, installing qmail-jms1 is easy.</p>
<p>Add the following to your <code>/etc/portage/package.keywords</code> file:</p>
<div class="file">
mail-mta/qmail-jms1<br />
sys-apps/ucspi-tcp<br />
mail-filter/libdkim<br />
# You may also need these:<br />
net-mail/dot-forward<br />
sys-process/daemontools<br />
sys-apps/ucspi-ssl<br />
virtual/checkpassword<br />
net-mail/checkpassword-pam
</div>
<p>Now install qmail-jms1:</p>
<div class="prompt">
$ <span class="cmd">emerge -pv qmail-jms1</span><br />
$ <span class="cmd">sudo emerge qmail-jms1</span>
</div>
<h4>Configure Qmail</h4>
<p>Yeah right&#8230;  There is plenty of documentation elsewhere for this.  Try <a href="http://qmail.jms1.net/">John&#8217;s website</a>.</p>
<h4>Start Qmail</h4>
<div class="prompt">
# <span class="cmd">ln -s /var/qmail/supervise/qmail-send /service/qmail-send</span><br />
# <span class="cmd">ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd</span><br />
# <span class="cmd">rc-update add svscan default</span><br />
# <span class="cmd">/etc/init.d/svscan start</span>
</div>
<p>&nbsp;<br />
&nbsp;<br />
That&#8217;s all I have for now.  Installing, configuring and administering qmail should not be taken lightly.  This ebuild has made it easier for me to set up and maintain my servers, however you should only consider using it if you are already familiar with setting up a qmail server.</p>
<p>Feel free to leave any comments, suggestions or problems below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonturner.net/blog/2009/04/qmail-jms1-ebuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scan for Conficker with Nmap 4.85 beta5 Gentoo ebuild</title>
		<link>http://www.brandonturner.net/blog/2009/03/nmap-485_beta5_ebuild/</link>
		<comments>http://www.brandonturner.net/blog/2009/03/nmap-485_beta5_ebuild/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 22:31:36 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[ebuild]]></category>

		<guid isPermaLink="false">http://www.brandonturner.net/blog/?p=205</guid>
		<description><![CDATA[Use this Gentoo ebuild to emerge nmap 4.85 beta5 to scan for the conficker worm on your network.]]></description>
			<content:encoded><![CDATA[<p>On Monday <a href="http://www.doxpara.com/">Dan Kaminsky</a>, along with the <a href="http://www.honeynet.org/">Honeynet Project&#8217;s</a> Tillmann Werner and Felix Lede announced they discovered the ability to detect if a machine is infected with the Conficker worm by scanning a network.  See <a href="http://www.doxpara.com/?p=1285">Dan&#8217;s post</a> for more information.  Shortly thereafter, version 4.85BETA5 of the <a href="http://nmap.org/">nmap</a> tool was released to allow remote scanning for the Conficker worm.</p>
<p>As April 1st is just a few hours away (I guess it&#8217;s already here in some parts of the world), I wanted to scan my network using the latest version of the nmap tool.  As Gentoo doesn&#8217;t have an ebuild yet, I quickly created one and thought I&#8217;d share it.</p>
<p>This file contains everything you need:<br />
<a href='http://www.brandonturner.net/blog/wp-content/uploads/2009/03/nmap-485_beta5ebuild.tgz'>Nmap 4.85BETA5 ebuild</a></p>
<h4>Installing Nmap 4.85BETA5</h4>
<div class="prompt">
$ <span class="cmd">cd ~</span><br />
$ <span class="cmd">wget <a href='http://www.brandonturner.net/blog/wp-content/uploads/2009/03/nmap-485_beta5ebuild.tgz'>http://www.brandonturner.net/blog/wp-content/uploads/2009/03/nmap-485_beta5ebuild.tgz</a></span><br />
$ <span class="cmd">sudo mkdir -p /usr/local/portage</span><br />
$ <span class="cmd">cd /usr/local/portage</span><br />
$ <span class="cmd">sudo tar -xzf ~/nmap-485_beta5ebuild.tgz</span><br />
$ <span class="cmd">echo &#39;=net-analyzer/nmap-4.85_beta5&#39; | sudo tee -a /etc/portage/package.keywords</span><br />
$ <span class="cmd">echo &#39;net-analyzer/nmap lua&#39; | sudo tee -a /etc/portage/package.use</span><br />
$ <span class="cmd">emerge -pv nmap</span><br />
<span style="color: red;">(If emerge doesn&#8217;t show that it will emerge nmap-4.85_beta5, ensure you have <code>PORTDIR_OVERLAY="/usr/local/portage"</code> in your <code>/etc/make.conf</code> file)</span><br />
$ <span class="cmd">sudo emerge nmap</span>
</div>
<h4>Scanning for Conficker</h4>
<p><a href="http://insecure.org/">insecure.org</a> has some instructions on how to scan for Conficker.  Basically, here is what I did to scan a 192.168.1.0/24 network:</p>
<div class="prompt">
$ <span class="cmd">cd ~</span><br />
$ <span class="cmd">nmap -sC &#45;&#45;script=smb-check-vulns &#45;&#45;script-args=safe=1 -p445  -d -PN -n -T4 &#45;&#45;min-hostgroup 256 &#45;&#45;min-parallelism 64 <span style="color: green;">192.168.1.0/24</span> | tee conficker_scan.txt | grep -P &#39;Host \d|Conficker&#39; | grep -B 1 &#39;Conficker&#39;</span>
</div>
<p>This stores the complete output of the nmap command in <code>conficker_scan.txt</code>, but displays a quick-and-dirty summary to <code>stdout</code>.  Your milage may vary.  Obviously you should edit the network address (in <span style="color: green;">green</span> above) for your network.</p>
<p>You should see something like:</p>
<pre>
Host 192.168.1.101 appears to be up ... good.
|  Conficker: Likely CLEAN
--
Host 192.168.1.102 appears to be up ... good.
|  Conficker: Likely CLEAN
--
Host 192.168.1.103 appears to be up ... good.
|  Conficker: Likely CLEAN
--
Host 192.168.1.104 appears to be up ... good.
|  Conficker: Likely INFECTED
--
</pre>
<p>Linux boxes usually return something like <code>Conficker: ERROR: NT_STATUS_OBJECT_NAME_NOT_FOUND</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonturner.net/blog/2009/03/nmap-485_beta5_ebuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Gentoo 2008.0 amd64 on a Linode VPS</title>
		<link>http://www.brandonturner.net/blog/2009/02/install-gentoo-amd64-linode/</link>
		<comments>http://www.brandonturner.net/blog/2009/02/install-gentoo-amd64-linode/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 05:21:17 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.brandonturner.net/blog/?p=14</guid>
		<description><![CDATA[Linode VPS doesn't provide a Gentoo 2008.0 amd64 image out of the box.  Here I describe the steps needed to install a fresh Gentoo 2008.0 image on Linode.]]></description>
			<content:encoded><![CDATA[<p>Today I signed up for a <a title="Linode.com" href="http://www.linode.com">Linode VPS</a>.  Linode appeared to have great reviews and very reasonable prices.  I had originally looked at <a href="http://www.vr.org">Host Virtual</a>, primarily because they are planning to offer native ipv6 (something I&#8217;ve been wanting to play with) later this month.  I ended up with Linode because they have a Dallas datacenter which makes my connections from Austin pretty fast.</p>
<p>One advantage that Host Virtual provided was a more recent Gentoo image.  Linode only offers a Gentoo 2007.0 install, which it doesn&#8217;t even list as a <em>current distribution</em>.  No worries, in this post I describe the steps I took to install a fresh <strong>Gentoo 2008.0 amd64</strong> image on my new Linode!</p>
<div class="note">
<strong>Update:</strong>  On April 4 2009, Linode released a <a href="http://blog.linode.com/2009/04/04/gentoo-20080-x86_64-and-slackware-122/">Gentoo 2008.0 x86_64</a> image, which somewhat obsoletes this post.  I haven&#8217;t tried it, but if your looking to try 64-bit Gentoo on a Linode, try that image instead of these instructions.
</div>
<p>Before we get started, some of the things I wanted on my system:</p>
<ul>
<li>x86_64 kernel running natively compiled 64-bit applications</li>
<li>ReiserFS filesystem instead of ext3</li>
<li>Basic LAMP server and no more</li>
</ul>
<div class="note">
<strong>Note:</strong> Currently, Linode does not provide a 64-bit recovery option, so we&#8217;ll have to install a small 64-bit environment to use when setting up our new Gentoo environment.  This can be done with only 300MB of disk space so it is best to leave it installed in case your Gentoo environment gets screwed up.
</div>
<h4>1. Create recovery configuration profile</h4>
<ol>
<li>From the Linode Manager Dashboard, click <em>Deploy a Linux Distribution</em></li>
<li>Select an Unbuntu 8.10 64-bit (or similar 64-bit OS) with a 300MB disk drive.  If you want swap space, you should configure that here.</li>
<li>Click <em>Create Profile</em></li>
<li>Change the name of the profile to &#8220;Recovery Ubuntu 64bit&#8221;</li>
</ol>
<h4>2. Create the Gentoo disk image</h4>
<ol>
<li>From the Linode Manager Dashboard, click <em>Create a new Disk Image</em></li>
<li>Give your disk a label (you can change this later) and size (most likely all the remaining disk space on your Linode)</li>
<li>Pick <em>Unformatted / raw</em> for the filesystem, we&#8217;ll format using ReiserFS later</li>
<li>Click <em>Create Disk</em></li>
<li>Edit your Recovery Unbuntu 64bit profile: set /dev/xvdc to the disk image you just created.</li>
<li>Click <em>Save Profile</em></li>
</ol>
<h4>3. Boot the recovery profile</h4>
<ol>
<li>From the Linode Manager Dashboard, boot your recovery profile</li>
<li>Log in with your favorite ssh client: root@<em>&lt;linode vps IP&gt;</em> and the root password you set up in section 1</li>
<li>Install some tools required in later steps:
<div class="prompt">
root@li # <span class="cmd">apt-get update</span><br />
root@li # <span class="cmd">apt-get install reiserfsprogs wget</span>
</div>
</li>
</ol>
<h4>4. Set up Gentoo</h4>
<p style="margin-top: 0;">This section roughly follows the <a href="http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml">Gentoo Quick Install Guide</a>.</p>
<ol>
<li>Create the ReiserFS filesystem:
<div class="prompt">
root@li # <span class="cmd">mkreiserfs /dev/xvdc</span>
</div>
<li>Mount the filesystem:
<div class="prompt">
root@li # <span class="cmd">mkdir -p /mnt/gentoo</span><br />
root@li # <span class="cmd">mount /dev/xvdc /mnt/gentoo</span><br />
root@li # <span class="cmd">cd /mnt/gentoo</span>
</div>
</li>
<li>Set up the stage:
<div class="prompt">
root@li # <span class="cmd">wget http://gentoo.osuosl.org/releases/amd64/2008.0/stages/stage3-amd64-2008.0.tar.bz2</span><br />
root@li # <span class="cmd">tar xjpf stage3*</span><br />
root@li # <span class="cmd">rm stage3*</span>
</div>
</li>
<li>Install latest portage snapshot:
<div class="prompt">
root@li # <span class="cmd">cd /mnt/gentoo/usr</span><br />
root@li # <span class="cmd">wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</span><br />
root@li # <span class="cmd">tar xjf portage-lat*</span><br />
root@li # <span class="cmd">rm portage-lat*</span>
</div>
</li>
<li>Chroot into the new Gentoo environment:
<div class="prompt">
root@li # <span class="cmd">cd /</span><br />
root@li # <span class="cmd">mount -t proc proc /mnt/gentoo/proc</span><br />
root@li # <span class="cmd">mount -o bind /dev /mnt/gentoo/dev</span><br />
root@li # <span class="cmd">cp -L /etc/resolv.conf /mnt/gentoo/etc/</span><br />
root@li # <span class="cmd">chroot /mnt/gentoo /bin/bash</span><br />
li50-172 / # <span class="cmd">env-update &#038;&#038; source /etc/profile</span>
</div>
</li>
<li>Set your timezone:
<div class="prompt">
li50-172 / # <span class="cmd">ls /usr/share/zoneinfo</span><br />
<span style="color: red">(Using US/Central as an example)</span><br />
li50-172 / # <span class="cmd">cp /usr/share/zoneinfo/US/Central /etc/localtime</span><br />
li50-172 / # <span class="cmd">nano -w /etc/conf.d/clock</span><br />
<span style="color: red">(Change value of TIMEZONE variable, e.g. TIMEZONE=&#8221;US/Central&#8221;)</span><br />
li50-172 / # <span class="cmd">date</span><br />
Mon Feb 9 14:41:50 CST 2009
</div>
</li>
<li>Set host and domain name
<div class="prompt">
li50-172 / # <span class="cmd">cd /etc</span><br />
li50-172 etc # <span class="cmd">echo &#8220;127.0.0.1 mybox.at.myplace mybox localhost&#8221; &gt; hosts</span><br />
li50-172 etc # <span class="cmd">sed -i -e &#8216;s/HOSTNAME.*/HOSTNAME=&#8221;mybox&#8221;/&#8217; conf.d/hostname</span><br />
li50-172 etc # <span class="cmd">hostname mybox</span><br />
li50-172 etc # <span class="cmd">hostname -f</span><br />
mybox.at.myplace
</div>
</li>
<li>Configure fstab mount points
<div class="prompt">
li50-172 etc # <span class="cmd">nano -w fstab</span>
</div>
<p style="margin-bottom:0">Edit the fstab file similar to:</p>
<div class="file">
<pre>
/dev/xvda     /       reiserfs     noatime,notail  0 1
/dev/xvdb     none    swap         sw              0 0
</pre>
</div>
</li>
<li>Edit <code>/etc/inittab</code>.<br />
To ensure the lish console works if you ever need it, edit the <code>terminals</code> section of <code>/etc/inittab</code> to look like:</p>
<div class="file">
<pre>
# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 <b>hvc0</b> linux
#c2:2345:respawn:/sbin/agetty 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty 38400 tty6 linux
</pre>
</div>
</li>
<li>Configure networking and SSH:
<div class="prompt">
li50-172 etc # <span class="cmd">rc-update add net.eth0 default</span><br />
 <span style="color: green">*</span> net.eth0 added to runlevel default<br />
li50-172 etc # <span class="cmd">rc-update add sshd default</span><br />
 <span style="color: green">*</span> sshd added to runlevel default<br />
li50-172 etc # <span class="cmd">passwd</span><br />
New UNIX password: <span style="color: red">type_the_password</span><br />
Retype new UNIX password: <span style="color: red">type_the_password_again</span><br />
passwd: password updated successfully
</div>
</li>
<li>Install system tools:
<div class="prompt">
li50-172 etc # <span class="cmd">emerge logrotate syslog-ng vixie-cron reiserfsprogs dhcpcd</span><br />
li50-172 etc # <span class="cmd">rc-update add syslog-ng default</span><br />
 <span style="color: green">*</span> syslog-ng added to runlevel default<br />
li50-172 etc # <span class="cmd">rc-update add vixie-cron default</span><br />
 <span style="color: green">*</span> vixie-cron added to runlevel default
</div>
</li>
<li>Prepare to reboot:
<div class="prompt">
li50-172 etc # <span class="cmd">exit</span><br />
root@li # <span class="cmd">umount /mnt/gentoo/proc /mnt/gentoo/dev/ /mnt/gentoo</span><br />
root@li # <span class="cmd">exit</span>
</div>
</li>
</ol>
<h4>5. Set up Gentoo profile</h4>
<ol>
<li>From the Linode Manager, shutdown the recovery Linode.</li>
<li>Create a new profile by clicking <em>Create a new Configuration Profile</em></li>
<li>Set the following options:
<ul>
<li>Label: Gentoo 2008.0 amd64</li>
<li>Kernel: a 64-bit kernel, e.g. 2.6.27.4-x86_64-linode3</li>
<li>Drive: /dev/xvda:  <em>The disk image you set up in section 2 (<strong>not</strong> the small Ubuntu recovery disk)</em></li>
<li>Drive: /dev/xvdb: Swap Image</li>
</ul>
</li>
</ol>
<h4>6. Boot Gentoo and finish installation</h4>
<ol>
<li>From the Linode Manager, click the <em>Boot</em> button for your new Gentoo profile</li>
<li>Log in via ssh: root@<em>&lt;Linode VPS IP&gt;</em><br />
(You may have to delete the old ssh key out of your known_hosts file on your local machine)</li>
<li>Add a non-root user, install sudo and disable root logins via SSH:
<div class="prompt">
mybox ~ # <span class="cmd">useradd -m -G wheel <em>username</em></span><br />
mybox ~ # <span class="cmd">passwd <em>username</em></span><br />
New UNIX password: <span style="color: red">type_the_password</span><br />
Retype new UNIX password: <span style="color: red">type_the_password_again</span><br />
passwd: password updated successfully<br />
mybox ~ # <span class="cmd">nano -w /etc/ssh/sshd_config</span><br />
<span style="color: red;">(Add a line: <code>PermitRootLogin: no</code>)</span><br />
mybox ~ # <span class="cmd">emerge sudo</span><br />
mybox ~ # <span class="cmd">visudo</span><br />
<span style="color: red;">(Uncomment the line: &#8220;<code>%wheel   ALL=(ALL) ALL</code>&#8220;, around line 24)</span><br />
mybox ~ # <span class="cmd">/etc/init.d/sshd restart</span>
</div>
</li>
<li>Install a simple conservative firewall:
<div class="prompt">
mybox ~ # <span class="cmd">emerge iptables</span><br />
mybox ~ # <span class="cmd">iptables -A INPUT -p tcp -m tcp &#8211;dport 22 -j ACCEPT</span><br />
mybox ~ # <span class="cmd">iptables -A INPUT -p icmp -m icmp &#8211;icmp-type 8 -j ACCEPT</span><br />
mybox ~ # <span class="cmd">iptables -A INPUT -i lo -j ACCEPT</span><br />
mybox ~ # <span class="cmd">iptables -A INPUT -m state &#8211;state RELATED,ESTABLISHED -j ACCEPT</span><br />
mybox ~ # <span class="cmd">iptables -P FORWARD DROP</span><br />
mybox ~ # <span class="cmd">iptables -P INPUT DROP</span><br />
mybox ~ # <span class="cmd">/etc/init.d/iptables save</span><br />
mybox ~ # <span class="cmd">/etc/init.d/iptables start</span><br />
mybox ~ # <span class="cmd">rc-update add iptables default</span><br />
 <span style="color: green">*</span> iptables added to runlevel default
</div>
</li>
<li>Select a Gentoo mirror and update make.conf:
<div class="prompt">
mybox ~ # <span class="cmd">emerge mirrorselect</span><br />
mybox ~ # <span class="cmd">mirrorselect -i -o >> /etc/make.conf</span><br />
mybox ~ # <span class="cmd">mirrorselect -i -r -o >> /etc/make.conf</span><br />
mybox ~ # <span class="cmd">nano -w /etc/make.conf</span>
</div>
<p style="margin-bottom: 0;">Edit the file to include the parts in bold:</p>
<div class="file">
<pre>
# Typical Linode has 4 processors, make use of them when compiling
<strong>MAKEOPTS="-j5"</strong>

<strong>CHOST="x86_64-pc-linux-gnu"</strong>
<strong>CFLAGS="-march=nocona -O2 -pipe"</strong>
<strong>CXXFLAGS="${CFLAGS}"</strong>
</pre>
</div>
<p style="margin-bottom: 0;">At this point you should also run <code>emerge -vpe world</code> and decide what USE variables you want to include in your make.conf file.</p>
</li>
<li>Define locales:
<div class="prompt">
mybox ~ # <span class="cmd">nano -w /etc/locale.gen</span><br />
<span style="color: red;">(Uncomment the first two en_US lines)</span><br />
mybox ~ # <span class="cmd">locale-gen</span>
</div>
</li>
<li>Update portage and installed packages:
<div class="prompt">
mybox ~ # <span class="cmd">emerge portage</span><br />
mybox ~ # <span class="cmd">emerge -vpuD &#8211;newuse world</span><br />
mybox ~ # <span class="cmd">emerge -vUD &#8211;newuse world</span><br />
<span style="color: red;">(Go grab some lunch, this is going to take a while.)</span><br />
mybox ~ # <span class="cmd">emerge &#8211;oneshot libtool</span><br />
mybox ~ # <span class="cmd">emerge gentoolkit</span><br />
mybox ~ # <span class="cmd">revdep-rebuild</span>
</div>
</li>
</ol>
<h4>7. Reboot and enjoy</h4>
<p>At this point I like to reboot the server to ensure that everything comes back up the way I expect it.  This isn&#8217;t necessary however.</p>
<p>After reboot my server was using just under a GB of data (990264 bytes) and about 60MB of RAM.  The server is now ready to install apache, mysql, etc.  I&#8217;ll be looking at optimizing my memory usage in a later post.</p>
<p class="note green" style="font-size: 90%;"><strong>Note:</strong> If you found this helpful and are interesting in signing up for Linode, feel free to use my referral code below.  I&#8217;m only putting this out there if you&#8217;d like to use it &#8211; you can easily sign up for a Linode VPS without it!<br />
<a href="http://www.linode.com/?r=edff465df97bb1e29468836d3700c79a2d24a17e">http://www.linode.com/?r=edff465df97bb1e29468836d3700c79a2d24a17e</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brandonturner.net/blog/2009/02/install-gentoo-amd64-linode/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
