We put SVN on FreeBSD. For Dummies

    everything that will be written here for dummies, like me, who are still poorly versed in server administration, but want to put themselves SVN (the question of why is beyond the scope of this article). All that is written here is actually in the help svnbook.red-bean.com/nightly/ru/index.html

    First,
    we will install the installation from the ports, it lies here $ cd / usr / ports / devel / subversion / it
    is set like this: $ make you will see a menu, everything can be safely turned off in it, especially if you do not need a web presentation of files (hand book can still be installed).
    $ make install - and it will be delivered.
    you can check how it got up: $ man svn

    Second, launch the daemon
    First, we need a user on behalf of whom we will start our SVN server. Everything is simple here:
    $ adduser
    Username: svn
    Full name: subversion
    Uid (Leave empty for default):
    Login group [svn]: svn
    Login group is svn. Invite svn into other groups? []:
    Login class [default]:
    Shell (sh csh tcsh date bash rbash nologin) [sh]: nologin
    Home directory [/home/svn]:
    Home directory permissions (Leave empty for default):
    Use password-based authentication? [yes]: no
    Lock out the account after creation? [no]: yes
    Username   : svn
    Password   : <disabled>
    Full Name  : subversion
    Uid        : 1002
    Class      :
    Groups     : svn
    Home       : /home/svn
    Home Mode  :
    Shell      : /usr/sbin/nologin
    Locked     : yes
    OK? (yes/no): yes
    pw: group `svn' does not exist
    adduser: ERROR: There was an error adding user (svn).
    Add another user? (yes/no): no
    Goodbye!
    


    now that the user is created, you must configure the startup script
    in /usr/local/etc/rc.d the svnserve script will not need to be edited there and it is indicated that everything will be launched on behalf of the svn user that we created above.
    it can be seen that the variables are used there, you need to set them in /etc/rc.conf
    add the lines
    svnserve_enable = "YES" # so it becomes the daemon
    svnserve_data = "/ home / svn" # define the home directory
    now it’s time to start the server
    $ / usr / local / etc / rc.d / svnserve start
    I hope I didn’t forget to say anything and it all started!
    did the svn server start look like this:
    $ ps -ax | grep svn

    For Debian
    cd /etc/init.d/
    touch svnserve
    echo “sudo -u svn svnserve -d -r / home / svn /” >> svnserve
    chmod + x svnserve
    update-rc.d svnserve defaults
    read the third here

    , repository management.
    (I assume that you already have TortoiseSVN tortoisesvn.net/downloads installed )
    creating a test repository $ svnadmin create / home / svn / test /
    configure SVN users: /home/svn/test/conf/svnserve.conf in this file we uncomment the lines
    anon- access = none # Non-authorized can’t watch and do nothing at all
    auth-access = write # Authorized can write
    password-db = passwd # to the repository so we will indicate in which file we list users of the repository.
    Warning: Avoid spurious gaps - SVN is not tolerant of this.
    editing /home/svn/test/conf/svnserve.conf is finished.
    now we edit the file / home / svn / test / conf / passwd
    we write something like
    user = password
    everything is now our SVN is ready to use! in TortoiseSVN we do a checkout (right-click on any empty folder where you want to upload the repository) to svn: // yourdomain / test / - the repository is required.

    If you did everything right, then you will have something like:
    Command: Commit
    Deleting: W: \ workFiles \ test \
    Completed: At revision: 1
    in general, everything can now be used now; further explore the possibilities of TortoiseSVN.

    if I want, I’ll write about how to upload files from the repository to the server’s working folder and at the same time give them the right owner.
    If you need to upload data from under svn, you can do this:
    svn ALL = (web) NOPASSWD: ALL
    to overwrite files belonging to the group (web)
    / usr / bin / sudo -u user_name / usr / bin / svn update --username svn_user_name --password svn_user_password path / to / site / work / copy

    Also popular now: