Installing Subversion on RHEL5

Subversion (SVN) is a popular open source, source code change control package. Today we are going to install and configure Subversion on Red Hat Enterprise Linux 5.2 (a.k.a. RHEL 5.2), I will actually be doing my testing on CentOS 5.2 but the process should be completely identical.

Installing Subversion on Linux

Installation of subversion is very simple if you are using yum. In addition to Subversion itself, you will also want to install Apache as you will most likely want to access Subversion through a WebDAV interface.  You can simple run:

yum -y install subversion httpd mod_dav_svn

Once Subversion is successfully installed we need to create the initial repository. This can be done on the local file system but I prefer to keep high priority and highly volatile data stored directly on the NAS filer as this is far more appropriate for this type of data.

As an aside, I like to keep low volatility data (say, website HTML) stored on local discs in general for performance reasons and since backups are not as difficult to take using traditional backups methods (e.g. tar, cpio, Amanda, Bacula, etc.) High volatility files I prefer to be on dedicated network storage units where backups can be easily taken using more advanced methods like Solaris 10’s ZFS snapshot capability. It is not always clear when data makes sense to keep locally or to store remotely but I feel that you can gauge a lot of the decision on two factors: frequency of data changes – that is changes to existing files not the addition of new files necessarily and the level to which the data is the focus of the storage – that is if the data is incidental or key to the application. In the case of Subversion the entire application is nothing but a complex filesystem frontend so we are clearly on the side of “data focused” application.

I started writing this article on RHEL4 on a system with a small, local file system.  When I returned to the uncompleted article and continued with it I was implementing this on a RHEL5 system with massive local storage and decided to keep my Subversion repository local on a dedicated logical volume for easy Linux based snapshots.

Subversion has two optional backend storage solutions.  The original method of storing Subversion data was with the venerable Berkley DataBase, known as BDB, which is now a product of Oracle.  The newer method, and the method which has been the default choice since Subversion 1.2, is FSFS (I don’t know exactly for what its initials stand) which uses the native filesytem mechanisms for storage.  In my example here and for my own use I choose FSFS as I think it is more often the better choice.  Of most important note, FSFS supports remote filesystems over NFS and CIFS while BSB does not.  FSFS is also easier to deal with when it comes to creating backups.  My feeling is that unless you really know why you want to use BDB, stick with the default FSFS, there is a reason that it was selected as the default.

Another note about creating Subversion repositories: some sources recommend putting Subversion repos under /opt. All I have to say is “No No No!” The /opt filesystem is not appropriate for regularly changing data. Any data that is expected to change on a regular basis (e.g. log files, source code repos, etc.) belongs in /var. This is the entire purpose of the /var filesystem. It stands for “variable” and is purposed for regular filesystem changes. Files going to /var is another indicator that external network filesystem may be appropriate as well.

mkdir -p /var/projects/svn

At this point you can either use /var/svn as a normal or mounted remotely in some manner such as NFS, CIFS or iSCSI.  Regardless of how the repository is set up the rest of this document will function identically.

We are now in a position to use svnadmin to create our repository directory:

svnadmin create /var/projects/svn/

At this point, Subversion should already be working for you.  If you are new to Subversion, we will do a simple import to test our installation.  To perform this test, create a directory called “testproject” and put it in the /tmp directory.  Now touch a couple of files inside that directory so that we have something with which to work.  Then we will do our first Subversion import.

mkdir /tmp/testproject; cd /tmp/testproject; touch test1 test2 test3

svn import tmp/testproject/ file:///var/projects/svn/test -m “First Import”

Your Subversion installation is now working, but few people will be happy accessing their Subversion repositories only from the local machine as we have done here.  If you are used to working from the UNIX (Linux, Mac OSX, Cygwin, etc.) command line you may want to try accessing your new Subversion repository using SVN+SSH.  Here is an example taken from an OpenSUSE workstation with the Subversion client installed:

svn list svn+ssh://myserver/var/projects/svn
testproject/

At this point you now have access from your external machines and can perform a checkout to get a working copy of your code.  To make the process really simple be sure to set up your OpenSSH keys so that you are not prompted for a password.  For many users, most notably Windows users, you are going to want access over the HTTP protocol since Windows does not natively support the SSH protocol.

The first thing that you are going to need to do, if you are running SELinux and Firewall security on your RHEL server like I am, is to open ports 80 and 443 in your firewall so that Apache is enabled.  Normally I shy away from management tools but this one I like.  Just use “system-config-securitylevel-tui” and select the appropriate services to allow.

You will also need to allow the Apache web server to write to the Subversion repository location within SELinux.  To do so we can use the command:

restorecon -R /var/projects/svn/

We have one little trick that we need to perform.  This trick is necessary because of what appears to be a bug in the way that Subversion sets the user ID when it runs.  This is not necessary for all users but can be a pretty tough sticking point for anyone who runs into it and is not aware of what can me done to remedy the situation.

cp -r /root/.subversion/* ~apache/.subversion/

Configuring Apache 2 on Red Hat 5 is a little tricky so we will walk through it together.  The first thing that needs to be added is the LoadModule line for the WebDAV protocol.  This goes into the LoadModule section of the mail /etc/httpd/conf/httpd.conf configuration file.

LoadModule dav_module         modules/mod_dav.so

The rest of our configuration changes for Apache 2 will go into a dedicated configuration file just for our subversion repository: /etc/httpd/conf.d/subversion.conf

I am including here my entire configuration file sans comments.  You will need to modify your SVNPath variable accordingly, of course.

# grep -v \# /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module       modules/mod_dav_svn.so
<Location /svn>
  DAV svn
  SVNPath /var/projects/svn/
</Location>

At this stage you should now not only have a working Subversion repository but should be able to access it via the web.  You can test web access from you local box with the svn command.  Here is an example:

svn list http://localhost/svn/

References:

Mason, Mike. “Pragmatic Version Control Using Subversion, 2nd Edition“, Pragmatic Programmers, The. 2006.

Installing Subversion on Apache by Marc Grabanski

Subversion Setup on Red Hat by Paul Valentino

Setting Up Subversion and Trac As Virtual Hosts on Ubuntu Server, How To Forge

The SVN Book, RedBean

Additional Material:

Subversion Version Control: Using the Subversion Version Control System in Development Projects

November 14, 2008: The Final Week

7 Days to Baby Day! (39 Weeks Pregnant)

The baby is due one week from today on Friday, November 21st.  Dominica is definitely starting to get quite uncomfortable and would like the baby to decide to arrive a little on the early side.

I got up just before six this morning but had to shave my head which takes a bit of time so I targeted the 7:37 train.  Dominica drove me down to the station.  It is very warm today.  No need even for a t-shirt under my dress shirt.  Very humid and not much breeze. It is supposed to be around sixty degrees in Peekskill today.

On the train ride in this morning I managed to just exactly read, cover to cover, “Bill Bryson’s African Diary“.

I checked at lunch today and I still have no input about the state of my grade from my last course.  I am still completely in the dark.  Argh.  One gets nervous after putting in so much work and not knowing how it is going to come out.

Katie managed to join Dan and I swimming down on Whitehall today.  This is her first time going to the health club.  She was pretty impressed.

My evening tonight was not nearly as busy as it often is and I managed to get all of my deployments done fairly early and left as soon as I knew that there was no one with deployment surprises left for me and I headed for the train.

I took the 6:43 out of Grand Central Terminal.  While on my trip home I read “The Day of the Barbarians” after having finished my other book this morning.  Dad, Oreo and Dominica picked me up from the train station at 7:40 and we drove right over to the New City Diner to get dinner.

Today I topped 1,000 Tweets on Twitter.

After dinner we came back to the house.  We were all pretty tired.  Dad and Dominica finished watching an episode of Kitchen Nightmares which they had been watching.  Then I played an hour or so of Fable 2 on the XBOX 360.  I am starting to get the hang of the game and am really enjoying it.  I am far enough in now that I am starting to get into the story.  I am hoping to start investing in real estate soon within the game.  That sounds like a really neat feature.

November 13, 2008: Dad Returns to Peekskill

8 Days to Baby Day! (38 Weeks and Six Days Pregnant)

“Language shapes the way we think and determines what we can think about.” – Benjamin Lee Whorf

I only got to sleep in a tiny bit this morning.  I had to be up at seven thirty so that I could be ready for when Mike arrived from the post office to look at our mailbox situation.

Mike arrived and, as we had expected, the mail carrier did not give him the keys.  So he had to return to the post office, get the keys and come back to the house.  At least it was nothing worse than half an hour of extra driving for him.  They could easily have lost the keys or something.

Turns out that the lock was just full of dirt and that Mike was able to fix it without a problem.  We have a working lock again.  Now we can get our mail daily and even order stuff again from Amazon.  I’ve been waiting to put in orders because I was concerned that nothing could arrive here.

LG, Sharp and some unknown Taiwanese television maker have been slapped with a massive fine from the Department of Justice in the US for price fixing LCD panels (this falls under anti-trust.)  LG’s $400m USD fine is the second largest in US history after a $500m USD fine to Hoffman – La Roche in 1999, also related to anti-trust.  Large corporations who have been negatively impacted in the past are Dell, Motorola and Apple who buy parts from these companies.  The way is being pathed for some pretty significant lawsuits from these large buyers.  In time, hopefully, this action will be reflected in a lowered cost of LCDs on the US market.  The cartel may continue to operate overseas.

In interesting financial news, oil was approaching $57 USD yesterday and today is almost down to $55!  Oil futures in London are down to $52.  Gas is going to be getting quite a bit cheaper in the weeks to come, it would appear.

Dad IM’d me to let me know at 9:11 this morning that he was headed out the door to start his drive down to Peekskill.  He has a massive carload of our furniture too including the rest of our dining room chairs and Dominica’s nice leather recliner.  I am guessing that with this trip he must be beginning to actually see a dent forming in his garage.  This is a lot of stuff that he has managed to move.

Today is the full moon so tons of superstitious people will be thinking that today is the day that we are going to go into labor.  Of course, the only known study of the issue, this one being from the NIH, shows that there is no statistical difference at any lunar phase and that there is no correlation between the full moon and natural labor.  Check out “Labor Ward Workload Waxes or Wanes with Lunar Cycle, Myth or Reality?

While on the NIH website I also found this useful information about treatments for TMJ, which I and a few others in my family have.

This morning I discovered the Swimman – water proofed Apple iPod Shuffle designed to be worn and used while swimming.  That would be awesome.  Having IT Conversations pumped to me while I am swimming would be a much better use of my exercise time that just swimming.  I’ve been concerned that since using the train I don’t get as much iPod time because I read normal, paper books.  I swim for three hours or more per week so having the Shuffle would not only help to pass that time more quickly but would make it more enjoyable and give me a chance to catch up on the latest conferences.

Last night on the train I managed to finish reading “The Victory of Reason” and tomorrow on my ride in I plan to begin reading “The Day of the Barbarians.”  I ordered some new books from Amazon today as well.  I felt that I could order them now that we are able to get mail again.  I got “The Ruby Way, 2nd Ed.” and “Agile Web Development with Rails, 2nd Ed.”  I also decided to give Amazon’s electronic copy, read online serivce a try and bought the digital copy of “The Ruby Way” for just $4.  Now I can always reference it whether I am home or at work.  That’s pretty handy.

Dominica was out at her midwife appointment for almost all of the morning.  She had to be downtown at ten thirty and did not manage to get back home until well after one thirty.  It was a long day but she managed to see the midwife, go grocery shopping and hit CVS to pick up a prescription.  (Technically, don’t you pick up the prescription from your doctor and pick up the medicine from the pharmacy while dropping off the prescription?)

I found out today that Hershey’s manufactures a chocolate product called cocoa mulch which, and I hate that I have to point this out, is completely toxic to dogs and will often kill them if they ingest it.  This mulch smells like chocolate because, well, it is chocolate, and since chocoloate contains theobromine which is poisonous to dogs the mulch is toxic as well.  No one should ever use this product anywhere where a dog could be exposed which includes seeing-eye dogs.  It is really inapporpriate for home stores (you know who you are) to carry a dog poison as an everyday mulch product.  Next step is to fortify the mulch with melamine.

Dad arrived at the house around three thirty.  That means that he made the trip in roughly six hours even in constant rain and fog.  His trips are seeming to be magnets for bad weather.

Dad managed to get a lot of stuff into his car for this trip.  The large printer stand that is going to the basement, two dining room chairs, Dominica’s recliner, our large humidifier and much more.  We still have a bit to put away from the stuff that came from Newark.  We are quite behind at this point.

We spent the evening just visiting and relaxing in the living room.  We are all really exhausted today.  I was going up and down the stairs a bit as I had to work from the office for a while.

We all decided that we were way too lazy to cook or even to go out for food so I looked on line and we found a pizza place that delivers to Chapel Hill and we ordered in a pizza.  We ordered from the pizza and Italian place located in the Beach Shopping Center.  They brought a menu for us.  It turns out that they have a pretty extensive menu.  That will be very handy.

We watched some of McHale’s Navy, the classic black and white television show from 1962 and the Mary Typer Moore show via Hulu and PlayOn on the PS3.

Katie is all set to swim with Dan and I tomorrow over our lunch break.  It has taken her almost a month of trying to get her office to get her set up with her swimming pass.

We were all very tired and went to bed quite early, around nine thirty.  I will be on Wall Street tomorrow.

November 12, 2008: New Furniture

9 Days to Baby Day! (38 Weeks and Five Days Pregnant)

We are into the single digits.  Nine days left to go.  We are definitely into the home stretch now.

We are continuing to try to deal with the mail situation at the new house.  We are still not receiving mail and have no working mailbox from which to get our mail.  The post office pretty much refuses to help us out and we are completely stuck without any mail service.  It is very obvious that there is no competition.  If FedEx and UPS were competing for mail delivery services you know that they would fix a problem like this in minutes.  Not let it sit for weeks.

Dominica tried calling the post office again today to get them to do something.  Now they are trying to tell us that we have to pay money to get our mail.  Apparently the postage that is paid on the mail itself isn’t enough and now that they are holding our mail they are going to charge us again to deliver it to us (this is exactly the same as not having net-neutrality, charge one person to send and then hold it until the person receiving pays enough for you to deliver it even though both parties already paid for the initial service!)  This is extortion.  We move into a new house and there is a USPS delivery fee that we are not told about until after they have confiscated two weeks of our mail!?!

Already we have had the fix it person from the USPS refuse to take our calls.  Handlers redirect any calls going to him, Mike, with stories of him being “busy”, “out to lunch” or “gone home for the day.”   Today I find out that he was “on vacation” last week and so it seems pretty fishy that he was also “at lunch” or that someone “saw him leaving for the day” when he was not even in the office.

After many calls the story is now, and for the first time, that we are actually the owners of the lock and that we are responsible for replacing it.  Why we weren’t the owners of the lock and responsible for it last week I have no idea.  This is the third story that I have heard from the post office.  The first story was that the post office often just changes the locks without telling people.  The second was that that never happens.  The third is that we own the lock and we change it.

Why is it so hard to get a straight answer on something as simple as a mail box?  There should be laws protecting people from any sort of mail issue or, as I would prefer, it should be opened up for competition and let FedEx deliver my mail to me.  I bet if FedEx was my mail carrier they wouldn’t deliver junk mail to me just because some spammer gives them money for fear of losing my account.  Carrier would compete on features and price rather than having a monopoly.

So the upside is that the mailbox is being handled tomorrow morning at eight in the morning when I am home and Dominica does not have to deal with it.  That is, of course, assuming that we don’t have a baby in the mean time.  It is a bit unnerving to have a baby on the way and not to have had mail service for the past two weeks.

We were running pretty late for getting me to the 7:08 train this morning.  Dominica dropped me off at the station and we could see the train coming down the line crossing Annsville Creek which is a little too close for comfort.  Any closer and the crossing gate would have been down and there would have been no way for me to get to the platform in time.  I ran from the car and up to the platform and was able to get a ticket as there was no one else in line.  I have the machine down to a science, after just one week of use, and can have a ticket in my hand in roughly ten to fifteen seconds from the time that I first reach the machine including paying for it via credit card.  The MTA machines are really efficient.

I had a really busy morning.  Constant requests all morning.  I barely had a moment to do anything including going into my normally slow lunch period.

Someone that I support in London accidentally called Dominica instead of me today not realizing that they were calling my home rather than the office.  Dominica was pretty surprised to be getting a call from the UK.

Dan and I managed to sneak away at one to head down to the health club to get in our daily swim.  I am feeling much stronger every time too.  It is really working.  Although one would hope as I have been swimming for a month now.  I was hoping that the results would be a bit more pronounced than they are. I have been swimming a ton and haven’t lost a single pound yet.

Q: What do trendy clothing store managers do in London?

A: Mind the Gap

I had a good swim today, about an hour in the water.  I really appreciate it when I am able to swim for that long.  I can really feel it afterwards.

I got a tunafish salad wrap on the walk back to the office.  The late afternoon was not nearly as busy as the morning.  I would like to have been able to have left the office on the early side today so that I could get home and spend some time with Dominica and Oreo but a couple of things were scheduled for me after six this evening so I am stuck taking care of them before I am able to head out the door.  That means that I have no hope of making it for the early six o’clock train so my goal is to try for the 6:43 train but, more realistically, will make the 7:18 train.  That will get my home at 8:13 which isn’t too awful.  I am working from home tomorrow so that isn’t really bad at all.

I knew that I was going to completely miss the earlier train so on my way home I stopped in to Borders.  I was homing that they would have a Packt book on Subversion and Trac but they did not.  They had tons of other Packt books but not on the subject that I need.  I should have known better than to go into Borders.  They always have their heat set for their employees and not for their customers.  It is, I believe, over eighty degrees in there even though it is forty outside.  Even just wearing a thin dress shirt, no t-shirt, no jacket, no nothing I was sweating uncontrollably because of the sudden change from brisk walking outside when cold to blasting heat inside.  Amazon doesn’t do that to their customers.  Luckily later I went on Amazon and found that the book was quite poorly rated.  I guess that I will just skip it.

I found out from Dominica that our postal carrier stopped by today and brought in the mail that had been backing up out in the mailbox.  It was far more than would fit in the mail box so our carrier is probably lugging it all around in her car. Dominica had put a note on the mailbox telling her that Dominica was home so that they could work out what to do with the mailbox.  The carrier made Dominica turn over our mailbox keys.  Dominica told her that we were told to keep them to give to Mike in the morning but she insisted that she had to have them so Dominica handed them over.  We are sure that this is going to cause a problem in the morning, but we can’t fight with our mail carrier.  This is all a nightmare.

Dominica picked me up at eight twenty, the train was late again today, and we drove straight out to Nanuet to go furniture shopping at Bob’s Discount Furniture.  We had found some items on there online today that we really liked and their prices are great so we decided to go check them out.

The furniture shopping went very well and we ended up buying the Multiplex, a four seat theatre syle chair setup that will be perfect for watching movies and playing video games in the basement.  It was really comfortable.

Dominica also found a dresser for our bedroom that she liked so we decided to get that as well before we begin a never-ending cycle of putting our clothes onto the floor.  So we picked up the four drawer chest unit from the Vodara sleepset line.  Down the road we may decide to get one of the matching nightstands once we figure out how much space we have after our super king bed is delivered and setup again.

It was ten twenty by the time that we got done at the furniture store.  They were extremely glad to have customers, though.  There was just about no one shopping there and I don’t think that anyone was buying during the time that we were there.  This market is really tough on places like furniture stores, car dealers, etc.

After getting our furniture, which is scheduled to be delivered on November 19th, we went next door to the Nanuet Diner to get something to eat.  Then we drove home arriving at about midnight and were straight off to bed.

Fable 2: First Impressions

Fable 2, for the Microsoft XBOX 360, released in North America on October 21st and is one of the most anticipated games for the platform.  Fable 2 is the sequel to the extremely popular Fable from the original XBOX.

Fable 2 is a fantasy action console role playing game (Fantasy JRPG) with many aspects brought in from adventure gaming.  The graphics on the 360 are astounding.  Possibly the best of this style that I have yet seen on a console.  Quite impressive.

For my first impression, I manage to play Fable 2 for approximately two hours and made it through the “tutorial” section of the game.  The game does a great job of making the introduction to the game simple and fun and introduces new control concepts in an almost transparent manner so that the game begins immediately and goes straight into the story with the player able to begin taking part right away.

In Fable 2 you choose to play either Sparrow or Rose, who are brother and sister.  Unlike many RPGs, you do not spend a lot of time customizing your character at the beginning of the game.  You simply choose to play the boy or the girl and from there your character is modified by the decisions that you make within the game.  I like this approach as it lends itself to better story telling and makes the growth of your character more natural.

Fable 2 is an action RPG but the action is handled in a very fun, smooth way that I think will appeal to a lot of players.  I really appreciate the ease of having your melee weapon readied under the X button, ranged weapon under the Y and a magic attack under B.  This method is very quick to learn, easy to use under pressure and not so complicated as to make the game not fun for those of us who tend to prefer our RPG’s without an action element while still providing a lot of fun for those who do.  I really like the blend.

Overall, my first two hours with Fable 2 were completely enjoyable.  It is not often that I am this thrilled with a video game the first time that I have played it.  I am very excited to spend some time just exploring the game world, Albion.  The Fable series is known for having a short main plot with extensive potential side quests, missions and projects.  I’m sure that in Fable 2 I will be looking for opportunities to spend as much time in the game world as possible.

One feature that I really appreciate is the integrated “cut scene” system.  I have not yet seen a game using this particular innovation and it is a great way of handling traditional cut scenes.  The way that it works is that the scenes themselves are built into the game world and rendered just like the regular game.  When you approach an area with a “cut scene” you get a little symbol telling you that a “cut scene” is available.  You can choose to watch the scene with the use of one of the left buttons.  As long as you hold the button the camera zooms in on the action in which you should be interested.  As soon as you no longer want to watch simply release the button and the action continues from your normal perspective.  It works beautifully.

In many ways, Fable 2 appears to play a lot like a more traditional adventure game with a strong, integrated plot.  Character development, from a skills and spells perspective, is much less central to the game than in a more traditional RPG.  From my initial perspective, the game seems a lot more focused on real, engaging gameplay than on game mechanics that bog down so many otherwise entertaining titles.  Fable 2 has enough story line and little enough interruption that my wife, Dominica, even enjoys just watching me play.

The voice acting is quite good as well.  Much of the beginning of the game has constant narration which really provides the feeling that you are playing a movie.  The mix of narration, voice acting and the integrated cut scenes really pulls you into the game.

My first impression is that this is an extremely interesting RPG title for the XBOX 360 and has justified the intense anticipation which it has garnered recently.  If you are looking for an innovative and enjoyable RPG on the console platform definitely check out Fable 2.  I hope to review it again when I have completed the game.