Web SVN repository to efficiently manage multiple projects

Go: https: //www.jianshu.com/p/a0af00642585
use of the program

Linux+Apache+Subversion+MySQL+JDK+Tomcat+Svnadmin

Contents
0. Installation Preparation

0.1 System Upgrade Package
0.2 Close the SELinux
0.3 Installation wget

1. Deploy Apache

1.1 install apache
1.2 modify the configuration file
1.3 start apache service
1.4 adjust the firewall to allow port 80 access
1.5 browser to access test

2. deploy Subversion

2.1 installed SVN
2.2 restart apache service
2.3 Checking svn module is installed on the apache
2.4 View svn version
2.5 SVN repository configuration

2.5.1 Creating SVN repository home directory
2.5.2 edit the configuration file subversion.conf
2.5.3 Creating /data/svn/passwd.http and / svn / authz file
2.5.4 restart apache service

3. Deploy MySQL

3.1 Installing MySQL
3.2 mysql at startup
3.3 start mysql service
3.4 Adjusting the firewall to allow access to port 3306
3.5 set the root password for mysql database

4. Deploy Tomcat

4.1 install the JDK
4.1.1 download the installation package
4.1.2 extract the package
4.1.3 modify environment variables
4.1.4 to make the configuration take effect immediately
4.1.5 verify that the entry into force
4.2 install Tomcat
4.2.1 download the installation package
4.2.2 decompress apache- tomcat package
4.2.3 tomcat modify configuration files
4.2.4 to adjust the firewall to allow access to the port is 8080
4.2.5 restart the firewall, the port configuration to take effect

5. Deploy jsvnadmin

5.1 Delete the default file tomcat / webapps directory
5.2 download package svnadmin
5.3 unzip the package svnadmin
5.4 will svnadmin.war extract to svnadmin directory tomcat / webapps in
5.5 modify the default account password jdbc connection properties files in the mysql svnadmin

6. initialize the database svnadmin

6.1 svnadmin create a database
6.2 import sql file (mysql5.sql and en.sql)
6.3 start tomcat service

7. browser access, the initial configuration
8. replenishing portion

8.1 View new directories, files, and configuration parameters authz
8.2 configuration repository directory permissions
8.3 Configuring rc.local let tomcat start automatically start the service
8.4 km rights of "authentication failure" problem

Scenes

SVN Internet small company just starting a project when usually only one project, this time, only need to deploy a single database on the server to provide services to meet the needs of the beginning of operation and maintenance personnel only need to manually configure the warehouse at the command line, new entry to change to change passwd and authz configuration file to add an account and be able to get permission, but with the company's growing stronger R & D team getting larger and larger, more and more number of people, projects modular, distributed, SOA as a service, and more At the same time project development, testing, and so on-line publishing, operation and maintenance personnel hands full, old nothing, has been completely unable to meet demand, and how to do it? Work in high efficiency, multi-play ideas, operation and maintenance personnel to seek faster and more convenient way to solve the problem, then it must be service oriented approach, and by way of management WEB UI, little mouse can easily get.

Jsvnadmin emergence changed the original method in the past pure command line or a script, it is the user of a Java development project management Svn server web applications. Svn server installed good, the Svn Admin deployed, you can manage Svn items via a web browser, user rights management projects, management projects. Configuration management enables easy Svn, each time to no longer need to manually modify the server configuration file.

svnadmin advantage

Multi-database: Svn project configuration data stored in the database, support for all database (default MySQL / Oracle / SQL Server)

Multi-OS: Support Window, Linux and other operating systems.
Access control: Administrators can assign permissions casual, project administrators can manage the project members, members can only view and modify their own passwords.
Support multi-project, multi-user, multi-user group Group (default with a "Project Management Group", "project development team", "project test group").
Security: password protected and encrypted.
Multi-protocol: supports svn protocol and http protocols (from 2.0 begins supporting Apache server - - single-mode library from Apache 3.0 supports multiple database start mode)
repository browsing (starting from 3.0.2)
Multi-language (3.0.2 from the beginning)

solution

Svnadmin in Java 1.6, Tomcat 6, Subversion 1.6, MySQL 5.1, Apache 2.2, Windows 7 development through testing, and support other operating systems and databases.

Program often used:
Linux + the Apache + MySQL + Tomcat + Subversion + svnadmin
Windows + the Apache + MySQL + Tomcat + Subversion + svnadmin
support svn protocol
configuration information Svn are authz in the conf directory of the warehouse, passwd, svnserve.conf three files, configure users and permissions are by modifying passwd and authz, take effect immediately. Svn Admin is the essence of these three file management, all members of the authority's data are stored in the database, modify Svn Admin once on the page, it will put the information output to that three configuration files in the conf .
Support http protocol
There are two ways to configure the Apache + SVN success:

Multi-database way: SVNParentPath specify a parent directory, all warehouses in the parent directory, using a password file, and a rights profile. The advantage is increased to delete the warehouse do not need to change the apache httpd.conf, no need to restart Apache. The disadvantage is that many projects will be very confusing.
Single Library ways: SVNPath each warehouse to configure their own password and access to the file alone. The advantage is each separately, do not affect each other, and easy maintenance. The disadvantage is added or deleted after the warehouse need to modify the httpd.conf restart the apache.

0.5 Installation Preparation
OS: CentOS6.8 x64
0.1 upgrade system software package
[root @ example00 ~] # yum -y update

0.2 关闭SELinux
[root@example00 ~]# vim /etc/sysconfig/selinux
SELINUX=disabled

0.3 安装wget
[root@example00 ~]# yum -y install wget

After the preparatory work done, reboot command to restart the server
1. Deploy the Apache
1.1 to install the Apache
[root @ example00 ~] # yum -y install httpd httpd-devel

1.2 Modify Profile
[example00 the root @ ~] Vim /etc/httpd/conf/httpd.conf #
276 ServerName localhost: 80

1.3 start apache service
at startup
[root @ example00 ~] # chkconfig httpd on

Start apache service
[root @ example00 ~] # service httpd start

1.4 adjusting the firewall to allow access to port 80
[example00 the root @ ~] # Vim / etc / sysconfig / iptables
-A State --state the INPUT NEW -m -m -p TCP TCP 80 --dport -j ACCEPT
[the root ~ @ example00 ] # service iptables restart

1.5 browser to access: HTTP: //192.168.1.190
the Apache welcome page appears

apache welcome page

2. Deployment the Subversion
2.1 install SVN
[example00 the root @ ~] # -Y yum the install the mod_dav_svn Subversion

2.2 restart apache service
[root @ example00 ~] # service httpd restart

2.3 Check svn module is installed on the Apache
[example00 the root @ ~] # LS / etc / the httpd / modules / | grep svn
mod_authz_svn.so.
Mod_dav_svn.so

View svn version 2.4
[root @ example00 ~] # svn --version
svn, Version 1.6.11 (r934486)
Compiled Aug 17 2015, 08:37:43

2.5 Configuring SVN repository
2.5.1 SVN repository home directory created
multi-mode library, a configuration file to manage multiple libraries
[root @ example00 ~] # mkdir -p / data / svn #

2.5.2 编辑配置文件subversion.conf
[root@example00 ~]# cd /etc/httpd/conf.d/
[root@example00 conf.d]# ls
README subversion.conf welcome.conf
[root@example00 conf.d]# vim subversion.conf
#Include /data/svn/httpd.conf

DAV svn
SVNListParentPath on
SVNParentPath /data/svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /data/svn/passwd.http
AuthzSVNAccessFile /data/svn/authz
Require valid-user

RedirectMatch ^(/svn)$ $1/

2.5.3 Creating /data/svn/passwd.http and / svn / authz file
[root @ example00 conf.d] # Touch /data/svn/passwd.http
[root @ example00 conf.d] # Touch / the Data / svn / authz

2.5.4 restart apache service
[root @ example00 conf.d] # service httpd restart

3. Deployment the MySQL
3.1 install the MySQL
[example00 the root @ ~] # yum the install MySQL -Y-Server MySQL MySQL-devel

3.2 mysql at startup
[root @ example00 ~] # chkconfig mysqld on

3.3 start mysql service
[root @ example00 ~] # service mysqld start

3.4 Adjusting the firewall to allow access to port 3306
[example00 the root @ ~] # Vim / etc / sysconfig / iptables
-A State --state the INPUT NEW -m -m -p TCP TCP --dport 3306 -j ACCEPT

[root@example00 ~]# service iptables restart

3.5 Set mysql database root password
[root @ example00 ~] # mysqladmin -u root password 'mypassword'

3.5 authorized remote access to root account MySQL
[root @ example00 the conf.d] -u root -p # MySQL
MySQL> the ON the GRANT ALL PRIVILEGES . The TO 'root' @ '%' the IDENTIFIED BY 'mypassword' the WITH the GRANT the OPTION;
Query the OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

4. Deploy Tomcat
4.1 JDK installation

Download: http: //www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

4.1.1 download the package
[example00 the root @ ~] # CD / usr / local / the src /
[the root @ example00 the src] # wget http://download.oracle.com/otn-pub/java/jdk/8u121-b13 /e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz

4.1.2 extract the package
[the root @ example00 the src] # -zxvf JDK the tar-8u121-Linux-x64.tar.gz -C / usr / local /
[the root @ example00 the src] # CD /usr/local/jdk1.8.0 _121 /
[root @ example00 jdk1.8.0_121] # pwd
/usr/local/jdk1.8.0_121

4.1.3 修改环境变量
[root@example00 ~]# vim /etc/profile
# Java_Home
JAVA_HOME=/usr/local/jdk1.8.0_121
JRE_HOME=/usr/local/jdk1.8.0_121/jre
PATH=\(PATH:\)JAVA_HOME/bin:\(JRE_HOME/bin CLASSPATH=:\)JAVA_HOME/lib/dt.jar:\(JAVA_HOME/lib/tools.jar:\)JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH

4.1.4 configuration to take effect immediately
[root @ example00 ~] # source / etc / profile

4.1.5 test whether the entry into force
method 1:
[root @ example00 ~] # the Java -version
the Java Version "1.7.0_131"
the OpenJDK Runtime Environment (x86_64 RHEL-2.6.9.0.el6_8-U131-B00)
the OpenJDK-64-Bit Server VM ( build 24.131-b00, mixed mode)

方法2:
[root@example00 ~]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/jdk1.8.0_121/bin:/usr/local/jdk1.8.0_121/jre/bin:/root/bin
[root@example00 ~]# echo $JRE_HOME
/usr/local/jdk1.8.0_121/jre
[root@example00 ~]# echo $JAVA_HOME
/usr/local/jdk1.8.0_121

4.2 install Tomcat

Download: http: //tomcat.apache.org/download-70.cgi
found in Core tar.gz, right copy link

4.2.1 download the package
[example00 the root @ ~] # CD / usr / local / the src /
[the root @ example00 the src] # wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7 .0.76 / bin / apache-tomcat- 7.0.76.tar.gz

4.2.2 解压缩apache-tomcat软件包
[root@example00 src]# tar -zxvf apache-tomcat-7.0.76.tar.gz -C /usr/local/
[root@example00 src]# cd /usr/local/
[root@example00 local]# mv apache-tomcat-7.0.76/ tomcat

4.2.3 Review the tomcat profile
increases as the end parameter URIEncoding. 8-UTF
[the root @ example00 the src] Vim /usr/local/src/svnadmin-tomcat/conf/server.xml #
22 is
71 <Connector port="8080" protocol="HTTP/1.1"
72 connectionTimeout="20000"
73 redirectPort="8443" URIEncoding="UTF-8"/>

4.2.4 adjust the firewall to allow access to the port is 8080
[the root @ example00 the src] # Vim / etc / sysconfig / iptables
-A State --state the INPUT NEW -m -m -p TCP TCP --dport 8080 -j ACCEPT

4.2.5 restart the firewall, the port configuration to take effect
[root @ example00 src] # service iptables restart

5. Installation jsvnadmin

Download link
https://code.google.com/archive/p/jsvnadmin/
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jsvnadmin/svnadmin-3.0. 5.zip

5.1 Delete the default file tomcat / webapps directory
[root @ example00 ~] # rm -rf / usr / local / tomcat / webapps / *

5.2 download svnadmin package
[root @ example00 ~] # cd / usr / local / src /
[root @ example00 webapps] # wget https://storage.googleapis.com/google-code-archive-downloads/v2/code. google.com/jsvnadmin/svnadmin-3.0.5.zip

5.3 Unzip svnadmin package
[root @ example00 src] # svnadmin the unzip svnadmin-3.0.5.zip -d
[root @ example00 src] # cd svnadmin

5.4 svnadmin.war extract to svnadmin directory tomcat / webapps in
[root @ example00 svnadmin] # unzip svnadmin.war -d / usr / local / tomcat / webapps / svnadmin

The default account password svnadmin 5.5 modify the jdbc connection properties file in the mysql
[root @ example00 svnadmin] # vim /usr/local/tomcat/webapps/svnadmin/WEB-INF/jdbc.properties
db = MySQL

#MySQL
MySQL.jdbc.driver=com.mysql.jdbc.Driver
MySQL.jdbc.url=jdbc:mysql://127.0.0.1:3306/svnadmin?characterEncoding=utf-8
MySQL.jdbc.username=root
MySQL.jdbc.password=mypassword

6. initialize the database svnadmin
6.1 svnadmin create database
[root @ example00 ~] # MySQL -u root -p
MySQL> svnadmin the CREATE DATABASE CHARACTER the SET utf8;
Query the OK, 1 Row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| svnadmin |
| test |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye

6.2 sql import file (mysql5.sql and en.sql)
[the root @ example00 the svnadmin] -u # MySQL the svnadmin the root -p </usr/local/src/svnadmin/db/mysql5.sql
[@ example00 the svnadmin the root] # MySQL -u root -p svnadmin </usr/local/src/svnadmin/db/lang/en.sql

6.3 启动tomcat服务
[root@example00 ~]# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8.0_121/jre
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

7. browser access, the initial configuration
browser to access: http: //192.168.1.190: 8080 / svnadmin /
page Tip: Welcome to the SVN ADMIN, for the first time, please set the administrator account and password.
Enter the username / password, that is, svnadmin is the default WEB login account password, you need to save up, so as not to forget.

SVN ADMIN initial page

In the SVN ADMIN WEB page, you can see the project configuration management, change history in the past by the cumbersome management svn command line on Linux Server, and use WEB GUI configuration mode, can greatly improve the management efficiency SVN repository;
in WEB page on SVN ADMIN SVN repository not only new projects, but also for different projects, accounts, account group configuration, management rights, is ideal for medium type, or small Internet company to manage;

Create a library .png

Submitted successfully

8. complementary part
8.1 to view new directories, files, and configuration parameters authz
[example00 the root @ ~] # CD / Data / the svn /
[the root @ example00 the svn] LS #
authz Project1 the httpd.conf passwd.http

/ data / svn directory, has produced a catalog ddstore, and a file httpd.conf, it subversion.conf is the same that has been configured in /etc/httpd/conf.d/subversion.conf in.
[the root @ example00 the svn] the authz CAT #
[aliases]
[Groups]
ddstore_developer =
ddstore_manager =
ddstore_tester =

[ddstore:/]
@ddstore_manager=rw

View authz file can be found, the configuration of the content has been added; these changes are due to call svn to do the appropriate action.
8.2 directory permissions configuration repository
[example00 the root @ ~] # chown -R & lt apache.apache / Data / the svn / Project1 /
[the root ~ @ example00] -R & lt # the chmod 777 / Data / the svn / Project1 /

8.3 Configuration rc.local let tomcat start automatically start the service
[root @ example00 ~] # vim /etc/rc.local
#tomcat Auto Start
/usr/local/tomcat/bin/startup.sh

8.4 km rights of "authentication failure" problem
Cause: The admin project manager to join the group, and therefore the access rights management, authentication failure problems will arise;
Solution: Set User Group ---> User Settings - -> will be added to the management group admin

All of the deployment process has been completed, then we need to SVN ADMIN management page, review the state of the repository, click the repository URL link, view the status of the warehouse; the absence of any error messages that indicate the success of warehouse configuration, if an error, such as 405 information, etc., then that warehouse configuration is problematic, if you try to solve many times to no avail, you can contact me, I have free time can help you troubleshouting.

Click the link URL warehouse

Check warehouse status

Guess you like

Origin www.cnblogs.com/daixh/p/11330772.html