Install SVN on Fedora 9

来源:互联网 发布:python与数据分析 编辑:程序博客网 时间:2024/05/17 02:36

Today I installed SVN 1.5.1 to a VM server running on Fedora 9 in the company.

 

I chose to install SVN mod + apache. There are mainly 3 steps in installing it:

 

1, install apache 2.2.x on Fedora

   Fedora is installed with apache, so what I needed to do is just startthose services and unblock 80 ports from the firewall:


    #service network start

    #service httpd start

    #service iptables stop

 

    afterfinish this steps, I can see the apache testing page on another machineby typing the address of that machine(192.168.0.36)

 

2, install SSL on Fedora

    Fedora is installed with SSL by default.

 

3, install SVN mod on Fedora

  a,install SVN system

    #yum install --enablerepo=updates-testing mod_dav_svn //this is to install the most updated svn mod, I chose this because I might use the merge trace in the future.

    #mkdir /var/svnroot                      //create the root diretory to store svn repositories

    #svnadmin create TestingRepo    //create the first repository in svnroot

    #chown -R apache:apache /svnroot //change the owner of svnroot to apache to avoid permission issues

    change the subversion.conf under /etc/httpd/conf.d

    set the SVNParentPath to /var/svnroot/

    #service httpd restart  //restart apache service

 

 

   By now, SVN should be working and is public to anonymous users.However, when connect to the server from another machine, we got erroron reading format file. By searching on the internet I found this issuecould be caused by selinux. Modify /etc/selinux/config to disableSelinux and take a reboot.

 

   Now SVN is up and can be connected from another machine.


 b,create account and disable anonymous access

    change subversion.conf to require valid user.

    change subversion.conf to require SSL connection.

    change subversion.conf to set the password file to /etc/svn-auth-file

 

    use the following command to create user in password file (use -cm instead of -m for the first user)

    #htpasswd -m svn-auth-file username

   

    Now SVN server is only accessible to authorized account.

 

 c,create access level control

    change subversion.conf to set the AuthzSVNAccessFile to /etc/svn-auth-access-file

    then in svn-auth-access-file create content of the following format:

        [projectname:path]

        username=permission

    for example

        [TestingRepo:/]

        user1=rw

        user2=r

        *=

   now, user1 can read and write to TestingRepo project, user2 can onlyread the project, and all other(*) are not accessible to the project

 

 

And that was the steps I used to Create a SVN server on Fedora 9.