This post originated from an RSS feed registered with Ruby Buzz
by Matt Bauer.
Original Post: Rubyforge ViewVC - Now With mod_python
Feed Title: blogmmmultiworks
Feed URL: http://blog.mmmultiworks.com/feed/rss.xml
Feed Description: Thoughts on Ruby, hosting and more
It was nice to get ViewVC back up and running but I wasn't happy with the performance. I wasn't surprised that it was slow since it was running as a CGI script. The obvious solution was to use mod_python and having some time today that's what I did. Yes, the url still says viewvc.cgi but trust me, it's using mod_python.
Getting mod_python running with Apache is rather easy. In my case it was just:
$ tar zxvf mod_python-3.3.1.tgz
$ cd mod_python-3.3.1
$ ./configure --with-apxs=/usr/local/apache2/bin/apxs
$ make
$ make install
I had to renamed the /u/apps/viewvc/bin/mod_python/viewvc.py script to /u/apps/viewvc/bin/mod_python/rubyforge-viewvc.py because line 5 in that file says, "import viewvc". This was causing an "Import Cycle" error in python. I'm sure there are other ways to solve this problem but renaming it is what I chose. This way if an error occurs I don't have to guess which viewvc.py file it was in. I also added the rubyforge prefix to the other scripts in that directory.
I didn't do any benchmarks to see how much faster mod_python is with ViewVC but it feels a whole lot more responsive. The real test will be when the GoogleBots come crawling.