Linux系统下搭建svnadmin服务详细步骤讲解

作者:yoodb来源:https://blog.yoodb.com/yoodb/article/detail/1518

Linux系统下搭建svnadmin服务详细步骤讲解

文章插图
 
svnadmin是一个JAVA开发的管理svn服务器的项目用户的web应用 。安装好svn服务器端把svnadmin.war部署至Tomcat,就可以通过web浏览器管理svn的项目,用户以及目录权限,使得管理配置svn简便,之后不需要每次都到服务器上手工修改配置文件 。下面具体讲述一下如何在linux系统下搭建svnadmin服务,借助于Nginx,tomcat等服务 。
【Linux系统下搭建svnadmin服务详细步骤讲解】安装MySQL,JDK,Tomcat,Nginx
安装Mysql — https://blog.yoodb.com/yoodb/article/detail/1517
安装JDK — https://blog.yoodb.com/yoodb/article/detail/209
安装Tomcat,Nginx — https://blog.yoodb.com/nikolatesla/article/detail/1439
1、安装httpd服务
1)安装Apache命令yum install httpd -y
2)安装完成后可以通过如下命令查看是否安装成功,命令httpd -version
[root@ecs-5a8d-0001 /]# httpd -versionServer version: Apache/2.4.6 (centos)Server built: Nov 5 2018 01:47:093)修改httpd服务端口号
...# Change this to Listen on specific IP addresses as shown below to# prevent Apache from glomming onto all bound IP addresses.##Listen 12.34.56.78:80Listen 83## Dynamic Shared Object (DSO) Support...4)httpd服务启动命令
[root@ecs-5a8d-0001 svn]# /bin/systemctl start httpd.service5)查看是否启动成功(访问) http://ip:port/
能打开页面显示“Testing 123... ”,表示httpd服务启动成功了 。
2、安装svn模型
1)在安装svn模型之前先关掉httpd服务:
[root@ecs-5a8d-0001 svn]# /bin/systemctl stop httpd.service2)安装svn模型命令yum install mod_dav_svn subversion -y
3)查看svn模型是否安装命令svnserve --version
[root@ecs-5a8d-0001 /]# svnserve --versionsvnserve, version 1.7.14 (r1542130) compiled Apr 11 2018, 02:40:28Copyright (C) 2013 The Apache Software Foundation.This software consists of contributions made by many people; see the NOTICEfile for more information.Subversion is open source software, see http://subversion.apache.org/The following repository back-end (FS) modules are available:* fs_base : Module for working with a Berkeley DB repository.* fs_fs : Module for working with a plain file (FSFS) repository.Cyrus SASL authentication is available.4)查看是否多出两个模型文件命令ls /etc/httpd/modules/ | grep svn
[root@ecs-5a8d-0001 /]# ls /etc/httpd/modules/ | grep svnmod_authz_svn.somod_dav_svn.so5)创建svn仓库主目录,并建根目录软连接
[root@ecs-5a8d-0001 svn]# mkdir -p /home/yoodb/svn[root@ecs-5a8d-0001 svn]# ln -s /home/yoodb/svn /6)创建subversion.conf
[root@ecs-5a8d-0001 svn]# vi /etc/httpd/conf.d/subversion.conf增加如下内容:
<Location /svn/> DAV svn SVNListParentPath on SVNParentPath /svn AuthType Basic AuthName "Subversion repositories" AuthUserFile /svn/passwd.http AuthzSVNAccessFile /svn/authz Require valid-user</Location>RedirectMatch ^(/svn)$ $1/3、安装svnadmin
svnadmin下载地址 — https://jsvnadmin.googlecode.com/files/svnadmin-3.0.5.zip ,解压后有svnadmin.war和db数据库文件
1)修改tomcat端口号和字符编码(否则svn页面操作无法输入中文),命令vi /home/yoodb/svnadmin/conf/server.xml,URIEncoding="UTF-8"
[root@ecs-5a8d-0001 svn]# vi /home/yoodb/svnadmin/conf/server.xml... Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 --> <Connector port="82" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool"...2)解压svnadmin-3.0.5.zip,将svnadmin.war包中jdbc.properties,提取到桌面,修改svnadmin的数据库信息 。
3)创建数据并导入数据mysql5.sql,en.sql
create database svnadmin default charset utf8 collate utf8_general_ci;4、配置nginx
server { listen 81; server_name localhost; location /svnadmin { proxy_pass http://127.0.0.1:82; proxy_read_timeout 150; } location /svn { proxy_pass http://127.0.0.1:83; proxy_read_timeout 150; }}5、分别启动httpd服务,tomcat服务和nginx服务
1)启动服务
[root@ecs-5a8d-0001 svn]# /bin/systemctl start httpd.service[root@ecs-5a8d-0001 svn]# /home/yoodb/svnadmin/bin/startup.sh[root@ecs-5a8d-0001 svn]# /usr/local/nginx/sbin/nginx/sbin/nginx2)访问地址
http://ip:port/svnadmin,如:http://192.168.0.1:81/svnadmin
第一次需要设置管理员账号和密码:自定义管理员账号和密码 。
 


推荐阅读