忍者ブログ

hirano.xxxxxxxx.jp

自分用のメモ置き場
MENU

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

subversion(1)

突然ですが会社のCVSレポジトリがお亡くなりに。(´;ω;`)

※僕が管理していたわけじゃないです。ヽ(`Д´)ノ

で、まー作りなおしなわけですが、イマドキはCVSじゃなくてsubversionっていうのを使うらしく、ちょっと勉強してみました。

(・ω・)ぽりぽり

(以前紹介したAvidemuxのレポジトリもsubversionでしたね。そういえば。)

さて、いろいろネットで調べたわけですが・・・

・apache経由でhttpプロトコルが使える
・リビジョンはファイル単位じゃなくてレポジトリ単位
・CVSの欠点がいろいろ修正されている

とかなんとか。(´・∀・`)

Yumで普通にインストールできるみたいです。

■パッケージ

・mod_dav_svn
・subversion

この2つをインストールしました。




さて、設定なんですがmod_dav_svnをインストールしたので/etc/httpd/conf.d/にそれっぽいファイルがあるハズなので探してみるとありました。

subversion.conf

# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn".  Each repository
# must be readable and writable by the 'apache' user.
#
# Note that if SELinux is enabled, the repositories must be labelled
# with a context which httpd can write to; this will happen by default
# for newly created directories in /var/www.  Use the command
# "restorecon -R /var/www/svn" to label the repositories if migrating
# from a system without SELinux enabled; to label a repository outside
# /var/www, use "chcon -R -h -t httpd_sys_content_t /path/to/repos".

あら親切。(・∀・)

えーと・・・。/var/www/svnっていうフォルダをつくれと。
んで、apacheユーザに読み書き権限を与えなさい・・・かな。
SELinux使ってる場合は、restorecon -R /var/www/svnつーコマンドを実行すれ。

とりあえずやってみます。

cd /var/www
mkdir svn
chown -R apache:apache svn
restorecon -R /var/www/svn

とくに文句はいわれなかったのでよしとします。
次はレポジトリを作成するわけですが・・・

# To create a new repository using this scheme, say,
# http://localhost/repos/stuff, run as root:
#
#   # cd /var/www/svn
#   # svnadmin create stuff
#   # chown -R apache.apache stuff

まぁ親切。(・∀・)

例えばstuffというレポジトリを付くる場合は・・・っと。
とりあえず個人用にhiranoというレポジトリを作ることにします。

※レポジトリをプロジェクト単位につくることもあるらしいです。

cd /var/www/svn
svnadmin create hirano
chown -R apache:apache hirano

・・・できた・・・のか?

で最後にapacheでレポジトリを公開します。アクセスユーザの制限などはapacheの機能でやるみたいです。社内用にしても自分用にしてもインターネットで公開とかするわけないので、アクセス制限はしません。

(^ω^;)

<Location /repos>
   DAV svn
   SVNParentPath /var/www/svn

#   # Limit write permission to list of valid users.
#   <LimitExcept GET PROPFIND OPTIONS REPORT>
#      # Require SSL connection for password protection.
#      # SSLRequireSSL
#
#      AuthType Basic
#      AuthName "Authorization Realm"
#      AuthUserFile /path/to/passwdfile
#      Require valid-user
#   </LimitExcept>
</Location>

後、登録するソースコードのエンコーディングはMS932なので

/etc/httpd/conf/httpd.conf

#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
#AddDefaultCharset UTF-8
AddDefaultCharset Windows-31J

これを忘れずに。

httpdを再起動してっと・・・
http://localhost/repos/hiranoにアクセスすればいいっぽいですね。









(・∀・)できた。



PR

× CLOSE

カレンダー

03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

最新CM

[09/19 Gatu]
[06/08 石井弘明]
[03/04 yama]
[02/15 ひらの]
[02/14 魔]

最新記事

最新TB

ブログ内検索

最古記事

(12/30)
(01/03)
(01/04)
(01/04)
(01/04)

NINJATOOLS

× CLOSE

Copyright © hirano.xxxxxxxx.jp : All rights reserved

TemplateDesign by KARMA7

忍者ブログ [PR]