I configured SVN today and keep it in mind: 1 download svn package and dependency package cdmydatasoftwgethttp: labsmopcomapache-mirrorsubversionsubversion-177targzwgethttp: archiveapacheorgdist
The SVN configuration is recorded here:
1. download the svn software package and dependency package
cd /mydata/softwget http://labs.mop.com/apache-mirror/subversion/subversion-1.7.7.tar.gzwget http://archive.apache.org/dist/apr/apr-util-1.5.1.tar.gzwget http://archive.apache.org/dist/apr/apr-1.4.6.tar.gzwget http://www.sqlite.org/sqlite-amalgamation-3071401.zip
2. install the dependent package tar zxvf apr-1.4.6.tar.gz
Cd apr-1.4.6/
./Configure -- prefix =/usr/local/apr
Make & make install
Cd ../
tar zxvf apr-util-1.5.1.tar.gzcd apr-util-1.5.1/./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/aprmake && make installcd ../
3. install svn
Note that SVN and sqlite are extracted and then installed.
tar xvf subversion-1.7.7.tar.gzunzip sqlite-amalgamation-3071401.zipmv sqlite-amalgamation-3071401 ./subversion-1.7.7/sqlite-amalgamationcd subversion-1.7.7./configure --prefix=/usr/local/svn --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --without-berkeley-db --with-sslmake && make installcd ..
4. modify environment variables
vi /etc/profile
Add at the beginning:
PATH=$PATH:/usr/local/svn/binexport PATH
It may take effect after you disconnect the current ssh connection and log on again.
5. check whether the installation is successful
svnserve --version
# If the following information is displayed, the installation is successful.
# Svnserve, version 1.7.7
6. enable the SVN port of the firewall
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 9999 -j ACCEPT
Save firewall settings
/etc/rc.d/init.d/iptables save
7. create the svn Library www
mkdir -p /var/svn/cd /var/svn/svnadmin create wwwcd www/conf/ls
# Display the configuration file of the current project
# Authz passwd svnserve. conf
8. configure version Library Information
Project configuration:
vi svnserve.conf
Modify: remove Annotator
[general]anon-access = noneauth-access = writepassword-db = passwdauthzauthz-db = authzrealm = www
Define version library access permissions:
# vi authz
Add:
[/]svnuser = rw[www]svnuser = rw
Set user password:
# vi passwd
Add:
svnuser = 123456
9. create a user to start svn
useradd svnpasswd svn
Press enter and enter the password twice.
Then set the user ownership to allow svn to access the version Library:
chown -R svn:svn /var/svn
10. start SVN
First, write a reminder:
The open svn root directory can only be the parent directory of the project repository.
10.1 start with a set account
# su svn -c "svnserve -d --listen-port 9999 -r /var/svn"
Note:
Su svn indicates to start svn as user svn
-D indicates running in daemon mode (running in the background)
-The default port of listen-port svn is 3690,999 9, which indicates port 9999 is used. you can replace it with the port you need. Note that the root permission is required to use ports lower than 1024.
-R/var/svn/www specify the root directory as/var/svn/
10.2 for a single code repository startup command:
# svnserve -d -r /var/svn/www --listen-host 22.21.50.17 –listen-port 9999
Note:
-D indicates running in the background,
-R: specify the root directory of the server,
In this way, you can directly use svn: // server ip address to access the server.
10.3 for multiple code repositories:
Open the SVN root directory through-r,
# svnserve -d -r /var/svn/ --listen-host 22.21.50.17 –listen-port 9999
When accessing the client, specify the repository directory to access each project, for example, svn: // 22.21.50.17: 9999/www.
10.4 if the following information is displayed, the startup is successful:
svn 6941 1 0 15:07 ? 00:00:00 svnserve -d -r /var/svn
10.5 start the SVN service with the root account
svnserve -d -r /var/svn/ --listen-host 22.21.50.17 --listen-port 9999
10.6 check whether startup is successful
ps -ef|grep svnserve
Finally Completed !!!
About: import and export SVN projects on the Linux server