2012年2月14日火曜日

Redmine 1.3.0! #05_2 Subversion とか

さぶば~じょんをうごかしておく

りぽじとり

リポジトリは /var/lib/svn にほっていくよ。

/$ sudo mkdir /var/lib/svn
/$ cd /var/lib/svn
/var/lib/svn$ sudo svnadmin create --fs-type fsfs test_repos
/var/lib/svn$ sudo chown www-data:www-data test_repos/ -R

dav_svn

libapache2-svn をインストールしてあるから,すでに /etc/apache2/mods-enableddav_svn.confdav_svn.load のシンボリックリンクがあって。

こんな風に修正。

--- dav_svn.org.conf    2011-06-01 01:10:30.000000000 +0900
+++ dav_svn.conf        2012-02-14 16:52:46.000000000 +0900

@@ -10,17 +10,18 @@
 # URL controls how the repository appears to the outside world.
 # In this example clients access the repository as http://hostname/svn/
 # Note, a literal /svn should NOT exist in your document root.
-#<Location /svn>
+<Location /svn>

   # Uncomment this to enable the repository
-  #DAV svn
+  DAV svn

   # Set this to the path to your repository
   #SVNPath /var/lib/svn
   # Alternatively, use SVNParentPath if you have multiple repositories under
   # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
   # You need either SVNPath and SVNParentPath, but not both.
-  #SVNParentPath /var/lib/svn
+  SVNParentPath /var/lib/svn
+  SVNListParentPath On

   # Access control is done at 3 levels: (1) Apache authentication, via
   # any of several methods.  A "Basic Auth" section is commented out
@@ -37,9 +38,9 @@
   # manage the password file - and the documentation for the
   # 'auth_basic' and 'authn_file' modules, which you will need for this
   # (enable them with 'a2enmod').
-  #AuthType Basic

-  #AuthName "Subversion Repository"
-  #AuthUserFile /etc/apache2/dav_svn.passwd
+  AuthType Basic
+  AuthName "Subversion Repository"
+  AuthUserFile /etc/apache2/dav_svn.passwd

   # To enable authorization via mod_authz_svn
   #AuthzSVNAccessFile /etc/apache2/dav_svn.authz
@@ -47,8 +48,8 @@
   # The following three lines allow anonymous read, but make
   # committers authenticate themselves.  It requires the 'authz_user'
   # module (enable it with 'a2enmod').

-  #<LimitExcept GET PROPFIND OPTIONS REPORT>
-    #Require valid-user
-  #</LimitExcept>
+  <LimitExcept GET PROPFIND OPTIONS REPORT>
+    Require valid-user
+  </LimitExcept>

 #</Location>

ぱすわ~ど

をつくっておかないと。

/$ cd /etc/apache2/
/etc/apache2$ sudo htpasswd -c dav_svn.passwd wal_san
New password:
Re-type new password:
Adding password for user wal_san

a2enmod

/etc/apache2/mods-enabled ながめるかぎりいらなさそうなんだけれども。

$ sudo a2enmod dav_svn
Considering dependency dav for dav_svn:
Module dav already enabled
Module dav_svn already enabled
$ sudo a2enmod auth_basic
Module auth_basic already enabled
$ sudo a2enmod authn_file
Module authn_file already enabled
$ sudo a2enmod authz_user
Module authz_user already enabled

ほら,いらないぢゃん。

あとは,#/etc/init.d/apache2 restart すればいいはず。

$ sudo /etc/init.d/apache2 restart
apache2: Syntax error on line 204 of /etc/apache2/apache2.conf: Syntax error on line 13 of /etc/apache2/mods-enabled/dav_svn.conf: /etc/apache2/mods-enabled/dav_svn.conf:13: <Location> was not closed.
Action 'configtest' failed.
The Apache error log may have more information.
 failed!

…あれ?

…ああ,</Location> のコメントはずし忘れてるよ。

あとは,http://ip-address/svn/ でリポジトリが見えればおっけー。

0 件のコメント: