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

Re: http access...

From: Madison Kelly <linux_at_alteeve.com>
Date: 2006-10-05 20:08:33 CEST

bruce wrote:
> hi...
>
> ok. somewhere i've screwed up, or forgot something.. i thought i had tested
> this awhile ago.
>
> i'm trying to set up a test to access a repository via http/apache.
>
> the test repository is outside the normal http doc root '/var/www/html'. the
> test repo is '/svnroot'. the actual test svn is /svnroot/test1. i can access
> this via 'svn list file:///svnroot/test1'.
>
> i have the following section in the http.conf file:
>
> #test svn app
> <Location /svn1>
> Order allow,deny
> Allow from all
> DAV svn
> SVNParentPath /svnroot
> # SVNPath /gforge-svn/troy/svn
> # AuthzSVNAccessFile /svnroot/conf/authz
>
>
> # Require valid-user
> # AuthType Basic
> # AuthName "svn test"
> # AuthUserFile /svnroot/conf/passwd
> </Location>
>
> i try to access it via http://102.168.0.1/svn1/test1
>
> i get an error in the httpd err log saying it can't find the
> /var/www/html/svn1 dir.....
>
> i was under the impression that i should be able to use a simple browser to
> be able to access/view files in a repository without needing
> websvn/webcvs/etc...
>
> any thoughts/comments/help....
>
> if i could see someone's httpd.conf file, as well as how you access the
> repository, and the repository physical location, i can try to figure out
> what's going on.
>
> thanks

I've always found examples worked best for me, so given that I am
somewhat new to SVN myself I'll post my (working) httpd.conf file
(relevant parts, anyway). Note that I am on FreeBSD so paths may seem
odd, adjust accordingly. Some may not be needed as I am running WebSVN
(like the PHP module, iirc)

-=-=-=-=-=-
LoadModule dav_module /usr/local/libexec/apache2/mod_dav.so
LoadModule dav_svn_module /usr/local/libexec/apache2/mod_dav_svn.so
LoadModule authz_svn_module /usr/local/libexec/apache2/mod_authz_svn.so
LoadModule php5_module /usr/local/libexec/apache2/libphp5.so

...

DocumentRoot "/var/www"
<Directory "/var/www">
     Options Indexes FollowSymLinks ExecCGI Includes FollowSymLinks
     AllowOverride None
     Order allow,deny
     Allow from all
</Directory>

DirectoryIndex index.html index.php index.html.var
AccessFileName .htaccess

# SVN Repos
<Location /svn>
         DAV svn
         SVNParentPath /var/svn
         AuthzSVNAccessFile /etc/svn-access-file
         AuthType Basic
         AuthName "Synaptic Subversion Repositories"
         AuthUserFile /etc/svn-auth-file
         Require valid-user
</Location>
-=-=-=-=-=-

   And here are my notes to myself I wrote while installing SVN; again,
ymmv :)

-=-=-=-=-=-
-=] Server setup [=-
### On the server: ###
- When installing via 'ports', install Apache20 using 'make
WITH_BERKELEYDB=db4'
   and install subversion with 'make WITH_MOD_DAV_SVN=yes'.

- Setup Apache by adding ('/svn' is where the various projects are stored):
LoadModule dav_module /usr/local/libexec/apache2/mod_dav.so
LoadModule dav_svn_module /usr/local/libexec/apache2/mod_dav_svn.so
LoadModule authz_svn_module /usr/local/libexec/apache2/mod_authz_svn.so
...
# SVN Repos
<Location /svn>
        DAV svn
        SVNParentPath /var/svn
        AuthzSVNAccessFile /etc/svn-access-file
        AuthType Basic
        AuthName "Synaptic Subversion Repositories"
        AuthUserFile /etc/svn-auth-file
        Require valid-user
</Location>

- Now setup authentication (use '-c' first time only to create the file):
# htpasswd -cm /etc/svn-auth-file user1
<pass>
<pass>
# htpasswd -m /etc/svn-auth-file user2
<pass>
<pass>
...

- Now create the file '/etc/svn-access-file' and add data like:
-=] Start '/etc/svn-access-file' [=-
[groups]
test = user1
cdx = user1,user2

[test:/]
@test = rw
* = r

[cdx:/]
@cdx = rw
* = r

# Permissions are inherited, so I could open up a directory to the
'test' group like this:
#[cdx:/testing]
#@test = rw
-=] End '/etc/svn-access-file' [=-

-=] Create a repository [=-
- Once installed, create your project repository path and run:
# svnadmin create /path/to/repo

### On the client: ###
-=] Prepare the Project [=-
- Create the directory with the project files:
# mkdir ./project/trunk
                ./tags
                ./branches

- Copy your project into './project/trunk'.
- Now run the initial import:
# cd ./project
# svn import . http://<url>/path/to/<project> -m "Initial import."
- Once imported, delete your copy:
# cd ..
# rm -rf ./project
- Now checkout the project from SVN (to get revision info)
# svn co http://<url>/path/to/<project>

Done!!!

To install 'ViewVC'
- # cd /usr/ports/devel/viewvc && make && make install
- # cp /usr/local/viewvc/viewvc.conf.dist /usr/local/viewvc/viewvc.conf
- Edit /usr/local/viewvc/viewvc.conf as documented
- # cp /usr/local/viewvc/bin/cgi/* /path/to/cgi-bin
- Install Subversion Python bindings
- # cd /usr/ports/devel/subversion-pytong && make && make install
-=-=-=-=-=-

HTH!

Madi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Oct 5 20:10:02 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.