Cropper 1.9.3

by Terry Hughes Friday, November 27, 2009 11:25 PM
Earlier this month I was added to the Cropper project (thanks Jeffrey). After working through most of the easier work items I felt it would be a good time to issue a new release. I'm looking forward to digging in to those tougher issues and implementing the requested features. So go give it a try and feel free to provide some feedback.

Tags:

Access VisualSVN Server and TeamCity through IIS7

by Terry Hughes Sunday, October 11, 2009 11:20 AM

I run IIS, VisualSVN Server, and TeamCity on the same machine and everything works great, except for one small thing: they all need their own port to listen too. I ended up with IIS on 80, VisualSVN Server on 81, and TeamCity on 82. Yuck! The URLs look horrible and you have to remember to explicitly prefix the non 80 ports with http://. What I really want is for everything to be on port 80.

Googling the interwebs, I learned that what I wanted to do was have IIS be a reverse proxy for VisualSVN Server and TeamCity. I also learned that there is an extension, Application Request Routing, for IIS7 that does this very thing. I found an article that outlined how to do what I wanted, but there are a couple of special things that need to be done to get VisualSVN Server and TeamCity working.

Application Request Routing
I enabled the proxy, which is explained in the Configuring Rules for the Reverse Proxy section of the previous link, and took this opportunity to add a rewrite rule to the Default Web Site that will prefix www to any request that does not have it, the rule configuration can be found a little over halfway through the video on the URL Rewrite Module page. As an aside, after adding the rule, Google Reader showed that existing postings where new entries. I think this is because I had FeedBurner pointing to tnthughes.net/blog not www.tnthughes.net/blog. I'm not sure if there would have been a way to prevent the duplication of posts since the URLs are technically different.

TeamCity
At first I tried to proxy TeamCity from a subdirectory, but it returns link references to items at the root URL and I was unsuccessful at correctly rewriting the links. Since I run other applications within the same web site, I couldn't have TeamCity use www.tnthughes.net directly, so I decided to add a TeamCity subdomain in my DNS settings. I updated my prefix www rule to have a second condition so it didn't try to change TeamCity.tnthughes.net to www.tnthughes.net. I then added a rewrite rule to the Default Web Site that matches any url with the condition that the HTTP_POST is TeamCity.tnthughes.net to rewrite to http://localhost:82/{R:1}.

VisualSVN Server
Since TeamCity had it's own domain I wanted to do the same thing for VisualSVN Server, only it didn't work. Remember how VisualSVN Server will automatically append svn/ when you type in just the root address? There is a reason for this, I'm not sure what the reason is, but it is how VisualSVN Server works. So VisualSVN Server has to be proxied at a subdirectory. At first I set the rewrite rules to use a nonexistant directory but found out that IIS blocks files that have certain extensions. Some of the blocked extensions are the very same as the file extensions that I want VisalSVN Server to serve. In order to work around that and not expose those file types in other applications that are running in the same web site, I opted to have a physical directory so I can override the default IIS settings. I created a new folder called svn within the wwwroot folder on my server. I then added a rewrite rule to the svn folder that matches any url to rewrite to http://localhost:81/svn/{R:1}. I couldn't find a way in the UI to change the file extensions that IIS served but this post shows the xml configuration syntax needed to tell IIS that it's okay to serve certain extensions. I updated the web.config in the svn directory to allow for the extensions .config, .cs, and .csproj. This isn't all inclusive, just want I've ran across so far. Then i noticed something. If I typed in tnthughes.net/svn the links went to tnthughes.net/{Repository} and would give a 404 error if clicked. Realizing that the ending slash was needed, I played around a bit and figured out that by adding a rewrite rule to the Default Web Site that matches ^svn$ to redirect to http://www.tnthughes.net/svn/ I could always ensure that there was an ending slash. The other thing with VisualSVN Server is that it expects it's images and styling files to be at the root of the URL. So I had to copy the files under %ProgramFiles%\VisualSVN Server\htdocs\ (minus index.html) to the wwwroot folder.

The order in which the rules are processed matters. If the rule for TeamCity happened after the rule to append the ending slash for VisualSVN Server, TeamCity.tnthughes.net/svn would take me to www.tnthughes.net/svn/, not exactly what I wanted.

A side benefit to all of this is that now I can close the non 80 ports on my router and disable the firewall rules on the server. So now I have what I wanted. It's not exactly perfect, I'd must prefer TeamCity to be in a subdirectory like VisualSVN Server, but I can live with it. For now.

When to remove hacks?

by Terry Hughes Friday, April 24, 2009 04:15 PM

A coworker of mine ran into a bummer of a problem and asked for advice. Over lunch we talked about what to do, I personally felt that option 2 was the safest solution. I didn't really like adding bad code to cover up bad code and I began to think about how you would know when the hack could be removed. Then I threw out the idea of writing a test to verify that the bad condition is present. When the test fails you will know to remove (or at least re-evaluate) the hack. He thought it was a neat idea, can't wait to see what he comes up with.

Tags:

Tips

ALT.NET

by Terry Hughes Saturday, May 03, 2008 10:58 PM

I attended the last event with a co-worker a couple weekends ago. This was my first open space experience, which was amazing to see in action. I wasn't sure what to expect but left realizing that it is more about the conversation, interaction, and socialization/networking than learning. I left refreshed and energized about what I do and I'm looking forward to new possibilities.

Event Registration

by Terry Hughes Monday, March 24, 2008 02:56 PM

We’ve held two Applied.NET meetings at work. There’s been a lot of interest but I’ve found the hardest part is making the discussion relevant. It’s hard to explain a complex idea using simple examples and in a short amount of time. Luckily, we are starting a new project at work to allow employees to register for events (like training). It will replace an existing system, include new functionality, and be a great opportunity to utilize newer technology. I’m looking forward to getting started as it should help drive home new ideas and expose everyone to a new way of working together.

Nothin' But .NET

by Terry Hughes Monday, March 03, 2008 08:57 PM

Last summer a coworker and I were fortunate enough to attend a boot camp lead by Jean-Paul Boodhoo. Wow, what an experience, JP is an insanely smart developer and a wonderful person in general. By the end of the week I was inspired to be the same. I’ve continued to hone my skills through use and further study and I feel that I have grown to a point where I can begin to share my knowledge with others.
Tomorrow, I will be leading a discussion at work, it’s the first in what I hope will be a continued and successful endeavor that I am calling Applied.NET. I have planned out the first couple of topics and will be coding out examples during the meeting.

Tags:

Training

Cropper Patches

by Terry Hughes Tuesday, February 26, 2008 11:22 PM

A week ago I was staying up late looking through CodePlex. I noticed that Cropper had a few outstanding issues. Looking through the code and running an instance in the debugger I was able to get a handle for what would be required for some of the simpler issues. I was able to resolve these and upload the patches. I had never submitted code to an OSS project before and it felt really good taking unfamiliar code, working through it, and resolving the problems. Of course I woke up the next day realizing that I had missed a few scenarios and resubmit my patches but I also upload an addition feature.

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About Me

TerryH   I'm a senior software developer currently working for a small company specializing in case management software.

Page List

Disclaimer

The opinions and viewpoints expressed on this blog are not necessarily those of a cultured, tactful, or well-balanced person. This blog is a product of me, who is solely responsible for its content. Me - Stealing From Smart Developers.

Copyright © 2008-2009 Terry Hughes. All rights reserved.