Explanation:
SVN (subversion) operates in two ways:
One is based on Apache's http and https web access forms;
There is also a standalone server model based on svnserve.
SVN also has two data storage methods: one is to store data in the Berkeley DB database; the other is to use ordinary file FSFS to store data.
Because the Berkeley DB method may lock data during use, it is generally recommended to use the FSFS method to be more secure.
achieved goals:
In the independent server mode of svnserve, use the FSFS data storage mode to compile, install, and configure the SVN server.
Specific operation:
Operating system: CentOS 6.x
Server IP: 192.168.21.134
First, close SELINUX
vi / etc / selinux / config
# SELINUX = enforcing #comment out
# SELINUXTYPE = targeted #Commented out
SELINUX = disabled #Increase
: wq! #Save and exit
setenforce 0 #Make the configuration take effect immediately
Second, open the firewall port
Svnserve-based standalone server mode, default port is 3690
vi / etc / sysconfig / iptables #Edit firewall configuration files
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
* filter
: INPUT ACCEPT [0: 0]
: FORWARD ACCEPT [0: 0]
: OUTPUT ACCEPT [0: 0]
-A INPUT -m state --state ESTABLISHED, RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
: wq! #Save and exit
service iptables restart #Finally restart the firewall for the configuration to take effect
Third, install the compilation toolkit
yum install apr * autoconf automake bison cloog-ppl compat * cpp curl curl curl-devel fontconfig fontconfig-devel freetype freetype * freetype-devel gcc gcc-c ++ gtk + -devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng * libjpeg * libsepol-devel libselinux-devel libstdc ++-devel libtool libtool * libgomp libxml2 libxml2-devel libXpm * libtiff libtiff * libX * make mpfr ncurses * ntp openssl openssl-devel patch pcre-devel perp common php-gd policycoreutils ppl telnet t1lib t1lib * nasm nasm * wget zlib-devel zlib unzip perl-ExtUtils-Embed
yum remove apr apr-util subversion subversion-libs #Remove the original svn and dependent packages in the system
Fourth, download the dependent packages required by svn
Note: Install the required packages for svn: apr apr-util serf scons openssl
Package storage directory: / usr / local / src
1.Download apr
https://dist.apache.org/repos/dist/release/apr/apr-1.5.2.tar.gz
2.Download apr-util
https://dist.apache.org/repos/dist/release/apr/apr-util-1.5.4.tar.gz
3.Download scons
http://prdownloads.sourceforge.net/scons/scons-2.3.5.tar.gz
4. Download openssl
http://www.openssl.org/source/openssl-1.0.1o.tar.gz
5.Download serf
http://fossies.org/linux/www/serf-1.3.8.tar.gz
Download svn
http://www.apache.org/dist/subversion/subversion-1.8.13.tar.gz
Download sqlite-amalgamation
http://www.sqlite.org/snapshot/sqlite-amalgamation-201506201411.zip
Five, install SVN
1.Install apr
cd / usr / local / src #Enter the package storage directory
tar zxvf apr-1.5.2.tar.gz #decompress
cd apr-1.5.2 #Enter the installation directory
./configure --prefix = / usr / local / apr #Configure
make #compile
make install #install
2.Install apr-util
cd / usr / local / src
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --with-apr = / usr / local / apr / bin / apr-1-config
make
make install
3.Install scons
cd / usr / local / src
tar zxvf scons-2.3.5.tar.gz
cd scons-2.3.5
python setup.py #Configuration
install #install
4, install openssl
cd / usr / local / src
tar zxvf openssl-1.0.1o.tar.gz
cd openssl-1.0.1o
CFLAGS = -fPIC ./config --prefix = / usr / local / openssl enable-shared
make
make install
vi / etc / profile #Add system environment variables
export PATH = $ PATH: / usr / local / openssl / bin
: wq! #Save and exit
source / etc / profile #Make the configuration take effect
ln -s / usr / local / openssl / include / openssl / usr / include / openssl #Add system soft link
5.Install serf
cd / usr / local / src
tar zxvf serf-1.3.8.tar.gz
cd serf-1.3.8
scons PREFIX = / usr / local / serf APR = / usr / local / apr / bin / apr-1-config APU = / usr / local / apr / bin / apu-1-config OPENSSL = / usr / local / openssl
scons install
cd / usr / local / serf / lib
cp libserf-1.so * / usr / local / lib / #Copy files to the system directory
6.Install svn
cd / usr / local / src
tar zxvf subversion-1.8.13.tar.gz
cd subversion-1.8.13
mkdir /usr/local/src/subversion-1.8.13/sqlite-amalgamation #create sqlite-amalgamation directory
cd / usr / local / src
unzip sqlite-amalgamation-201506201411.zip -d /usr/local/src/subversion-1.8.13/sqlite-amalgamation
#Unzip the sqlite-amalgamation package to the sqlite-amalgamation directory
./configure --prefix = / usr / local / svn --with-apr = / usr / local / apr / bin / apr-1-config --with-apr-util = / usr / local / apr / bin / apu-1-config --with-serf = / usr / local / serf --with-openssl = / usr / local / openssl --enable-mod-activation #Configuration
make #compile
make install #install
vi / etc / profile #Add system environment variables to the last line
export PATH = $ PATH: / usr / local / svn / bin
: wq! #Save and exit
source / etc / profile #Make the configuration take effect immediately
whereis libexpat.so.1 #Find the file installation directory, as follows:
libexpat.so: /lib/libexpat.so.0 /usr/local/lib/libexpat.so /usr/local/lib/libexpat.so.1
vi /etc/ld.so.conf #Edit the directory added to libexpat.so.1
/ usr / local / lib /
: wq! #Save and exit
ldconfig #Make the configuration effective
7. Test whether the installation was successful:
svn help #View svn help information
svnserve --version #View svn version information
svn --version
Six, configure svn
1.Create svn code base
mkdir -p / home / svn #create directory
svnadmin create / home / svn #Create svn code base
#After the above command is executed, the svn library will be automatically created. The / home / svn folder contains conf, db, format, hooks, locks, README.txt and other files.
#Description The svn code base was created successfully.
Configure the svn code base
cd / home / svn / conf #Enter the configuration file storage directory
vi /home/svn/conf/svnserve.conf #Configure the global file, add the following code at the end
[general]
anon-access = none #Forbid anonymous access, set to none. The default is read, parameters: read, write, none
auth-access = write #Authorize user write permissions
password-db = passwd #User account password file path, you can write an absolute path
authz-db = authz #Access control permissions file path, you can write the absolute path
realm = svn #The authentication life of each SVN project will be displayed in the authentication prompt. It is recommended to write the project name.
: wq! #Save and exit
vi / home / svn / conf / passwd #Configure user password
[users]
# harry = harryssecret
# sally = sallyssecret
osyunwei = 123456
test = 123456
test2 = 123456
: wq! #Save and exit
vi / home / svn / conf / authz #Configure permissions control files, set directories that users can access
[groups]
adm = osyunwei
user = test, test2
[/]
@adm = rw
* = r
: wq! #Save and exit
# [/] Represents all resources in the root directory
3.Start svn
svnserve -d -r / home / svn --listen-port 3690
ps -ef | grep svn | grep -v grep #View the svn process
root 12538 1 0 14:40? 00:00:00 svnserve -d -r / home / svn
netstat -ln grep 3690 #check svn port
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
killall svnserve #shut down the svn service
4, set the svn service to start
vi /etc/init.d/svn #Edit, add the following code
#! / bin / sh
# chkconfig: 2345 85 85
# processname: svn
svn_port = 3690
svn_home = / home / svn
if [! -f "/ usr / local / svn / bin / svnserve"]
then
echo "svnserver startup: cannot start"
exit
fi
case "$ 1" in
start)
echo "Starting svnserve ..."
/ usr / local / svn / bin / svnserve -d -r $ svn_home --listen-port $ svn_port
echo "Successfully!"
;;
stop)
echo "Stoping svnserve ..."
killall svnserve
echo "Successfully!"
;;
restart)
$ 0 stop
$ 0 start
;;
*)
echo "Usage: svn {start | stop | restart}"
exit 1
esac
: wq! #Save and exit
chmod + x /etc/init.d/svn #Add execute permission
chkconfig svn on #Enable self-start
5.Test svn
svn checkout svn: //192.168.21.134/ --username = osyunwei --password = 123456 #Download the file to a local directory
svn update --username = osyunwei --password = 123456 #Update the repository after the last modification
Seven, use the client to connect to the svn server
System operation and maintenance www.osyunwei.com Warm reminder: original content of system operation and maintenance © Copyright, please indicate the source and original link for reprinting
TortoiseSVN is a free and open source SVN (subversion) client for Windows.
TortoiseSVN download address: http://tortoisesvn.net/downloads.html
The latest version is: TortoiseSVN 1.8.11, which distinguishes between 32-bit and 64-bit operating systems, and provides Chinese finished packages.
As shown below:
After the installation is complete, desktop-right-click and select TortoiseSVN-Repository Browser
as follows:
CentOS 6 source code compilation installation and configuration SVN server tutorial-centos7 build svn server
URL input: svn: //192.168.21.134/
Enter username: osyunwei
Password: 123456
Checked: Save authentication
determine
You can see the content on the svn server. After right-clicking, you can choose to create a folder and other operations.