|
ÀÛ¼ºÀÏ : 12-02-16 19:13
CentOS - Apache + SVN + Trac ¿¬µ¿
|
|
Á¶È¸ : 226,015
|
|
svn ¼³Ä¡½Ã ±âº» ÀúÀå¼Ò´Â /var/www/svn À¸·Î Çϸç trac Àº /var/www/trac ·Î »ç¿ëÇÕ´Ï´Ù.
1. Apache ¼³Ä¡ ¾ÆÆÄÄ¡°¡ ¼³Ä¡ µÇ¾î ÀÖ´ÂÁö È®ÀÎ ÇÕ´Ï´Ù. (CentOS 5.4¿¡¼´Â ÀÚµ¿ ¼³Ä¡ µÇ¾î Àִµí..)
[root@ruo91 ~]# rpm -aq | grep httpd system-config-httpd-1.3.3.3-1.el5 httpd-2.2.3-31.el5.centos
¸¸¾à ¼³Ä¡°¡ ¾ÈµÈ °æ¿ì¶ó¸é ¼³Ä¡¸¦ ÁøÇà ÇÕ´Ï´Ù.
[root@ruo91 ~]# yum install -y httpd [root@ruo91 ~]# chkconfig httpd on
2. subversion (SVN) ¼³Ä¡ SVN À» ¼³Ä¡ÇÏ°Ô µÇ¸é ÀÇÁ¸¼º ÆÐÅ°ÁöÀÎ neon °ú perl-URI °¡ °°ÀÌ ¼³Ä¡ µË´Ï´Ù.
[root@ruo91 ~]# yum install -y subversion
subversion ½ºÅ©¸³Æ® »ý¼º
[root@ruo91 ~]# touch /etc/init.d/subversion
[root@ruo91 ~]# chmod +x /etc/init.d/subversion
[root@ruo91 ~]# vi /etc/init.d/subversion
#!/bin/bash . /etc/rc.d/init.d/functions
[ -x /usr/bin/svnserve ] || exit 1
RETVAL=0 prog="svnserve" desc="Subversion server" OPTIonS="--threads --root /var/www/svn"
start() { echo -n $"Starting $desc ($prog): " daemon $prog -d $OPTIONS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog echo }
stop() { echo -n $"Shutting down $desc ($prog): " killproc $prog RETVAL=$? [ $RETVAL -eq 0 ] && success || failure echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog return $RETVAL }
case "$1" in start) start ;; stop) stop ;; restart) stop start RETVAL=$? ;; condrestart) [ -e /var/lock/subsys/$prog ] && restart RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart}" RETVAL=1 esac
exit $RETVAL EOF
3. Apache + SVN ¿¬µ¿ ¾ÆÆÄÄ¡¿Í SVNÀ» ¿¬µ¿Çϱâ À§Çؼ mod_dav_svn À» ¼³Ä¡ ÇÕ´Ï´Ù.
[root@ruo91 ~]# yum install -y mod_dav_svn
¼³Ä¡°¡ ¿Ï·á µÇ¸é httpd/modules µð·ºÅ丮¿¡ µÎ°¡ÁöÀÇ ¸ðµâÀÌ ÀÖ´Â°É È®ÀÎ ÇÒ¼ö ÀÖ½À´Ï´Ù.
[root@ruo91 ~]# find /usr/lib/ | grep svn /usr/lib/httpd/modules/mod_dav_svn.so /usr/lib/httpd/modules/mod_authz_svn.so
¶ÇÇÑ httpd.conf ¿¡ À§ µÎ°¡Áö ¸ðµâÀ» µû·Î Ãß°¡ ÇÏÁö ¾Ê¾Æµµ ÀÌ¹Ì subversion.conf ¿¡ Àֱ⠶§¹®¿¡ ¸î°¡Áö ¼³Á¤ ¸¸ ÇØÁÖ½Ã¸é µË´Ï´Ù.
svn µð·ºÅ丮¿Í SVN »ç¿ëÀÚ °èÁ¤À» »ý¼ºÇÏ°í ¾ÆÆÄÄ¡ °èÁ¤ÀÌ Á¢±ÙÇÒ¼ö ÀÖµµ·Ï º¯°æ ÇÕ´Ï´Ù.
[root@ruo91 ~]# mkdir -p /var/www/svn [root@ruo91 ~]# cd /var/www/svn [root@ruo91 ~]# svnadmin create ruo91 [root@ruo91 ~]# chown -R apache.apache ruo91
SVN »ç¿ëÀÚÀÇ ÀÎÁõ Æнº¿öµå ÆÄÀÏÀ» »ý¼ºÇÕ´Ï´Ù.
[root@ruo91 ~]# htpasswd -cm [Æнº¿öµå ÆÄÀÏ] [»ç¿ëÀÚ]
[root@ruo91 ~]# htpasswd -cm /var/www/svn/user-ruo91-passwd ruo91 New password: Re-type new password: Adding password for user ruo91
¿É¼Ç ¼³¸í
-c : »õ·Î¿î ÆÄÀÏ »ý¼º -m : MD5 ·Î ¾ÏÈ£È
´Ù¸¥ »õ·Î¿î »ç¿ëÀÚ Ãß°¡ ÇÒ¶§´Â ¾Æ·¡¿Í °°ÀÌ -c ¿É¼ÇÀ» »©°í Ãß°¡ ÇØÁÖ¸é µË´Ï´Ù.
[root@ruo91 ~]# htpasswd -m /var/www/svn/user-ruo911-passwd ruo911
ÀÎÁõÇÒ »ç¿ëÀÚ¸¦ ¼³Á¤ ÇØÁÖ±â À§ÇØ authz, passwd, svnserve.conf ÆÄÀÏÀ» ¼³Á¤ ÇÕ´Ï´Ù.
[root@ruo91 ~]# vi /var/www/svn/ruo91/conf/authz [groups] authz = ruo91 @authz = rw
[root@ruo91 ~]# vi /var/www/svn/ruo91/conf/passwd [users] ruo91 = 123456
[root@ruo91 ~]# vi /var/www/svn/ruo91/conf/svnserve.conf [general] anon-access = read # À͸íÁ¢±Ù½Ã ÀúÀå¼Ò Àб⠱ÇÇÑ auth-access = write # ÀÎÁõµÈ »ç¿ëÀÚÀÇ °æ¿ì ¾²±â ±ÇÇÑ password-db = passwd # ÀÎÁõ¿¡ »ç¿ëµÉ »ç¿ëÀÚÀÇ ºñ¹Ð¹øÈ£ ÆÄÀÏ authz-db = authz # ÀÎÁõ¿¡ »ç¿ëµÉ »ç¿ëÀÚ ±×·ì ÆÄÀÏ realm = My First Repository # ÀúÀå¼Ò¿¡ Ç¥½ÃµÉ À̸§(?) ¶Ç´Â ÀúÀå¼Ò °£·« ¼³¸í(?)
subversion ¼³Á¤À» ÇÕ´Ï´Ù.
[root@ruo91 ~]# vi /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /repos> DAV svn SVNParentPath /var/www/svn AuthType Basic AuthName "Authorization!!" AuthUserFile /var/www/svn/user-ruo91-passwd Require valid-user </Location>
SVN À» ½ÃÀÛÇÕ´Ï´Ù.
[root@ruo91 ~]# /etc/init.d/subversion start
- SVN ±âº» µð·ºÅ丮 ¸¸µé±â ¼Ò½º Äڵ带 °ü¸®Çϱâ À§Çؼ´Â trunk , branches, tags ¸¦ ¸¸µé¾î Áà¾ß ÇϹǷΠÀӽ÷Πexport °É¾î ÁÖ°í ½ÃÀÛÇÕ´Ï´Ù.
[root@ruo91 ~]# export SVN_EDITOR="/bin/vi" ; export SVN_EDITOR
¾Æ·¡Ã³·³ trunk µð·ºÅ丮¸¦ ¸¸µé¾î ÁÖ¸é vi ¿¡µðÅÍ°¡ ÀÚµ¿À¸·Î ³ª¿À°Ô µË´Ï´Ù.
[root@ruo91 ~]# svn mkdir http://192.168.0.99/repos/ruo91/trunk
--ÀÌ ÁÙ ÀÌÇÏ´Â ÀÚµ¿À¸·Î Á¦°ÅµË´Ï´Ù--
A svn://192.168.0.99/ruo91/trunk ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "svn-commit.tmp" 4L, 75C 1,0-1 ¸ðµÎ
À̶§ :q ¸¦ ´·¯ ¿¡µðÅÍ¿¡¼ ºüÁ® ³ª¿É´Ï´Ù.
:q
C ¸¦ ´·¯ ³ª¿É´Ï´Ù.
·Î±× ¸Þ½ÃÁö°¡ º¯°æµÇÁö ¾Ê¾Ò°Å³ª ÁöÁ¤µÇÁö ¾Ê¾Ò½À´Ï´Ù Ãë¼Ò (A), °è¼Ó(C), ¼öÁ¤(E) C
ÀÎÁõ ¿µ¿ªÀ» »ç¿ëÇϱâ À§ÇØ ¸®´ª½º root »ç¿ëÀÚÀÇ ¾ÏÈ£¿Í svn »ç¿ëÀÚÀÇ ¾ÏÈ£¸¦ ÀÔ·Â ÇØÁÝ´Ï´Ù. (¾ÏÈ£´Â º¸¾È»ó º¸ÀÌÁö ¾ÊÀ½)
ÀÎÁõ ¿µ¿ª(realm): <http://192.168.0.99:80> Authorization!! 'root'ÀÇ ¾ÏÈ£: ÀÎÁõ ¿µ¿ª(realm): <http://192.168.0.99:80> Authorization!! »ç¿ëÀÚ¸í:ruo91 'ruo91'ÀÇ ¾ÏÈ£:
Ä¿¹ÔµÈ ¸®ºñÀü 1.
branches µð·ºÅ丮 ¸¸µé±â (trunk ¿Í ¹Ýº¹..)
[root@ruo91 ~]# svn mkdir http://192.168.0.99/repos/ruo91/branches
·Î±× ¸Þ½ÃÁö°¡ º¯°æµÇÁö ¾Ê¾Ò°Å³ª ÁöÁ¤µÇÁö ¾Ê¾Ò½À´Ï´Ù Ãë¼Ò(A), °è¼Ó(C), ¼öÁ¤(E) C
Ä¿¹ÔµÈ ¸®ºñÀü 2.
tags µð·ºÅ丮 ¸¸µé±â
[root@ruo91 ~]# svn mkdir http://192.168.0.99/repos/ruo91/tags
·Î±× ¸Þ½ÃÁö°¡ º¯°æµÇÁö ¾Ê¾Ò°Å³ª ÁöÁ¤µÇÁö ¾Ê¾Ò½À´Ï´Ù Ãë¼Ò(A), °è¼Ó(C), ¼öÁ¤(E) C
Ä¿¹ÔµÈ ¸®ºñÀü 3.
À§¿¡¼ ¸¸µç µð·ºÅ丮¸¦ È®ÀÎ ÇÕ´Ï´Ù.
[root@ruo91 ~]# svn list http://192.168.0.99/repos/ruo91 branches/ tags/ trunk/
4. Trac ¼³Ä¡ RPMforge ¿¡¼ ´Ù¿î¹Þ°í ¼³Ä¡ ÇÕ´Ï´Ù.
[root@ruo91 ~]# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm [root@ruo91 ~]# rpm -Uvh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
[root@ruo91 ~]# yum install -y mod_python trac
trac ÇÁ·ÎÁ§Æ®¸¦ ¼³Ä¡ ÇÕ´Ï´Ù.
[root@ruo91 ~]# trac-admin /var/www/trac/ initenv
Creating a new Trac environment at /var/www/trac
Trac will first ask a few questions about your environment in order to initialize and prepare the project database.
Please enter the name of your project. This name will be used in page titles and descriptions.
Project Name [My Project]> Yongbok Project
Please specify the connection string for the database to use. By default, a local SQLite database is created in the environment directory. It is also possible to use an already existing PostgreSQL database (check the Trac documentation for the exact connection string syntax).
Database connection string [sqlite:db/trac.db]>
Please specify the type of version control system, By default, it will be svn.
If you don't want to use Trac with version control integration, choose the default here and don't specify a repository directory. in the next question.
Repository type [svn]>
Please specify the absolute path to the version control repository, or leave it blank to use Trac without a repository. You can also set the repository location later.
Path to repository [/path/to/repos]> /var/www/svn/ruo91
Creating and Initializing Project Installing default wiki pages PageTemplates imported from /usr/lib/python2.4/site-packages/trac/wiki/default-pages/PageTemplates TracGuide imported from /usr/lib/python2.4/site-packages/trac/wiki/default-pages/TracGuide ..................... ................................ ........................................ --------------------------------------------------------------------- Warning: couldn't index the repository.
This can happen for a variety of reasons: wrong repository type, no appropriate third party library for this repository type, no actual repository at the specified repository path...
You can nevertheless start using your Trac environment, but you'll need to check again your trac.ini file and the [trac] repository_type and repository_path settings in order to enable the Trac repository browser. --------------------------------------------------------------------- Project environment for 'Yongbok Project' created.
You may now configure the environment by editing the file:
/var/www/trac/conf/trac.ini
If you'd like to take this new project environment for a test drive, try running the Trac standalone web server `tracd`:
tracd --port 8000 /var/www/trac
Then point your browser to http://localhost:8000/trac. There you can also browse the documentation for your installed version of Trac, including information on further setup (such as deploying Trac to a real web server).
The latest documentation can also always be found on the project website:
http://trac.edgewall.org/
Congratulations!
¾ÆÆÄÄ¡°¡ »ç¿ëÇÒ¼ö ÀÖµµ·Ï º¯°æÇÕ´Ï´Ù.
[root@ruo91 ~]# chown apache:apache /var/www/trac/* [root@ruo91 ~]# chmod -R 777 /var/www/trac
Trac ÀÎÁõ Æнº¿öµå ÆÄÀÏÀ» »ý¼ºÇÕ´Ï´Ù.
[root@ruo91 ~]# htpasswd -cm /var/www/trac/user-ruo91-trac-passwd ruo91 New password: Re-type new password: Adding password for user ruo91
subversion ¿¡ Trac ¼³Á¤À» Ãß°¡ ÇØÁÝ´Ï´Ù.
[root@ruo91 ~]# vi /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /repos> DAV svn SVNParentPath /var/www/svn AuthType Basic AuthName "Authorization!!" AuthUserFile /var/www/svn/user-ruo91-passwd Require valid-user </Location>
<Location /trac> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnv /var/www/trac PythonOption TracUriRoot /trac AuthType Basic AuthName "Yongbok Trac Environment" AuthUserFile /var/www/trac/user-ruo91-trac-passwd Require valid-user </Location>
¿¬µ¿ È®ÀÎÀ» À§ÇØ Apache ¸¦ Àç½ÃÀÛ ÇÕ´Ï´Ù.
[root@ruo91 ~]# service httpd restart
SVN ÀúÀå¼Ò È®ÀÎ
Trac È®ÀÎ
Âü°í http://wiki.centos.org/HowTos/Subversion http://www.brandonchecketts.com/archives/installing-svn-and-trac-on-a-centos-5-server
|
|
|
|
|