Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Installation and configuration under Linux SVN server - Backup - Recovery - Scheduled Tasks     - Linux user status query, and to unlock locked user (Linux)

- Virtual Judge environment to build and configure under Ubuntu (Server)

- Ubuntu 15.04 installed JDK and configured as the default JDK (Linux)

- Upgrading from Fedora 20 to 21 (Linux)

- Default permissions Linux file and directory permissions and hide - umask, chattr, lsattr, SUID, SGID, SBIT, file (Linux)

- Linux atomic operations and synchronization mechanisms (Programming)

- Mhddfs: multiple smaller partitions into one large virtual storage (Linux)

- CentOS 6.5 configuration SSDB 1.8.0 (Server)

- Linux Shell introduces (Linux)

- Normal start Lazarus 1.0.8 under Ubuntu (Linux)

- Understand ASP.NET 5 running the command: DNVM, DNX, and DNU (Server)

- SUSE Firewall Configuration (Linux)

- Unable to start the network after restart clone a virtual machine (Linux)

- Make full use of the Raspberry Pi SD card space (Linux)

- Introduces Linux kernel compilation system and compiler installation (Linux)

- What is Java EE (Programming)

- Installation and configuration to compile MySQL 5.6.10 under CentOS 5.9 (Database)

- OpenStack package problems and solutions under CentOS6 (Linux)

- Learning UNIX good habits (Linux)

- 3 ways to create a lightweight, durable system of Ubuntu Linux USB disk (Linux)

 
         
  Installation and configuration under Linux SVN server - Backup - Recovery - Scheduled Tasks
     
  Add Date : 2017-08-31      
         
         
         
  Summary:
SVN is Subversion short, is an open source version control system, compared to the RCS, CVS, it uses the branch management system, which is designed to replace CVS. Many Internet service from the CVS version control migration to Subversion.
Operation mode
svn server has two operating modes: standalone servers and means of apache running. Two methods have advantages and disadvantages, the user can choose.

First, install the svn

# Yum install subversion-1.6.11-7.el5_6.4 mysql-server httpd mod_dav_svn mod_perl sendmail wget gcc-c ++ make unzip perl * ntsysv vim-enhanced
subversion-1.6.11-7.el5_6.4 (SVN server, the version number)
mysql-server (for codestriker)
httpd mod_dav_svn mod_perl (to support the WEB management of SVN server)
sendmail (mail reminder is used to configure the user submits the code later)
wget gcc-c ++ make unzip perl * (prerequisite package)
ntsysv vim-enhanced (optional)
Second, the basic configuration

1. Create a directory to store all the files in SVN

# Mkdir / data / svn
# Cd / data /
2, a new version of the warehouse

# Svnadmin create / data / svn / project
3, the version in the repository initialization

# Mkdir project project / server project / client project / test // create a temporary directory, the directory for developers to upload data directory
# Svn import project file: /// data / svn / project -m "initialization"
# Rm -rf project // delete the project file you just created, as it has been initialized to the svn repository
4, adding users

# Vim / data / svn / project / conf / passwd
[Users]
# Harry = harryssecret
# Sally = sallyssecret
admin = 123456 // account is admin password is 123456 (SVN account password is in plain text, do not support http cipher text, there will be explained below)
5, modify user access policies

# Vim / data / svn / project / conf / authz // record the user's access policy, the following reference:
[Groups]
[/]
admin = rw
* = * = // Indicated above, in addition to set up the authority of the user group, no one else be prevented from accessing the catalog. This is very important, we must add!
6, modify svnserve.conf file, specify the password and policy documents.

# Vim svnserve.conf
[General]
anon-access = none
auth-access = write
password-db = / data / svn / project / conf / passwd
authz-db = / data / svn / project / conf / authz
7, start the server

# Svnserve -d -r / data / svn
NOTE: If you modify the configuration of the svn, svn need to restart the service, follow these steps:

# Ps -aux | grep svnserve
# Kill -9 ID number
# Svnserve -d -r / data / svn
8, the test server (not through web yet tested)

# Svn co svn: //192.168.5.10/project
 
Authentication realm: d72f34c5-d386-4d19-bc8b-9e5192737eee
Password for 'root': // Direct Enter
Authentication realm: d72f34c5-d386-4d19-bc8b-9e5192737eee
Username: admin // username
// Just passwd password in settings: Password for 'admin'

-------------------------------------------------- ---------------------
! ATTENTION Your password for authentication realm:

    d72f34c5-d386-4d19-bc8b-9e5192737eee

can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-------------------------------------------------- ---------------------
Store password unencrypted (yes / no)? Yes
A project / test
A project / server
A project / client
Checked out revision 1.
Third, the SVN server configuration of HTTP support can start clicking httpd test

1, set the apache svn access permission, or do not have permission to read data is apache svn under

# Chown -R apache: apache / data / svn /
Then we convert SVN server password, since SVN server password is the plaintext, HTTP server does not support it needs to be converted into a format supported by HTTP.

2. Create the SVN support apache account password

# Touch passwd
# Htpasswd -c / data / passwd admin // create the user admin, and set a password
# Cat passwd >> / data / svn / project / conf / passwd
# Vim / data / svn / project / conf / passwd // plaintext comment admin account
#admin = admin
3, add the following content in apache configuration file to support SVN Service

# Vim /etc/httpd/conf/httpd.conf
 

DAV svn
SVNPath / data / svn / project /
AuthType Basic
AuthName "svn for project"
AuthUserFile / data / svn / project / conf / passwd
AuthzSVNAccessFile / data / svn / project / conf / authz
Satisfy all
Require valid-user

Restart svn, httpd service
# Ps -ef | grep svnserve
# Kill -9 3994
# Svnserve -d -r / data / svn
# Service httpd restart
4, the client test

So using the Windows svn client or browser testing

Browser Test: http: //192.168.5.10/project

Windows client test:

Installation TortoiseSVN -----> Right-click on the desktop -----> TortoiseSVN -----> repository browser (R) -----> http://192.168.5.10/project-- ---> account password -----> OK

Note: Enter the account number or password on it (the password for the http format supported by non-explicit)

Fourth, add and delete the repository

First httpd stopped, give passwd add a plain text user, set permissions authz

 # Service httpd stop
Stopping httpd: [OK]
# Vim / data / svn / project / conf / passwd
:
:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
#admin = 123456
test = test
admin: uyvcrbGbdBPuk
:
:
# Vim / data / svn / project / conf / authz
:
:
[Groups]
[/]
admin = rw
test = rw
* =
:
:
# Ps -ef | grep svn
root 4032 1 0 15:14? 00:00:00 svnserve -d -r / data / svn
root 25723 3556 0 16:35 pts / 1 00:00:00 grep svn
# Kill -9 4032
# Svnserve -d -r / data / svn
# Svn ls svn: //192.168.5.10/project
Authentication realm: d72f34c5-d386-4d19-bc8b-9e5192737eee
Password for 'admin':
Authentication realm: d72f34c5-d386-4d19-bc8b-9e5192737eee
Username: test
Password for 'test':

-------------------------------------------------- ---------------------
! ATTENTION Your password for authentication realm:

    d72f34c5-d386-4d19-bc8b-9e5192737eee

can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-------------------------------------------------- ---------------------
Store password unencrypted (yes / no)? Yes
client /
server /
test /
# Svn delete svn: //192.168.5.10/progect/client -m "delete"
svn: No repository found in 'svn: //192.168.5.10/progect/client'
# Svn delete svn: //192.168.5.10/project/client -m "delete"

Committed revision 2.
# Svn delete svn: //192.168.5.10/project/server -m "delete"

Committed revision 3.
# Svn delete svn: //192.168.5.10/project/test -m "delete"

Committed revision 4.
# Svn mkdir -m "UP" svn: //192.168.5.10/project/union

Committed revision 5.
# Svn mkdir -m "UP" svn: //192.168.5.10/project/wangyi

Committed revision 6.
# Vim / data / svn / project / conf / passwd
[Users]
# Harry = harryssecret
# Sally = sallyssecret
#admin = 123456
test = test
admin: uyvcrbGbdBPuk

# Ps -ef | grep svn
root 25725 1 0 16:35? 00:00:00 svnserve -d -r / data / svn
root 25759 3556 0 16:40 pts / 1 00:00:00 grep svn
# Kill -9 25725
# Svnserve -d -r / data / svn
# Service httpd start
Starting httpd: [OK]
Copy the code
Upload the file to the svn repository file directory file is a backup file to other servers

# Export LANG = "zh_CN.GB2312" // file name has Chinese when you need to set the variables
# Svn import / data / file / file: /// data / svn / project / file --message "init"
# Svn import / data / file / svn: /// data / svn / project / file --message "init" // two commands are the same
Five, SVN backup and restore (two backup mode)

1, hotcopy backup:
# Svnadmin hotcopy / data / svn / project / data / bakup / `date + /% y% m% d` / --clean-logs // use svnadmin overall backup / data / svn / project to / data / bakup / directory and at the time named in
2, dump backup:
# Svnadmin dump / data / svn / project> / data / beifen / `date + /% Y% m% d`.bak // recommend this method to back up, the following is modeled by way dump
Six, Ben collapse simulation server (in the case of a backup file of the case, restored to a new server)

# Rm -rf / data / svn / *
# Ps -ef | grep svn
# Kill -9 26221
# Svnadmin create / data / svn / ceshi
# Export LANG = en_US
# Svnadmin load / data / svn / ceshi # Cat / data / passwd >> / data / svn / ceshi / conf / passwd
[Users]
admin: uyvcrbGbdBPuk
# Vim / data / svn / ceshi / conf / authz
 
[Groups]
[/]
admin = rw
* =
# Vim /data/svn/ceshi/conf/svnserve.conf
[General]
anon-access = none
auth-access = write
password-db = / data / svn / ceshi / conf / passwd
authz-db = / data / svn / ceshi / conf / authz
# Vim /etc/httpd/conf/httpd.conf
 
 
< Location / ceshi>
DAV svn
SVNPath / data / svn / ceshi /
AuthType Basic
AuthName "svn for ceshi"
AuthUserFile / data / svn / ceshi / conf / passwd
AuthzSVNAccessFile / data / svn / ceshi / conf / authz
Satisfy all
Require valid-user
< / Location>
 
# Service httpd restart
# Svnserve -d -r / data / svn
Test is successful recovery
http://192.168.5.10/ceshi
Seven automatic full backup script

 # Vim svn.pl
 
#! / Usr / bin / perl -w
my $ svn_repos = "/ data / svn / project";
my $ backup_dir = "/ data / backup / svn /";
my $ next_backup_file = "svn" .`date +% Y% m% d`;

$ Youngest = `svnlook youngest $ svn_repos`;
chomp $ youngest;

print "Backing up to revision $ youngest";
my $ svnadmin_cmd = "svnadmin dump --revision $ youngest $ svn_repos> $ backup_dir / $ next_backup_file";
`$ Svnadmin_cmd`;
open (LOG, "> $ backup_dir / last_backed_up"); the version number of the backup record #
print LOG $ youngest;
close LOG;
# If you want to save space, and then execute the following script compression
#print "Compressing dump file ... n";
#print `gzip -9 $ backup_dir / $ next_backup_file`;
Three days ago Delete backup files

# Vim svn-Timing-delete.sh
find / data / backup / svn / -type f -mtime +3 -exec rm '{}' \;
Add to Scheduled Tasks

# Crontab -e
30 22 * * * perl /data/svn/svn.pl
00 23 * * * bash /data/svn/svn-Timing-delete.sh
     
         
         
         
  More:      
 
- Ubuntu study notes and related problem solving (Linux)
- Simple and fast sorting (Programming)
- Binary tree traversal recursive and non-recursive (cyclic) traversal achieve (Programming)
- CentOS 6.6 command-line automatic completion (Linux)
- Storm how to assign tasks and load balancing (Programming)
- Java proxy mode (Programming)
- DRBD Principle and Features Overview (Server)
- Linux crontab command format example (Linux)
- GitHub multiplayer co-development configuration (Linux)
- VMware virtual machine to install CentOS 6.2 (Linux)
- Ubuntu treated with cue file to ape and wav files automatically track points (Linux)
- GRUB how to load Linux kernel (Linux)
- C ++ virtual functions Classic Insights (Programming)
- Linux resource restriction level summary (Linux)
- Experience CoreCLR stack unwinding characteristics of initial implementation on Linux / Mac (Linux)
- How do you temporarily emptied Bash environment variable before running the command on Linux (Linux)
- Deep understanding of C # generics (Programming)
- Install Mac OS X 10.9 systems VMware10 (Linux)
- How to manage KVM virtual environments with command-line tools in Linux (Server)
- Resolve the host via KVM console can not connect clients (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.