In this case We have a two machines Centos6.8 minimal version and Windows 7
In this article we can see how to configure Subversion Server on CentOS.
Step 1: Install Apache Webserver
; Before installing SVN packages, you must install Apache( Webserver ).
Type the below command to install Apache along with dependencies.
1)We can check version for Httpd in yum
# yum list httpd
httpd.x86_64 2.2.15-56.el6.centos.3 updates
2)We do install httpd daemon on Centos
# yum -y install httpd
3)We check httpd version after it was installed
[root@lux1 ~]# rpm -qa httpd
httpd-2.2.15-56.el6.centos.3.x86_64 |
4)In the wake of introducing Apache, begin Apache administration utilizing after charge and empower auto begin on framework reboot
# chkconfig httpd on
# service httpd start
Step 2: Add rules in Iptables and Selinux
# iptables -A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
# iptables -A INPUT -p tcp -m state --state NEW --dport 3690 -j ACCEPT
# iptables -A INPUT -p udp -m state --state NEW --dport 3690 -j ACCEPT
# service iptables save
# service iptables restart
# mkdir -p /var/www/svn/repos
# chcon -R -t httpd_sys_content_t /var/www/svn/repos/
# chcon -R -t httpd_sys_rw_content_t /var/www/svn/repos/
Step 3: Install SVN Server
[root@lux1 ~]# yum -y install subversion mod_dav_svn
1) Check svn version
We can see svn version as follow by
[root@lux1 ~]# svn --version
svn, version 1.6.11 (r934486) compiled Aug 17 2015, 08:37:43 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository access (RA) modules are available: * ra_neon : Module for accessing a repository via WebDAV protocol using Neon. - handles 'http' scheme - handles 'https' scheme * ra_svn : Module for accessing a repository using the svn network protocol. - with Cyrus SASL authentication - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme |
Step 4: Configure SVN Server
We are going to clean hash mark and save as like follow lines.
# vi /etc/httpd/conf.d/subversion.conf
26 <Location /repos> 27 DAV svn 28 SVNParentPath /var/www/svn/repos 29 # 30 # # Limit write permission to list of valid users. 31 # <LimitExcept GET PROPFIND OPTIONS REPORT> 32 # # Require SSL connection for password protection. 33 # # SSLRequireSSL 34 # 35 AuthType Basic 36 AuthName "Authorization Realm" 37 AuthUserFile /var/www/svn/users 38 Require valid-user 39 # </LimitExcept> 40 </Location> |
Step 5: Create SVN Repository
# cd /var/www/svn/repos
# svnadmin create kwangjin
# chown -R apache.apache kwangjin
Step 6: Create New User
# htpasswd -c /var/www/svn/users dennis
# htpasswd -m /var/www/svn/users steve
Step 7: Restart httpd daemon
# service httpd restart
# chkconfig httpd on
Step 8: Start svnserve daemon
# service svnserve start
Step 9: to set this script to run ‘start’ on server boot register the service:
# chkconfig --add svnserve
# chkconfig svnserve on
Step 10: Access Your Repository in Browser on Windows 7
http://192.168.8.128/repos/kwangjin
Step 11: We can apply authenticate prompt as user dennis
Step 12: Disable anonymous access on SVN Repository
We are going to edit the file /var/www/svn/repo/conf/svnserve.conf, the below two lines
# vi /var/www/svn/repos/kwangjin/conf/svnserve.conf
12 anon-access = none 13 auth-access = write 27 authz-db = authz |
Step 13: Import Project Directory’s Content to SVN repository
1)Let’s first create Sample Project Directory and its file.
[root@lux1 ~]# mkdir /app-project
[root@lux1 ~]# cd /app-project/
[root@lux1 app-project]# touch login.java login-ok.java
[root@lux1 app-project]# svn import -m "First SVN Repo" /app-project \
http://192.168.8.128/repos/kwangjin
Authentication realm: <http://192.168.8.128:80> Authorization Realm
Password for 'root': (Enter root password here)
Authentication realm: <http://192.168.8.128:80> Authorization Realm
Username: dennis
Password for 'dennis': (Enter dennis password here)
Adding /app-project/login-ok.java
Adding /app-project/login.java
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<http://192.168.8.128:80> Authorization Realm
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes
Committed revision 1.
Step 14: Check Out the Project
In my case i want to checkout the linuxproject on my ubuntu laptop using SVN command. So to perform checkout operations please make your system has subversion package installed, if not then use “apt-get install subversion” command to install required package.
[root@lux1 ~]# svn co http://192.168.8.128/repos/kwangjin/ /root/svn_data/ --username dennis
[root@lux1 ~]# cd svn_data/
[root@lux1 svn_data]# ls -l
-rw-r--r-- 1 root root 0 Feb 14 22:14 login.java -rw-r--r-- 1 root root 0 Feb 14 22:14 login-ok.java |
Step 15: Committing Changes
After making required changes in the project code , we can commit the changes to the SVN repos. In My case i have created one more file in linuxproject folder.
[root@lux1 ~]# cd /root/svn_data/
[root@lux1 svn_data]# pwd
/root/svn_data
[root@lux1 svn_data]# touch board.java
[root@lux1 svn_data]# svn add board.java --username dennis
A board.java
[root@lux1 svn_data]# svn commit -m "New file add" --username dennis
Adding board.java
Transmitting file data .
Committed revision 2.
Step 16: Install SVN Client for Windows
1) We can download TortoiseSVN follow site https://tortoisesvn.net/downloads.html
2) We can install typically method and reboot windows system.
3) We can create folder name is Projects on Desktop
4) Click "SVN Checkout..." right mouse on Projects folder.
5) Enter http://192.168.8.128/repos/kwangjin in URL of repository
6) Enter dennis in Username feild and password of dennis
Checkout from http://192.168.8.128/repos/kwangjin, revision HEAD, Fully recursive, Externals included C:\Users\Administrator\Desktop\Projects C:\Users\Administrator\Desktop\Projects\login-ok.java C:\Users\Administrator\Desktop\Projects\board.java C:\Users\Administrator\Desktop\Projects\login.java At revision: 2 |
7) Create directory name is JAVA-project in Project folder on your desktop
8) Move all files to JAVA-project
9) Click "SVN Commit..." right mouse in empty space.
10) Click ALL in Check fieid and OK
11) Check web browser http://192.168.8.128/repos/kwangjin
kwangjin - Revision 3: /
|
12) Click JAVA-project
kwangjin - Revision 3: /JAVA-project
|
13) Check on SVN server
# svn checkout http://192.168.8.128/repos/kwangjin
A kwangjin/JAVA-project A kwangjin/JAVA-project/login-ok.java A kwangjin/JAVA-project/board.java A kwangjin/JAVA-project/login.java Checked out revision 3. |
14) Open and Edit board.java file using Notepad on windows system.
Was modified by developers
15) Click "SVN Commit..." right mouse in empty space.
16) Click ALL in Check field and OK
17) Check web browser http://192.168.8.128/repos/kwangjin
Refer site:
http://www.techoism.com/how-to-configure-svn-server-on-centosrhel/
http://www.linuxtechi.com/install-apache-subversion-svn-centos-7/
http://www.geek-kb.com/install-svn-linux-centosrhel-6-x/