The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Rubyforge ViewVC - Now With mod_python

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Matt Bauer

Posts: 48
Nickname: bauer
Registered: Apr, 2007

Matt Bauer owns Mosquito Mole Multiworks - a Rails Hosting and Consulting Company
Rubyforge ViewVC - Now With mod_python Posted: May 2, 2007 5:45 PM
Reply to this message Reply

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
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Matt Bauer
Latest Posts From blogmmmultiworks

Advertisement

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

Next I added the necessary modules to httpd.conf:

LoadModule dav_svn_module     /usr/local/apache2/modules/mod_dav_svn.so
LoadModule authz_svn_module   /usr/local/apache2/modules/mod_authz_svn.so
LoadModule python_module      /usr/local/apache2/modules/mod_python.so
Note that the order is important. Next I configured the virtual host:
<VirtualHost *:80>

ServerName viewvc.rubyforge.mmmultiworks.com

DocumentRoot /u/apps/viewvc/bin/mod_python

<Directory /u/apps/viewvc/bin/mod_python/>
  AddHandler python-program .py
  PythonHandler rubyforge-handler
  PythonDebug Off
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

#RedirectMatch /cgi/viewvc.cgi(.*) /rubyforge-viewvc.py$1

RewriteEngine On

RewriteCond  %{REQUEST_URI}  ^/cgi/viewvc.cgi*
RewriteRule  ^/cgi/viewvc.cgi(.*)$  /rubyforge-viewvc.py$1  [L]

</VirtualHost>
I added the rewrite rule to handle to make sure the old urls still work.

I then added the ViewVC libs as a python site-package with the following:

$ echo /u/apps/viewvc/lib > /usr/local/lib/python-2.4/site-packages/viewvc.pth
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.

Read: Rubyforge ViewVC - Now With mod_python

Topic: Ajuste al Badge Javascript de Twitter para que funcione en Internet Explorer Previous Topic   Next Topic Topic: Erring in Hackety Hack 0.4

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use