Central Soap Box


Installing Trac on FreeBSD 6.2

Trac is a project which integrates SCM & project management. Trac can help you stay more organized keeping your wiki, roadmap, tickets, and source information in one location.

Installing trac
  1. cd /usr/ports/www/trac
  2. make install clean
  3. I left the default options in config screen

Setup a basic trac site for the example svn repository created in Setting up a Subversion Server on FreeBSD 6.2
  1. cd /usr/local
  2. mkdir trac
  3. cd trac
  4. mkdir MyRepoName
  5. trac-admin MyRepoName initenv
  6. chown -R www /usr/local/trac

Installing mod_python
  1. cd /usr/ports/www/mod_python3
  2. make install clean

To configure mod_python for trac I followed steps from TracModPython
  1. vi /usr/local/etc/apache22/httpd.conf
  2. LoadModule python_module libexec/apache22/mod_python.so
  3. PythonOption mod_python.mutex_directory "/tmp"
  4. PythonOption mod_python.mutex_locks 8

Configure trac with the same access as that given to the svn repository in Setting up a Subversion Server on FreeBSD 6.2
  1. vi /usr/local/etc/apache22/Includes/trac.conf
    <Location /trac/MyRepoName>
    SetHandler mod_python
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnv /usr/local/trac/MyRepoName
    PythonOption TracUriRoot /trac/MyRepoName
    AuthType Basic
    AuthName "trac access"
    AuthUserFile /usr/local/svn-repositories/conf/htpasswd
    Require valid-user
    SSLRequireSSL
    </Location>
apachectl graceful

https://192.168.0.100/trac/MyRepoName
Accept the certificate and enter your username and password, you should now see your trac site.

As always comments are appreciated, I am new to the FreeBSD way of doing things and I am interested to know where is the preferred location to install things like subversion repositories, and this trac site, I have been using /usr/local but I am not sure that is the best place for it.

To get the port tree for the first time:
  1. portsnap fetch
  2. portsnap extract
you will now have the ports tree at /usr/ports

To update the ports tree:
  1. portsnap fetch
  2. portsnap update

Typical install of a port
  1. cd /usr/local/security/openssl
  2. make install clean

Uninstall a port
  1. cd /usr/local/security/openssl
  2. make deinstall

The portmanager utility allows you to keep your installed ports up to date:
  1. cd /usr/ports/ports-mgmt/portmanager
  2. make install

To see if any installed ports are out of date:
  1. portmanager -s

To upgrade all installed ports convient for those of us who would rather just have the system brought up to date without much ado:
  1. portmanager -u

Interesting tidbit from the portmanager manual, portmanager comes with a pretty impressive safety net:
With the normal "make install clean" method of adding ports there is a critical step, after a port is made, the old port must be deinstalled then the new port installed in its place. If for some reason the new port fails to install you are left with neither your old port, nor the new one. It is for this reason portmanager makes a package from your old port before removing it, and if the new port fails to install correctly portmanager will reinstall your old port from that package.

Even if you out of portmanager at the crucial moment between removal of the old port and installation of the new port portmanager may still install the original from the backup package, this is not guaranteed though, so only at this step it is recommended not to terminate portmanager. Every other point in time it is perfectly safe to abort, , kill, etc., during program operation. Your ports collection will not be harmed!

Of course there are other ways to keep your ports tree in up to date. Here are couple articles on ports I just found from a google search that might prove useful, portupgrade and Ports Tricks.

Searching the ports tree for keywords
  1. cd /usr/ports
  2. make search key=rails more

Leave me a comment if you have any suggestions or know of any better ways to keep your ports collection up to date.

Setting up a Subversion Server on FreeBSD 6.2

I have spent a too much time getting this working the way I like it. I tried a lot of different things using 2 separate FreeBSD installs under Microsoft Virtual PC 2007. I installed a minimal install with only ssh access. All I want to use the server for is Subversion and maybe Trac later on.

I wanted the svn server to only be accessed through SSL and with some form of basic authentication.

  1. Install FreeBSD to a VPC or a machine and login as root or a user in the wheel group and become su.
    • If your not sitting at the machine or your running in a vpc id recommend downloading PuTTY and using a ssh session to your FreeBSD machine.
  2. Configure system
    • edit /etc/hosts file after the 127 loopback I added this, it is required for starting apache, needs to be able to resolve its dns
    1. vi /etc/hosts
    2. 192.168.0.100 svn
  3. Get the ports tree to the machine:
    1. portsnap fetch
    2. portsnap extract
  4. Install OpenSSL
    1. cd /usr/ports/security/openssl
    2. make install clean
  5. Install Apache
    1. cd /usr/ports/www/apache22
    2. make install clean
  6. Configure Apache
    • add accf_http_load="YES" to loader.conf
    1. vi /boot/loader.conf
    2. accf_http_load="YES"
  7. Configure SSL keys
    1. cd /usr/local/etc/apache22
    2. mkdir ssl.key
    3. mkdir ssl.crt
    4. /usr/local/bin/openssl req -new -x509 -days 365 -keyout ./ssl.key/server.key -out ./ssl.crt/server.crt -subj '/CN=Test-Only Certificate'
    5. cp ./ssl.crt/server.crt server.crt
    6. /usr/local/bin/openssl rsa -in ssl.key/server.key -out server.key
    7. cp /usr/local/etc/apache22/extra/httpd-ssl.conf /usr/local/etc/apache22/Includes
  8. Launch Apache at system startup
    1. cp /usr/local/etc/rc.d/apache22 /usr/local/etc/rc.d/apache22.sh
    2. vi /etc/rc.conf
    3. Add apache22_enable="YES" to the end of the file.
  9. Start up the apache server
    1. /usr/local/sbin/apachectl start
  10. Browse to your computer through http and https, you should see the It Works! page on both.
  11. Install Subversion with mod_dav_svn, apache2 support and without Berkeley DB support
    1. cd /usr/ports/devel/subversion
    2. make -DWITH_MOD_DAV_SVN -DWITHOUT_BDB -DWITH_APACHE2_APR
    3. make install clean
  12. Setup a Subversion Repository
    1. cd /usr/local
    2. mkdir svn-repositories
    3. cd svn-repositories
    4. mkdir repos
    5. cd repos
    6. mkdir MyRepoName
    7. /usr/local/bin/svnadmin create MyRepoName
  13. Setup the auth file for access to the repository
    1. cd /usr/local/svn-repositories
    2. mkdir conf
    3. cd conf
    4. htpasswd -c -m -b htpasswd user1 pass1
    5. htpasswd -m -b htpasswd user2 pass2
    6. htpasswd -m -b htpasswd user3 pass3
    7. etc. You get the idea
  14. Change the owner of the svn-repositories directory to nobody
    1. chown -R nobody /usr/local/svn-repositories
  15. Add a location to your apache conf file to point to the Subversion Repository Directory, using SVNParentPath lets you create as many repositories as you would like in that path and they are all configured with the same settings in the apache conf.
    1. vi /usr/local/etc/apache22/Includes/svn.conf
      <Location /svn>
      DAV svn
      SVNParentPath /usr/local/svn-repositories/repos
      AuthType Basic
      AuthName "Subversion repository"
      AuthUserFile /usr/local/svn-repositories/conf/htpasswd
      Require valid-user
      SSLRequireSSL
      </Location>
  16. /usr/local/sbin/apachectl restart
  17. Browse to https://192.168.0.100/svn/MyRepoName
  18. Accept the certificate and enter your username and password, you should now have a working subversion server.
To ensure you are using the most current OpenSSL library you can check the version you are running in Apache by doing the following:
  1. /usr/local/bin/openssl s_client -connect 192.168.0.100:443
  2. [Enter]
  3. GET / HTTP/1.0
  4. [Enter]
  5. [Enter]

The results should look similar to the following:
HTTP/1.1 200 OK
Date: Tue, 03 Apr 2007 12:07:18 GMT
Server: Apache/2.2.4 (FreeBSD) mod_ssl/2.2.4 OpenSSL/0.9.8e DAV/2 SVN/1.4.3
Last-Modified: Sat, 20 Nov 2004 20:16:24 GMT
ETag: "c21e-2c-4c23b600"
Accept-Ranges: bytes
Content-Length: 44
Connection: close
Content-Type: text/html

That is it for now on this topic, if anyone has corrections or opinions on how to improve this mini guide please leave them.


References:
Custom-Compiling Apache and Subversion
Using Subversion for Collaborative Development

Deer Lake Camping and Strawberry Festival!

We are headed out to Deer Lake park this weekend and are going to the Strawberry Festival.

Here's a link to the google satiallite image.

We have got a good crew of people commited to going out there and it should be a good time! I hope to have a few good pictures to post next week :)

Gas Price Blues

I just filled up my jeep lunch time today. Gas is at a all time high here in lovely grand falls Windsor :(

106.6 cents a liter or $4.04 Canadian per gallon!

If anyone knows a link to find out the details on how much we are paying in taxes on gas, please link it in the comments please. If I remember correctly its somewhere between 45 and 55 cents a liter right now.

Which is ridiculous, where's the money going? They are making more and more money in taxes yet vehicle registration and licensing has gone up and the condition of our roads is deplorable. Time to write Scott Simms a letter!





This makes me wonder why I got a 4 Runner instead of a smaller car. Oh well I will have it paid off in about a year, car payments are a lot more then the gas I burn in it :)



On a side note the AC in our office is out, right now its 29 degrees Celsius here and very uncomfortable!

Bleh

Introduction

Allow myself to introduce ahh myself!

.
.
.

Not as easy as I would have thought. Everything I'm thinking of sounds stupid or presumptuous.

Let’s see here
















  • Raven my black lab mix dog is a hyperactive lunatic and a compulsive sandal eater.
  • I have a beta fish named Homer I inherited from Crystals’ friend in Gander.
  • I completed a computer science degree at MUN in 2001 and have been a Software Developer since then.
  • I am a WoW addict though my chronic friends say I never play, they have more serious issues!
  • My favorite hockey team is the Vancouver Canucks, I also like Toronto I think most Canadians do, and oh yah Habs suck! We might even get to see NHL this 2005 - 2006 season!
  • My favorite Artist is probably Will Rafuse, however I do like a lot of different styles including Escher, Monet, and local artists like James Long and Lloyd Pretty.
  • I used to read a lot of fantasy novels but since starting the Wheel of Time series by Robert Jordan and the Sword of Truth series by Terry Goodkind I have lost all interest in the genre, it feels more to me like a money grab with little substance. Although I will probably finish off those two series.
  • How could I forget, while enjoying my favortie things a Blue Star isnt far from my hand!


I suppose that’s enough for now, I’ll try to have an update for the Salmon Festival that’s happening here this weekend.

Cheers!

First Post!

First Post!

I wonder if this will go anywhere...


Search



XML