さくらVPSサーバ設定メモ(6)

2011年5月14日 オフ 投稿者: KYO
Table of Contents

Apache、PHPなどの設定が終わったので、subversonとTracのインストール

  • subversion
  • trac

  • subversion

 

[shell]

sudo yum install subversion subversion-devel subversion-perl subversion-ruby

$ sudo yum install -y mod_dav_svn

$ sudo mkdir -p /home/subversion/test

$ sudo chown apache:apache /home/subversion/test

$ sudo svnadmin create /home/subversion/test –fs-type fsfs

$ sudo vim /etc/httpd/conf.d/subversion.conf

 

 

LoadModule dav_svn_module modules/mod_dav_svn.so

LoadModule authz_svn_module modules/mod_authz_svn.so

NameVirtualHost svn3.thekyo.jp:80

<VirtualHost *:80>

ServerName www.example.com

ServerAdmin admin@example.com

ServerAlias www.example.com

DocumentRoot /home/subversion

ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var

ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var

ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var

ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var

Alias /favicon.ico “/var/www/html/favicon.ico”

Alias /error/ “/var/www/error/”

<Location “/svn”>

DAV svn

SVNListParentPath on

SVNParentPath /home/subversion

SVNAutoversioning on

<LimitExcept GET PROPFIND OPTIONS REPORT>

AuthzSVNAccessFile /home/subversion/.htsvn_access

AuthType Basic

AuthName “Authorization Subversion”

AuthUserFile /home/trac/.trac_htpasswd

Require valid-user

Order Allow,Deny

Allow from all

</LimitExcept>

</Location>

</VirtualHost>

[/shell]

 

  • Subversion ACLファイル

[shell]

$ sudo vim /home/subversion/.htsvn_access

 

[groups]

root = root

svnadmin = root, user1,user2

[/]

* = r

[test:/]

@root = rw

@svnadmin = rw

[/shell]

 

  • tracインストール前準備
    • Subversion設定に関する部分

[shell]

$ sudo mkdir -p /home/trac

$ sudo htpasswd /home/trac/.trac_htpasswd root

$ sudo htpasswd -c /home/trac/.trac_htpasswd user1

$ sudo htpasswd /home/trac/.trac_htpasswd user2

[/shell]

 

 

  • trac

 

[shell]

$ sudo yum install python pyhon-devel python-setuptools mod_python sqlite trac

$ cd /usr/local/src/

$ sudo wget http://www.i-act.co.jp/project/products/downloads/Trac-0.12.2.ja1.zip

$ sudo unzip Trac-0.12.2.ja1.zip

$ cd Trac-0.12.2.ja1

$ sudo python setup.py install

$ mkdir -p /home/trac/test

$ sudo trac-admin /home/trac/test initenv

$ sudo vim /etc/httpd/conf.d/vhost/trac.jp.conf

 

 

<VirtualHost *:80 >

ServerName www.example.com

DocumentRoot /home/trac

ServerAlias www.example.com

<Location “/”>

SetHandler mod_python

PythonHandler trac.web.modpython_frontend

PythonOption TracEnvParentDir /home/trac

PythonOption TracUriRoot /

AuthName “Basic Auth”

AuthType Basic

AuthUserFile /home/trac/.trac_htpasswd

Require valid-user

</Location>

</VirtualHost>

[/shell]