Archive for October, 2008

Ok, it is not done yet. I found another problem today.

Everything worked great in my home network. But today, when I tried to check out code from outside network, I found a problem. I didn’t open port 22 for my home server. Instead, I open a non-stand port on my router and forward traffic on that port to port 22 at my home server. But when I use svn+ssh, it seems there no way to specify port number.

After some research, I found all you need to do is to change the configuration file of the subversion on your local machine (at outside network). Open file “~/.subversion/config”, then go to section “tunnel”, add following line:

ssh_home = $SVN_SSH ssh -p 12345

Port 12345 is the non-standard port opened on my router. Then on my local machine, I use this command to check out code:

svn co svn+svn_home://my.home.domain.com/home/svn/repos/sandbox/trunk sandbox

Problem solved!

Recently I tryied to setup a development server at home. It’s pretty easy to install the subversion server since there are so many great tutorials online. I don’t want to use HTTP protocol to remote access my code repository because I always like svn+ssh better. But I do want a web interface to browse my repositories and compare the difference between reversions. So ViewVC becomes my nature choice. To be more specific, I want to be able to access the source tree from my home network freely; if from outside network, I want some basic security so that my code is not share with the whole world for free.

It’s not that hard either. But I did spend some time to figure out the security stuff. After all, I am not a system engineer. :-) Anyway, after it is done, I restarted the Apache server, and everything worked beautifully.  Actually for me there are only two files you need to modify, one is the /etc/apache2/conf.d/viewvc.conf, the other is the viewvc.conf at ViewVC’s home directory. Here is the Apache configuration file:

ScriptAlias /viewvc /home/svn/viewvc-1.0.6/bin/cgi/viewvc.cgi
ScriptAlias /query /home/svn/viewvc-1.0.6/bin/cgi/query.cgi


AuthUserFile /home/svn/viewvc-1.0.6/viewvc_passwd
AuthName “coffeestone:viewvc”
AuthType Basic
Require valid-user

Order allow,deny
Allow from 127.0.0
Allow from 192.168.2
Satisfy Any


AuthUserFile /home/svn/viewvc-1.0.6/viewvc_passwd
AuthName “coffeestone:viewvc”
AuthType Basic
Require valid-user

Order allow,deny
Allow from 127.0.0
Allow from 192.168.2
Satisfy Any

As you can see, I installed ViewVC at directory “/home/svn/viewvc-1.0.6″, and use command “htpasswd2″ to create a password file “viewvc_passwd” in that directory. Another file changed is viewvc.conf at ViewVC’s home directory. I only post changed variables as following:

svn_roots = coffeestone : /home/svn/repos/
default_root = coffeestone
root_as_url_component = 0
use_rcsparse = 0
use_enscript = 1
enscript_path = /usr/bin/

Well, it is that simple. Now I can enjoy my home development server!