LINUX
2017.03.14 / 11:35

[CentOs] ¼­ºê¹öÁ¯ ¼³Ä¡

Ŭ·¡½Ã
Ãßõ ¼ö 155

°³¹ßÀ» Çϸ鼭 ¹öÀü°ü¸® ÇÁ·Î±×·¥Àº Çʼö ÇÁ·Î±×·¥ Áß ÇϳªÀÔ´Ï´Ù.
Àú´Â ¼­¹ö¿¡ Á÷Á¢ÀûÀ¸·Î ÀÛ¾÷À» Çϱ⠶§¹®¿¡ °¡²û¾¿ ÆÄÀÏÀÌ ·Ñ¹éµÈ´Ù´øÁö ¿¹Àü »èÁ¦µÈ ÀÚ·á°¡ ¾ø¾î °í»ýÇÑ ÀûÀÌ ¸¹½À´Ï´Ù. ¤Ñ¤Ì

±×·¡¼­ Subversion(ÀÌÇÏ SVN)À» »ç¿ëÇÏ°í ÀÖ½À´Ï´Ù.
SVNÀ» ±âÁØÀ¸·Î ¾÷µ¥ÀÌÆ®ÇÏ°í ¼­¹ö¿¡ ¾÷·ÎµåÇÏ´Â Çü½ÄÀ¸·Î ³»°¡ ¾ðÁ¦ ¾î¶² ºÎºÐÀ» ¼öÁ¤À» Çß´ÂÁö¿¡ ´ëÇÑ ¸ðµç ¼Ò½ºÀÇ ·Î±×°¡ ³²°í °£´ÜÈ÷ ¿¹Àü ¹öÀüÀ¸·Î ·Ñ¹éµµ °¡´ÉÇϱ⠶§¹®¿¡ »ç¿ëÇÏ½Ã¸é ¸¹ÀÌ Æí¸®ÇÑ Á¡ÀÌ ¸¹½À´Ï´Ù.

¿©·¯¸íÀ̼­ ÀÛ¾÷À» ÇÏ°Ô µÇ´Â ÇÁ·ÎÁ§Æ®¿¡¼­µµ Áߺ¹µÇÁö ¾Ê±â À§Çؼ­ ÆÄÆ®¸¦ ³ª´©¾î ÀÛ¾÷Àº ÇÏ°ÚÁö¸¸, °øÅëÆÄÀϵéÀº Ç×»ó Àֱ⠸¶·ÃÀÔ´Ï´Ù. À̶§µµ ³»°¡ ÀÛ¾÷ÇÏ´Â ÆÄÀÏ¿¡ ´ëÇÏ¿© Lock¸¦ °É¾î µÎ¾î ´Ù¸¥ »ç¶÷ÀÌ ¾÷µ¥ÀÌÆ® ÇÏ´Â °ÍÀ» ¹æÁöÇÒ ¼öµµ ÀÖ½À´Ï´Ù.

±×·³ CentOS¿¡¼­ SVNÀ» ¼³Ä¡ÇÏ´Â ¹æ¹ý¿¡ ´ëÇؼ­ ¾Ë¾Æº¸°Ú½À´Ï´Ù.
CentOSÀÇ À¯ÀÏÇÑ ¹«±â yumÀ» ÀÌ¿ëÇÏ¿© ¼³Ä¡¸¦ ÇÏ°Ô µË´Ï´Ù.

 # yum install subversion


±×¸®°í SVNÀÇ µ¥ÀÌÅ͸¦ ÀúÀåÇÒ µð·ºÅ丮¸¦ »ý¼ºÇÕ´Ï´Ù.

 # mkdir /home/svn


±×·¯¸é SVN¿¡ ÇϳªÀÇ repository¸¦ »ý¼ºÇÏ°Ú½À´Ï´Ù.

 # cd /home/svn
 # svnadmin create repo-tasks


ÀÚ, ±×·¯¸é »ý¼ºÇÑ repository´Â /home/svn µð·ºÅ丮¾È¿¡ repo-tasks¶ó´Â µð·ºÅ丮°¡ »ý¼ºµÈ °ÍÀ» º¼ ¼ö ÀÖ½À´Ï´Ù.

ÀÌÁ¦ ¼³Á¤ ºÎºÐÀ» È®ÀÎÇϵµ·Ï ÇÏ°Ú½À´Ï´Ù.

/home/svn/repo-tasks/conf µð·ºÅ丮 ¾È¿¡´Â ¼³Á¤ÆÄÀϵéÀÌ Á¸ÀçÇÕ´Ï´Ù.

1. svnserve.conf ¼öÁ¤

 # vi /home/svn/repo-tasks/conf/svnserve.conf


³»¿ëÀ» º¸½Ã¸é ³ë¶õ»ö ºÎºÐÀ» ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ÇÕ´Ï´Ù.

 ### This file controls the configuration of the svnserve daemon, if you
 ### use it to allow access to this repository.  (If you only allow
 ### access through http: and/or file: URLs, then this file is
 ### irrelevant.)
 
 ### Visit http://subversion.tigris.org/ for more information.
 
 [general]
 ### These options control access to the repository for unauthenticated
 ### and authenticated users.  Valid values are "write", "read",
 ### and "none".  The sample settings below are the defaults.
 anon-access = none
 auth-access = write
 ### The password-db option controls the location of the password
 ### database file.  Unless you specify a path starting with a /,
 ### the file's location is relative to the conf directory.
 ### Uncomment the line below to use the default password file.
 password-db = passwd
 ### The authz-db option controls the location of the authorization
 ### rules for path-based access control.  Unless you specify a path
 ### starting with a /, the file's location is relative to the conf
 ### directory.  If you don't specify an authz-db, no path-based access
 ### control is done.
 ### Uncomment the line below to use the default authorization file.
 #authz-db = authz
 ### This option specifies the authentication realm of the repository.
 ### If two repositories have the same authentication realm, they should
 ### have the same password database, and vice versa.  The default realm
 ### is repository's uuid.
 realm = Tasks Repository


anon-access = none          -> ¾ÕÀÇ #(ÁÖ¼®)À» Á¦°ÅÇÕ´Ï´Ù.
auth-access = write           -> ¾ÕÀÇ #(ÁÖ¼®)À» Á¦°ÅÇÕ´Ï´Ù.
password-db = passwd     -> ¾ÕÀÇ #(ÁÖ¼®)À» Á¦°ÅÇÕ´Ï´Ù.
realm = Tasks Repository   -> Repository ¸íÀ» ÀÔ·ÂÇÕ´Ï´Ù.

2. passwd ¼öÁ¤

  # vi /home/svn/repo-tasks/conf/passwd


³ë¶õ»ö ºÎºÐ°ú °°ÀÌ »ç¿ëÀÚ¸¦ Ãß°¡ÇÕ´Ï´Ù.

 ### This file is an example password file for svnserve.
 ### Its format is similar to that of svnserve.conf. As shown in the
 ### example below it contains one section labelled [users].
 ### The name and password for each user follow, one account per line.
 
 [users]
 # harry = harryssecret
 # sally = sallyssecret
 svnuser = svnpass


Á¢¼ÓÇÏ·Á´Â »ç¿ëÀÚ¸¦ ID = PASS ·Î Ãß°¡ÇÏ½Ã¸é µË´Ï´Ù.

±×·³ SVN µ¥¸óÀ» ½ÇÇàÇÕ´Ï´Ù. ±×¸®°í SVNÀÌ »ç¿ëÇÏ°í ÀÖ´Â 3690 Æ÷Æ®¸¦ iptable¿¡¼­ ¿­¾î µÓ´Ï´Ù.

 # svnserve -d -r /home/svn/
 #  vi /etc/sysconfig/iptables


iptable ÆÄÀÏ ³»¿¡ ¾Æ·¡¿Í °°Àº ºÎºÐÀ» Ãß°¡ÇÕ´Ï´Ù.

 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT


±×¸®°í ÀúÀå ÈÄ ³ª¿Í¼­ iptable¸¦ Àç ½Ãµ¿ÇÕ´Ï´Ù.

 # /etc/init.d/iptables restart


ÀÚ À̷μ­ SVNÀÇ ¼³Ä¡°¡ ¿Ï·áµÇ¾ú½À´Ï´Ù.