A simple description of how to build an SVN server in a virtual machine CentOS.
Software version Information
Vmware 10.0.0 build-1295980
CentOS 7.0-1406-x64
Java 1.7.0_67_x64
Suberverson 1.7.14
GNU Wget 1.14
Software Installation Subversion
install subversion
Choose the first option when you need to select one
Wget
For downloading Java
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.rpm"
The entire command is a row, you should note when copying and pasting
Where the final double quotes are the JDK you need (this article downloads the version of JDK 1.7.0_67 in RPM format)
Attached: further content see Oracle official website Download old version jdk + how to command line under wget download JDK, author lovelace521
Java
1. Before installing Oracle Java, ensure that there is no built-in JDK (i.e. OpenJDK) in the current system.
java -version
If the Java version is not output, the current system does not have a built-in JDK
2, if any, then first uninstall
[root@localhost ~]# rpm -qa | grep javatzdata-java-2012c-1.el6.noarchjava-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64
To uninstall OPENJDK, perform the following actions:
[root@localhost ~]# rpm -e --nodeps tzdata-java-2012c-1.el6.noarch[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64
3. Install Oracle Java
Java files for running edits
If no parameters are specified, wget downloaded files are located in the current folder
Move the JDK to the appropriate directory
Execute the following command:
rpm -ivh jdk-7-linux-i586.rpm
JDK is installed by default in/usr/java
Verifying the installation
java -version
Configuring Subversion
1. Build the SVN root directory
[root@vm-moodle ~]# mkdir -p /opt/svn/
2. Establish a Data warehouse:
[root@vm-moodle ~]# mkdir -p /opt/svn/edu/ [root@vm-moodle ~]# svnadmin create opt/svn/edu/
3. Modify the configuration file
View Data Warehouse Files directory
[[email protected] ~]# cd/opt/svn/edu/conf/[[email protected] conf]# ll total 24-rw-r--r--1 root root 710 10-25 09:40 authz-rw-r--r--1 root root 325 10-25 09:38 passwd-rw-r--r--1 root root 1449 10-25 09: 36 svnserve.conf
Modify the service configuration
[[email protected] conf]# vi svnserve.conf [general] anon-access = none #不允许匿名访问 auth-access = write #认证用户可写 password-db = passwd #密码文件 authz-db = authz #用户验证文件 [[email protected] conf]# vi authz [edu:/] hansy = rw
Add a user to the Edu repository with writable permissions
[root@vm-moodle conf]# vi passwd hansy = 87827192
The password can be either an encrypted password or a clear text, depending on the previous configuration to determine
Note that there can be no spaces before configuring content
Java
Modify the System environment variable file
vi + /etc/profile
Append the following content to the file:
JAVA_HOME=/usr/java/jdk1.7.0_67JRE_HOME=/usr/java/jdk1.7.0_67/jrePATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binCLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libexport JAVA_HOME JRE_HOME PATH CLASSPATH
Make the changes effective
source /etc/profile //使修改立即生效
View System Environment Status
[root@localhost ~]# echo $PATH/usr/lib/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/jdk1.7.0_45/bin:/usr/java/jdk1.7.0_45/jre/bin:/home/ckb/bin
Using the virtual machine CentOS
1. Start the SVN service and specify the SVN root directory
[root@vm-moodle ~]# svnserve -d -r /opt/svn/
The default SVN service uses port 3690 and, if required, appends "-listen-port specified port" to the command.
2. Check if the service is normal
[root@vm-moodle ~]# netstat -tunlp | grep svn tcp 0 0 0.0.0.0:3690 0.0.0.0:* EN 3970/svnserve
3. Import data to SVN repository
[root@vm-moodle ~]# svn import Hello file:///opt/svn/edu/project -m "Initial import"
Where Hello is a folder under the current directory
Client
1. Install TORTOISVN on a host outside the client or virtual machine
2. Tortoisesvn-repo-browser, enter the IP address of the svn://virtual machine CentOS
Frequently asked questions in CentOS 7 command not found
The CentOS 7 system rejects some of the instructions and has
ssifconfig, 改为 ipiptables, 改为 systemctl
If you want to continue using iptables, follow these steps:
1, Disable Firewalld Service.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl mask firewalld
2, Stop Firewalld Service.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl stop firewalld
3, Install iptables service related packages.
[root@rhel-centos7-tejas-barot-linux ~]# yum -y install iptables-services
4. Make sure service starts at boot:
[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable iptables
If you don't want ip6tables, you can skip following command
[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable ip6tables
5, now, Finally let's start the iptables services.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl start iptables
6. If you don't want ip6tables, you can skip following command.
[root@rhel-centos7-tejas-barot-linux ~]# systemctl start ip6tables
Attached: see Rhel 7/centos 7:disable Firewalld and use iptables
Access to SVN server, no answer
1. SVN Configuration File Error
Careful examination, wrong troubleshooting
2. SVN service port is not open
See if the Svnserve service is started
[root@vm-moodle ~]# ss -ntlp
If it has been started, set up a firewall, open the service corresponding port
[root@vm-moodle ~]# iptables -I INPUT -p tcp --dport 3690 -j ACCEPT #开放3690端口[root@vm-moodle ~]# service iptables save #保存配置,非常重要 [root@vm-moodle ~]# service iptables restart # 重启防火墙服务[root@vm-moodle ~]# service iptables status # 查看状态
Apply SVN (Build SVN server in CentOS)