• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4963
  • Last Modified:

How to run a SVN server on subdomain on port 80?

On a Debian "stable" distribution, I'm looking to run a simple SVN server on svn.example.org, on port 80.

I already am running Apache 1.3 on example.org, and various other subdomain1-6.example.org, all vhosts, listening on port 80. The SVN subdomain is not handled by Apache. I have CNAME records in place for all subdomains, and an A record for example.org.

When I attempt to start the SVN server on port 80, with the subdomain as listen-host, I get the following:

server:# svnserve -d --listen-port 80 --listen-host svn.example.org -r /usr/local/svn
Can't bind server socket: Address already in use

I believe the problem is due to all domains and subdomains all being served from the same server, and thus the same IP-address, but I am not sure.

What can I do to allow the SVN server to listen on port 80 as well as Apache listening on port 80 for the other subdomains?
2 Solutions
I believe what you need is libapache2-svn. This page has some rather useful pointers: http://www.geocities.com/arhuaco/doc/subversion/apache-subversion-in-debian.html

You may need to run svn on a different port and use mod_proxy or mod_rewrite to bounce an apache vhost to the different port via localhost.
AchtonAuthor Commented:
Thanks, but I'd rather keep it simple and not mix Apache into this (at all if possible, or only very little).

I'd prefer to have the SVN server running as a daemon, and on port 80. It works fine using, say, port 443 or 3690. This is to enable access to the SVN server from behind very restrictive firewalls, amongst other things.

BTW: I should probably note that the server also runs Shorewall, though I don't think it is the primary reason for this problem.
You can't run two different services on the same port and IP address at the same time.

You can see what runs on port 80 using:

netstat -lnp

Chances are, this would be apache (httpd).

What you could do, though, is start svndaemon at some other port on and set up Apache to proxy all requests to a specific virtual host to

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

AchtonAuthor Commented:
It's a good suggestion, and one I have tried already. I gave it one more shot just now, though.

Unfortunately, it seems that when Apache (1.3 in my case) is not DAV/SVN-aware, I cannot have Apache forward requests. I might as well be trying to forward RTSP packets  via Apache to some local server on a random port. If Apache doesn't understand the data, it can't be proxied.
good point. The only other solution there would be getting a separate IP address for SVN, then. This is, assuming that you can't get mod_dav_svn for your Apache. Out of curiousity, why do you want to have SVNServe and not apache serve the repositories? Maybe there is a different way to get this done.
AchtonAuthor Commented:
I can probably install DAV and SVN through Apache modules. But I prefer not to, since I do not have complete control and ownership of the server in question. Thus, I'd rather keep it as simple as possible, hence the seperate svnserve process.

I was afraid seperate IP's might be the only solution, but was not 100% sure, so thanks for confirming.
If I was the server administrator of the server in question, I would very much prefer having mod_dav_svn module in apache to running one more stand-alone daemon and dedicating an IP address to it. Bottom line - talk to the server admin, he/she might offer you some options we haven't thought about.
Forced accept.

EE Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now