[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Debian install in site subdirectory

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-08-07 16:32:18 CEST

On Aug 7, 2006, at 03:04, Albert Krawczyk wrote:

> I'd like to start of by saying that I'm sorry if I'm asking stupid
> questions but I've spent too much time trying to do my own research on
> this topic already.

Don't worry; it can be tricky to get right!

> I'm a windows user (insert flaming here) and have recently started
> working
> with a new team on developing a site. We have the site running in
> Apache2
> at
> root/public/website
>
> I installed subversion and related tools using
>> apt-get install subversion subversion-tools
> etc.

The server is then not Windows, I gather? Debian Linux perhaps?

> My question is, can someone in idiot speak explain to me how to set up
> subversion to run from;
>
> root/public/website/subversion

Well, if we're talking about filesystem paths here (and not web site
paths), then you should absolutely not put the repository files
there. You should put them anywhere else: anywhere outside of the web
server document root is fine. For example, at work, we have our
intranet site served from /data/vhosts/intranet/htdocs and the
repository in /data/svn/repo.

> the reason i need it to run from a sub directory of the main site
> is that
> i only have one domain-name that maps to /public/website/ and i
> can't get
> another one just for subversion,

There's nothing wrong with running the repository from a subdirectory
of the main site, *in terms of web site URLs*. In terms of filesystem
paths, though, they should not overlap, as stated above.

I'm not sure where it is in Debian or whatever Linux you're running,
but somewhere there will be a configuration file for Apache, often
called httpd.conf or apache.conf or something like that. In this file
there might be a virtual host for your main site, which might look
something like this:

<VirtualHost *:80>
        ServerName www.example.com
        DocumentRoot /root/public/website
</VirtualHost>

If your server doesn't use virtual hosts, then it'll be the same
except the two lines <VirtualHost *:80> and </VirtualHost> won't be
present.

You just need to put your repository somewhere (anywhere other than
inside /root/public/website)—let's say you put it in /root/public/
subversion. Then you add some lines to the virtual host so it looks
like this:

<VirtualHost *:80>
        ServerName www.example.com
        DocumentRoot /root/public/website
        <Location /subversion>
                DAV svn
                SVNPath /root/public/subversion
                #SVNPathAuthz off
                #SVNIndexXSLT /svnrsrc/index.xslt
                AuthType Basic
                AuthName "Example Repositories"
                AuthUserFile /root/public/subversion/conf/users
                Require valid-user
        </Location>
</VirtualHost>

Assuming you want people to log in with usernames and passwords, you
would need the Auth and Require lines at the end of the Location
block and to set up the file /root/public/subversion/conf/users with
user authentication information. You create this file with the
htpasswd program from Apache. You could also use LDAP or other
authentication means; consult the Apache documentation if you want that.

SVNPathAuthz off is a performance improvement you can use if you
don't plan to restrict access to parts of the repository to specific
users (that is: if everybody is going to be allowed to access
everything in the repository).

The SVNIndexXSLT directive is if you want to customize the appearance
of the directory index you see in the web browser.

The repository files should be owned by the user Apache runs under,
which depending on the server OS might be nobody, www, apache, or
something else. Look for the line in the httpd.conf that starts with
"User "; that'll tell you. If for example it says "User nobody" then
you should make the repository owned by "nobody":

sudo chown -R nobody /root/public/subversion

Probably also best if that's the only user that can see the
repository files:

sudo chmod -R go-rwx /root/public/subversion

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 7 16:34:19 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.