ä¸è¨URLã®ããã«ãsvnã§ã³ãããããéã«ãã³ã¡ã³ãã«refs #1ã¿ããã«ãã¦ãtracã®ãã±ããå±¥æ´ã«ã³ãããããã³ã¡ã³ãã¨ã½ã¼ã¹ã³ã¼ãã¸ã®ãªã³ã¯ãèªåã§å
¥ããé£æºãè¡ãã¾ã§ã®ã¡ã¢
http://www.thinkit.co.jp/cert/article/0712/4/4/3.htm
çµæ§ã¯ã¾ã£ãã®ã§ã¡ã¢ãã¨ãã¾ãããµãã¼ããã¼ã«ç³»ã§ã¯ã¾ãã¨èãããªãã
httpdã¤ã³ã¹ãã¼ã«
yum -y install httpd yum -y install mod_dav_svn
svnã¤ã³ã¹ãã¼ã«ãªã©
yum install subversion ãªãã¸ããªä½æ mkdir /home/hoge/svn/ cd /home/hoge/svn/ svnadmin create --fs-type fsfs repo1 svnã¯ã©ã¤ã¢ã³ãããã¯ãä¸è¨ã®ããã«ã¢ã¯ã»ã¹ svn+ssh://hoge@192.168.1.2/home/hoge/svn/repo1 apacheãããªãã¸ããªãåç §ããããã«ãapache権éã§ãªãã¸ããªãè¦ããããã«ãã¼ããã·ã§ã³ãå¤æ´ (mod_dav_svnçµç±ã§svnãå©ç¨ãã¦ããå ´åã¯ä¸è¦) chown hoge.apache /home/hoge chmod 750 /home/hoge
tracã§phpã½ã¼ã¹ã³ã¼ããåç
§ããããã¨ãè²ãã¤ããããã®ã¤ã³ã¹ãã¼ã«
yum install php php-cli yum install enscript
tracã¤ã³ã¹ãã¼ã«
yum -y install python yum -y install python-setuptools.noarch yum -y install mod_python wgetã§http://www.i-act.co.jpããããtracã®ææ°æ¥æ¬èªã½ã¼ã¹ããã¦ã³ãã¼ã wget http://www.i-act.co.jp/project/products/downloads/Trac-0.11.3.ja1.zip unzip Trac-0.11.3.ja1.zip cd Trac-0.11.3.ja1 python ./setup.py install mkdir /var/www/trac chown -R apache.apache /var/www/trac htpasswd -c /var/www/.htpasswd hoge
ããyumã§tracãå
¥ããå ´åã¯ãä¸è¨ãåç
§ã«ã
http://www.hanada.org/setting-up-trac-on-centos5
tracç¨httpã®confãä½æ
#vi /etc/httpd/conf.d/trac.confSetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/www/trac/ #PythonOption TracUriRoot /trac SetEnv PYTHON_EGG_CACHE /var/www/.egg-cache AuthType Basic AuthName "trac" AuthUserFile /var/www/.htpasswd Require valid-user #/etc/rc.d/init.d/httpd start
tracããã¸ã§ã¯ãã®ä½æ
trac-admin /var/www/trac/repo1 initenv ä¸è¨ã®ããã«çãã Project Name [My Project]> repo1 âé©å½ãªããã¸ã§ã¯ãå Database connection string [sqlite:db/trac.db]> âãã®ã¾ã¾æ¹è¡ Repository type [svn]> âãã®ã¾ã¾æ¹è¡ Path to repository [/path/to/repos]> /home/hoge/svn/repo1 âsvnã®ãªãã¸ããªãã¹
ããã¾ã§ã§ãä¸è¨URLã§ã¢ã¯ã»ã¹ã§ãã
http://192.168.1.2/trac/
tracã®åå¥è¨å®(phpã®ã½ã¼ã¹ã³ã¼ããè¦ããããã«)
#vi /var/www/trac/repo1/conf/trac.ini [mimeviewer] #enscript_path = enscript #ä¸è¨ã«æ¸ãæã enscript_path = /usr/bin/enscript #php_path = php #ä¸è¨ã«æ¸ãæã php_path = /usr/bin/php
tracã®åå¥è¨å®(phpã®ã½ã¼ã¹ã³ã¼ããutf8ã§æååãããå ´å)
#vi /var/www/trac/repo1/conf/trac.ini [trac] #default_charset = cp932 #ä¸è¨ã«æ¸ãæã default_charset = UTF8
SVNã®ã³ãããã«é£æºãã¦ãã±ããã«ã³ã¡ã³ããå
¥ãã
é£æºã¹ã¯ãªãããã¦ã³ãã¼ã cd /var/www/trac mkdir svn-contrib cd svn-contrib svn export http://svn.edgewall.com/repos/trac/trunk/contrib/trac-post-commit-hook chmod 755 trac-post-commit-hook svnã®hookã§é£æºã¹ã¯ãªããå¼ã³åºãè¨å® cd /home/hoge/svn/repo1/hooks vi post-commit #!/bin/sh SVNLOOK="/usr/bin/svnlook" PYTHON="/usr/bin/python" export LANG=ja_JP.UTF-8 REPOS="$1" REV="$2" LOG=`$SVNLOOK log -r $REV $REPOS` AUTHOR=`$SVNLOOK author -r $REV $REPOS` ${PYTHON} /var/www/trac/svn-contrib/trac-post-commit-hook \ -p "$TRAC_ENV" \ -r "$REV" \ -u "$AUTHOR" \ -m "$LOG"
ããã¾ã§ãã£ãããsvnã«ã³ãããããéã«ãã³ã¡ã³ãã«
refs #1 hogehogehoge
ã¨ããã¨ããã±ããï¼ã«å¯¾ãã¦ãå¤æ´å±¥æ´ã®ã½ã¼ã¹ã³ã¼ãã®ãªã³ã¯ãã³ã¡ã³ããhogehogehogeããè¨é²ããããã©ã¦ã¶ããåç §ã§ãã
ãã ãä»åã¯svn+sshãªã®ã§hookã®å®è¡ã¦ã¼ã¶ã¯ãã¼ã«ã«ã¦ã¼ã¶ã§ãããapacheã¦ã¼ã¶ã§ã¯ãªãã®ã§ãhookæã«tracã®dbå¤æ´ãªã©ã§ã¨ã©ã¼ã¨ãªã£ã¦ãã¾ã£ããä¸è¨ã®æ¹æ³(hogeã¦ã¼ã¶ã®ã°ã«ã¼ã権éãtracã®ãã¼ã¿ã«ä¸ãã)ã§å¯¾å¿ï¼æ®éã¯å¿ è¦ãªãï¼
chown apache.hoge /var/www/trac/repo1 chmod 775 /var/www/trac/repo1 chown apache.hoge /var/www/trac/repo1/db chmod 775 /var/www/trac/repo1/db chown apache.hoge /var/www/trac/repo1/db/trac.db chmod 664 /var/www/trac/repo1/db/trac.db
家ã®ä¸ã§ä½¿ãç°å¢ãªã®ã§ããã¼ããã·ã§ã³ã¨ããªã¼ãã¼ã¯ãã¾ãæ°ã«ããªããã¨ã«ããï½
åè
http://d.hatena.ne.jp/slywalker/20081006/1223281504
http://www.hanada.org/setting-up-trac-on-centos5
http://d.hatena.ne.jp/Tnzk/20090210/1234277380
http://blog.aklaswad.com/2007/000164.html
http://d.hatena.ne.jp/kasahi/20070717/1184691920
http://www.ibm.com/developerworks/jp/opensource/library/os-ecl-subversion/