認証を設定する †こっちの情報が今のところ一番新しいです。VMwareFusion/CentOS5/15.Apache+Subversionインストール subversion.confの設定 †# vi /etc/httpd/conf.d/subversion.conf <Location /svn> DAV svn SVNPath /home/svn/repos # only authenticated users may access the repository Require valid-user # how to authenticate a user AuthType Basic AuthName "Subversion repository" AuthUserFile /home/svn/repos/sample/.htpasswd </Location> もしくは <Location /svn> DAV svn SVNParentPath /home/svn/repos # only authenticated users may access the repository Require valid-user # how to authenticate a user AuthType Basic AuthName "Subversion repository" AuthUserFile /home/svn/repos/.htpasswd </Location> htpasswdの作成 †htpasswdの新規作成 # /usr/bin/htpasswd -c /home/svn/repos/sample/.htpasswd minaco Apacheの再起動 †# /etc/init.d/httpd restart 動作確認 †以下のURLにアクセスすると、認証がかかっている。 http://localhost/svn/sample/ ベーシック認証で作成したユーザに権限をつける †subversion.confの設定 †AuthzSVNAccessFile?を追加する <Location /svn> DAV svn SVNParentPath /home/svn/repos # only authenticated users may access the repository Require valid-user # how to authenticate a user AuthType Basic AuthName "Subversion repository" AuthUserFile /home/svn/repos/.htpasswd # how to access a user AuthzSVNAccessFile /home/svn/repos/.svnaccess </Location> 設定ファイル(.svnaccess)を作成する †# sample1 [sample1:/] minaco = rw guest = r # sample2 [sample2:/trunk/SampleTest1] minaco = rw guest = r sample1リポジトリは、minacoは読み書きが可能、guestは読み込みが可能となる。 sample2leリポジトリの/trunk/SampleTest1フォルダは、minacoは読み書きが可能、guestは読み込みが可能となる。 なお、sample2leリポジトリの/trunk/SampleTest2フォルダには、minacoもguestも読み込み不可となる。 [/] admin = rw adminを上記のように設定した場合、どのリポジトリにも読み書きが可能となる。 [/sample3] * = どのユーザも/sample3ディレクトリへのアクセスが不可能となる。 Apacheの再起動 †# /etc/init.d/httpd restart メモ †設定を以下にすれば、リポジトリが増えても設定を増やさなくてもよい。 <Location /svn> DAV svn SVNParentPath /home/svn/repos </Location> リポジトリ追加方法(まとめ) †# cd /home/svn/repos/ # mkdir 案件名 # /usr/local/svn/bin/svnadmin create 案件名 # /usr/local/svn/bin/svn mkdir file:///home/svn/repos/案件名/trunk -m "create" # /usr/local/svn/bin/svn mkdir file:///home/svn/repos/案件名/branches -m "create" # /usr/local/svn/bin/svn mkdir file:///home/svn/repos/案件名/tags -m "create" # /usr/local/svn/bin/svn import /tmp/sample file:///home/svn/repos/案件名/trunk -m "initial sample" # chown -R apache:apache /home/svn/repos/案件名 その他 †コマンド †# svn ls file:///home/svn/repos/sample/trunk/aaa/ # svn rm file:///home/svn/repos/sample/trunk/aaa/ コミットするときとか無視するファイルを設定する †以下のコマンドを実行する †$ cd /path/path $ svn pe svn:ignore sample 編集モードで無視するリストを記述する †*.as2proj *.as3proj log.txt Comment †
Counter: 44079,
today: 3,
yesterday: 0
|