Linux配置svn,测试了,好用,但是还没有钩子自动更新的那部分,

InstallationInstall Subversion as shown below.

root@server ~]# yum install -y subversion mod_dav_svn

If you haven’t install apache already the above command will install it respectively.Configure Subversion

Open the subversion config file‘/etc/httpd/conf.d/subversion.conf’and edit as follows.

[root@server ~]# vi /etc/httpd/conf.d/subversion.confLoadModule dav_svn_module   modules/mod_dav_svn.soLoadModule authz_svn_module  modules/mod_authz_svn.so##Add the following lines ##<Location /svn>DAV svnSVNParentPath /var/www/svnAuthType BasicAuthName "Subversion repositories"AuthUserFile /etc/svn-auth-usersRequire valid-user</Location>## containing Subversion repositories, "/var/www/svn". Each repository# must be both:##  a) readable and writable by the 'apache' user, and##  b) labelled with the 'httpd_sys_content_t' context if using#  SELinux## Example configuration to enable HTTP access for a directory

Now create a new user for Subversion called“sk”for instance.

[root@server ~]# vi /etc/httpd/conf.d/subversion.conf[root@server ~]# htpasswd -cm /etc/svn-auth-users skNew password:Re-type new password:Adding password for user sk

Create and configure Subversion RepositoryCreate a directory for subversion repository under‘/var/www/’directory.

[root@server ~]# mkdir /var/www/svn[root@server ~]# cd /var/www/svn/[root@server svn]# svnadmin create ostechnix_repo[root@server svn]# chown -R apache.apache ostechnix_repo/

Note:If you enabled SELinux, run the following commands to change the SELinux context security.

[root@server svn]# chcon -R -t httpd_sys_content_t /var/www/svn/ostechnix_repo/[root@server svn]# chcon -R -t httpd_sys_rw_content_t /var/www/svn/ostechnix_repo/

Make sure that you have opened the apache default port’80′through iptables.

[root@server svn]# vi /etc/sysconfig/iptables-A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT

Restart the iptables to save the changes.

[root@server svn]# /etc/init.d/iptables restartiptables: Flushing firewall rules:             [ OK ]iptables: Setting chains to policy ACCEPT: filter     [ OK ]iptables: Unloading modules:                [ OK ]iptables: Applying firewall rules:             [ OK ]

Start/Restart Apache

[root@server svn]# /etc/init.d/httpd startStarting httpd:                      [ OK ][root@server svn]# chkconfig httpd on

注意:在这一步要是出现Could not open the requested SVN filesystem问题解决方法http://www.deego.co.jp/wp/?p=18Test SubversionFire up your terminal and enter the following URLhttp://ip-address/svn/ostechnix_repoin the address bar. Enter the username and password of Subversion user which you have created earlier.Now you will get the Subversion repository home page.Disable anonymous accessIf you want to disable the anonymous user to access the repository, just edit the following line in‘ostechnix_repo/conf/svnserver.conf’file.

[root@server ~]# vi /var/www/svn/ostechnix_repo/conf/svnserve.conf## Line no 12 - Uncomment and Change to 'none' ##anon-access = none## Line No 27 - Uncomment to enable acess control ##authz-db = authz

Create additional links(directories) under Subversion Repository.Create some sample directories in any place and import them to your Subversion repository.

[root@server ~]# mkdir subversion-templates[root@server ~]# cd subversion-templates/[root@server subversion-templates]# mkdir softwares[root@server subversion-templates]# mkdir updates[root@server subversion-templates]# mkdir fixes

Now import the sub directories using the command‘svn import’.

[root@server ~]# svn import -m 'Initial import' subversion-templates/ http://192.168.1.200/svn/ostechnix_repo/Adding     subversion-templates/updatesAdding     subversion-templates/softwaresAdding     subversion-templates/fixesCommitted revision 2.

Now check for the changes in your repository.Now your newly created directory structure will be listed under your main repository. Thats it.而它的种子,就是它生命的延续,继续承受风,

Linux配置svn,测试了,好用,但是还没有钩子自动更新的那部分,

相关文章:

你感兴趣的文章:

标签云: