<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Magoo</title>
    <link>http://morgangoose.com/blog</link>
    <description>affiliated with the society of blog bloggables</description>
    <pubDate>Sun, 03 Oct 2010 18:42:31 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Fedora KVM with simple network forwards</title>
      <link>http://morgangoose.com/blog/2010/06/fedora-kvm-with-simple-network-forwards/</link>
      <pubDate>Wed, 02 Jun 2010 22:52:43 EDT</pubDate>
      <category><![CDATA[Webservers]]></category>
      <category><![CDATA[Linux]]></category>
      <guid>http://morgangoose.com/blog/2010/06/fedora-kvm-with-simple-netowrk-forward/</guid>
      <description>Fedora KVM with simple network forwards</description>
      <content:encoded><![CDATA[<div class="document">
<p id="p1">Recently I've been teaching python to some high school students. It has been going well, but the development environment we had access to left a little bit to be desired. We were working with ages old solaris, vi only, and no real access to newer gnu (or other) tools. So a new setup was required, I went off to investigate.</p>
<p id="p2">I started with chroot, since a buddy, Daniel Thau, had used it extensively for running <a class="reference external" href="http://opensource.osu.edu/sites/default/files/chroottalk_0.pdf">multiple operating systems side by side</a>. He'd pointed me in the directions of <a class="reference external" href="http://people.redhat.com/~rjones/febootstrap/">febootstrap</a> and that seemed like it'd work fine. I was able to make a sandbox, get ssh running on 2022 and then have my dlink route that to my box. Success!</p>
<p id="p3">But I found that a bit messy, and a bit limited. I wanted to lock down how much of my resources they could use, and I didn't want to have to give access to some of my root file systems directly; /proc, /dev, etc. So I looked around a bit more, and stumbled on using KVM indirectly via the new virt-manager toolset that fedora 12 and 13 provide. Installation was as simple as:</p>
<div class="highlight"><pre><span class="nv">$ </span>yum install qemu-kvm virt-manager virt-viewer python-virtinst
</pre></div>
<p id="p4">But it also seems that from the <a class="reference external" href="http://www.techotopia.com/index.php/Installing_and_Configuring_Fedora_KVM_Virtualization">techotopia article</a> I followed for some of this that one could also just do:</p>
<div class="highlight"><pre><span class="nv">$ </span>yum groupinstall <span class="s1">'Virtualization'</span>
</pre></div>
<p id="p5">I have to say it's a pretty swank set of tools. It's free, it works on KVM or Xen. KVM usage requires no special kernel and as such, no reboot. The setup was simple, and gave out a vnc port to connect to from the get go. It is also trivial to connect to a setup on machine A with virt-manager on machine B over ssh. If you want more information, <a class="reference external" href="http://fedoraproject.org/wiki/Virtualization_Quick_Start">fedora has a nice writeup</a>, and libvirt has a more <a class="reference external" href="http://wiki.libvirt.org/page/Main_Page">distro agnostic set of docs</a>.</p>
<p id="p6">Problem was though that the networking was virtual, and didn't pull an IP address from my router, so it wasn't public. There were a few sections here and there describing how to switch to bridged, and I tried them. They didn't work for me, either I suck at following directions, or they just won't work how I expect them to. You can see for yourself <a class="reference external" href="http://wiki.libvirt.org/page/Networking#Fedora.2FRHEL_Bridging">here</a> at how I attempted network bridging.</p>
<p id="p7">What I did was much more in my realm of knowledge, is simpler than all the other options, and is something I can make changes to w/o killing my network connectivity. iptables! I just used NAT forwarding. It was 2 lines, put in my pre-existing firewall script. So to get my local box 192.168.1.199 on port 2022 to forward to its internal virtual network of 192.168.100.2 at port 22 was as plain as this:</p>
<div class="highlight"><pre><span class="nv">$ </span>iptables -t nat -I PREROUTING -p tcp --dport 2022 -j DNAT<span class="se">\</span>
    --to-destination 192.168.100.2:22
<span class="nv">$ </span>iptables -I FORWARD -p tcp --dport 22 -d 192.168.100.2 -j ACCEPT
</pre></div>
<p id="p8">One preroute rule to grab the port incoming, and one forward rule to pass said packets along. Now I have connectivity into my class virtual machine, and I don't have to do much to add more ports as needed. I am pretty happy with the setup so far. It's really nice to be able to connect remotely, vnc or ssh now, as well as know that I've limited the ram and cpu time the class can use on my box. I am interested to hear if anyone else is doing similar things with virtualization on their desktops.</p>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Trac makes my life easy</title>
      <link>http://morgangoose.com/blog/2009/07/trac-makes-my-life-easy/</link>
      <pubDate>Wed, 22 Jul 2009 17:15:23 EDT</pubDate>
      <category><![CDATA[Webservers]]></category>
      <category><![CDATA[Linux]]></category>
      <guid>http://morgangoose.com/blog/?p=43</guid>
      <description>Trac makes my life easy</description>
      <content:encoded><![CDATA[<div class="document">
<p id="p1">The project management app <a class="reference external" href="http://trac.edgewall.org">Trac</a> is something that was new to me a while back. I'd just installed t for a side project, and used the yum install without any issues. It took care of all the grunt work, and got me to the point where I could now create and use a trac project.</p>
<p id="p2">Trac is set up like what I see web frameworks go with. A main program that will install the framework in a project directory. In this case trac-admin , which is killer when you want to make multiple projects, and offers a cli interface to the project s framework configuration, etc.</p>
<p id="p3">This setup becomes awesome I found when you want to upgrade. Yum installed what it had packaged, the .10 version, but I had decided that I wanted to toy with <a class="reference external" href="http://bitten.edgewall.org">bitten</a> their automated build tool, which required .11 and up. So an upgrade was needed, yum couldn t be used, but I found that trac-admin has an upgrade command.</p>
<p id="p4">So I was poised to make the fun and scary transition into mixing a package managed install with a source install, not something that always goes well. I ve found that sometimes packagers change to install location from where the src install goes (looking at you nagios), and make some conflicts or at least confusion.</p>
<p id="p5">The upgrade process for the server then my app was as simple as:</p>
<div class="highlight"><pre>wget http://ftp.edgewall.com/pub/trac/Trac-0.11.5.tar.gz
tar zxvf http://ftp.edgewall.com/pub/trac/Trac-0.11.5.tar.gz
<span class="nb">cd </span>Trac-0.11.5
python setup.py install
trac-admin /path/to/project upgrade
trac-admin /path/to/project wiki upgrade
/etc/init.d/httpd restart
</pre></div>
<p id="p6">This blew me away. I ve have never had a complicated app (relativily of course) upgrade so simply, and without any issues. The main install of trac from empty folder to working project manager was simple too, so perhaps I should have expected this, but really I think it is a testimony to how well the developers of Trac have though of the whole process of using their framework.</p>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Authenticating svn and trac with wordpress</title>
      <link>http://morgangoose.com/blog/2009/05/authenticating-svn-and-trac-with-wordpress/</link>
      <pubDate>Thu, 07 May 2009 14:05:16 EDT</pubDate>
      <category><![CDATA[Webservers]]></category>
      <guid>http://morgangoose.com/blog/?p=15</guid>
      <description>Authenticating svn and trac with wordpress</description>
      <content:encoded><![CDATA[<div class="document">
<p id="p1"><strong>Problem caused by wordpress upgrade</strong></p>
<p id="p2">My club uses Wordpress and I have our forums and subversion authenticate via the wordpress install's user table. This became very useful, and something that I tried to make sure I could apply on any new app I would install for the site.</p>
<p id="p3">When trying to get the same thing setup for an install of Trac I had just made I ran into a bit of trouble.  With the old versions of wordpress this was pretty simple to do. Just a few lines in an apache conf file and we were golden.</p>
<p id="p4">With the most recent revisions though their implementation of password storage changed, causing the old setup to break for svn, and causing me a nice headache when trying to duplicate my old fix for svn onto trac.  They went from a simple md5 hash to using a much more secure phpass. (why it isn't phppass I don't know)</p>
<p id="p5">The main problem with this is that this isn't an authentication encryption that apache's mysql handler could use.  I tried to find a work around to get back to md5, but I couldn't find any. It was probably for the best anyhow, as I'd rather the site be more secure, than have more tools. No point in propagating something that could be exploited. Searching around some more I found the awesome work of <a class="reference external" href="http://nikolay.bg/">Nikolay</a>. given out on <a class="reference external" href="http://barry.wordpress.com/2008/05/19/mod_auth_mysql-and-phpass/">Barry</a>'s blog, and explaining the install process.  <a class="reference external" href="http://nikolay.bg/">Nikolay</a> made an apache module to compile that added in the ability to use phpass. This compiled great and worked with the fedora install the server is on,  so the old fix for subversion was working again, with a single line changed.</p>
<p id="p6"><strong>Subversion:</strong></p>
<div class="highlight"><pre><span class="nb">RedirectMatch</span> ^(/repos)$ $1/
<span class="nt">&lt;Location</span> <span class="s">/repos/</span><span class="nt">&gt;</span>
     <span class="nb">Options</span> <span class="k">all</span>
     <span class="nb">DAV</span> svn
     <span class="nb">SVNParentPath</span> <span class="sx">/repos/gcc/</span>
     <span class="nb">SVNListParentPath</span> <span class="k">on</span>

     <span class="nb">AuthName</span> <span class="s2">"MySQL authentication for SVN"</span>
     <span class="nb">AuthType</span> Basic
     <span class="nb">Require</span> valid-user

     <span class="nb">AuthMYSQLEnable</span> <span class="k">on</span>
     <span class="nb">AuthBasicAuthoritative</span> <span class="k">off</span>
     <span class="nb">AuthMySQLAuthoritative</span> <span class="k">on</span>

     <span class="nb">AuthMySQLHost</span> localhost
     <span class="nb">AuthMySQLUser</span> <span class="k">user</span>
     <span class="nb">AuthMySQLPassword</span> password
     <span class="nb">AuthMySQLDB</span> wordpress_db
     <span class="nb">AuthMySQLUserTable</span> wp_users
     <span class="nb">AuthMySQLNameField</span> user_login
     <span class="nb">AuthMySQLPasswordField</span> user_pass
     <span class="nb">AuthMySQLPwEncryption</span> phpass
<span class="nt">&lt;/Location&gt;</span>
<span class="nb">CustomLog</span> logs/svn_logfile <span class="s2">"%t %u %{SVN-ACTION}e"</span> env=SVN-ACTION
</pre></div>
<p id="p7">That is the config that makes sure that only people that have accounts on the wordpress blog can have access to the repos. I plan on soon adding in a SVN auth file to make the commit users  more constrained, but at the moment, it isn't a priority.</p>
<p id="p8">The last line makes nice entries of SVN access in its own log file, which is very handy for debugging problems.</p>
<p id="p9"><strong>Trac</strong></p>
<p id="p10">For trac I took the simple apache auth they provided on their website, and applied the same idea from svn to it:</p>
<div class="highlight"><pre><span class="nt">&lt;Location</span> <span class="s">"/projects/project-name/login"</span><span class="nt">&gt;</span>
     <span class="nb">AuthType</span> Basic
     <span class="nb">Require</span> valid-user

     <span class="nb">AuthName</span> <span class="s2">"Trac Auth"</span>
     <span class="nb">AuthMYSQLEnable</span> <span class="k">on</span>
     <span class="nb">AuthMySQLAuthoritative</span> <span class="k">on</span>
     <span class="nb">AuthMySQLHost</span> localhost
     <span class="nb">AuthMySQLUser</span> wordpress
     <span class="nb">AuthMySQLPassword</span> password
     <span class="nb">AuthMySQLDB</span> wordpress_db
     <span class="nb">AuthMySQLUserTable</span> wp_users
     <span class="nb">AuthMySQLNameField</span> user_login
     <span class="nb">AuthMySQLPasswordField</span> user_pass
     <span class="nb">AuthMySQLPwEncryption</span> phpass
<span class="nt">&lt;/Location&gt;</span>
</pre></div>
<p id="p11">I plan to use this type of database integration more, specifically with a wiki installation. Although I don't know of any wiki that could use this type of authentication as I am only familiar with mediawiki, and really only as a user.</p>
</div>
]]></content:encoded>
    </item>
  </channel>
</rss>

