📜 ⬆️ ⬇️

We put SVN on FreeBSD. For Dummies

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

First install
Putting from the ports, it lies here $ cd / usr / ports / devel / subversion /
Put it this way: $ make the menu will open up for you, you can safely disable everything in it, especially if you don’t need a web presentation of the files (you can still install the handbook).
$ make install - and set.
can check how it fell: $ man svn

Second, start the demon
First we need a user, on behalf of whom we will run our SVN server. Everything is simple:
  $ 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 has been created, you must configure the startup script.
In /usr/local/etc/rc.d there will be a svnserve script, you do not need to edit it there, and so it is indicated that everything will run on behalf of the svn user, which we created above.
you can see that variables are used there, they need to be set in /etc/rc.conf
add rows
svnserve_enable = "YES" # so it will become a demon
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 did not forget to say anything and everything started!
whether the svn-server was started we looked so:
$ 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 more here

third, 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 # Unauthorized cannot watch and do nothing at all
auth-access = write # Authorized users will be able to write to the sv repository
password-db = passwd # so we specify in which file we list the repository users.
Warning: do not allow parasitic spaces - SVN does not tolerate this.
editing /home/svn/test/conf/svnserve.conf is complete.
now edit the file / home / svn / test / conf / passwd
write something like
user = password
All our SVN is now ready for use! in TortoiseSVN, do checkout (with the right mouse button on any empty folder where you want to unload the repository) on svn: // yourdomain / test / - you must specify the repository.

If you did everything right, then you will have something like:
Command: Commit
Deleting: W: \ workFiles \ test \
Completed: At revision: 1
in general, everything is now possible to use this further explore the possibilities of TortoiseSVN.

if you wish, I will write about how we can upload files from the repository to the working folder of the server and at the same time give them the right owner
if you need to upload data from svn, you can do it like this:
svn ALL = (web) NOPASSWD: ALL
in order to overwrite files belonging to a group (web) when commiting
/ usr / bin / sudo -u user_name / usr / bin / svn update --username svn_user_name --password svn_user_password path / to / site / work / copy

Source: https://habr.com/ru/post/49496/


All Articles