Centos7 install SVN + HTTP
1. First install svn
yum install subversion
2. Install httpd
yum install httpd
3. Install the svn operation module of apache
yum install mod_dav_svnyum install openssl openssl-devel
4. view the svn version
svnserve –version
5. Create an svn version Library
svnadmin create /home/svn/project
6. Go to the svn conf folder.
cd /home/svn/project/conf
7. view the file list under the conf file
ls
Authz passwd svnserve. conf
8. Modify the authz File
view authz
The modified content is as follows:
Rw: readable and writable r: Read-only modification is complete. Press esc and then enter: wq. If an error occurs, force save the input: wq!
9. Modify the passwd file
view passwd
10. Modify svnserver. conf
First backup:cp svnserver.conf svnserver.conf.bak
Command:view svnserver.conf
Modification content:
11. After svn configuration is complete, start the svn command:svnserve -d -r /home/svn/project/View process:ps -aux|grep svnTry to import:svn import test svn://123.123.123.123/project/test -m "test" --force-log
Tip: The test folder must exist in the current directory to try the import. If it does not exist, run the command mkdir test.
12. start error, error content: authentication failed (skip this line if there is no such error) solution: Method 1: Check whether there is a space before the configuration in the three configuration files, for example:
Method 2: Modify the/root/. subversion/service configuration file.
When you modify store-plaintext-passwords = yes, the following message is displayed: because there are too many file contents, you must keep the cursor down to see all the file content! View the process: command:ps -aux|grep svnEnd the svn process:kill 11036Restartsvn:svnserve -d -r /home/svn/project/Or:systemctl start svnserver.serviceTry importing again:svn import test svn://123.123.123.123/project/test -m "test" --force-log
Tip: If there is no error, the import is successful.
13. Access svn through TortoiseSVN Repository Browser access address: svn: // 123.123.123.123/project
14. Configure httpd to enter the configuration Folder:cd /etc/httpd/conf/httpd.confFirst, back up the configuration file:cp httpd.conf httpd.conf.bak
15. Modify the httpd. conf file and add it at the end of the file:
<Location /svn> DAV svn SVNParentPath /home/svn/ # Authentication: Basic AuthName "Subversion repository" AuthType Basic AuthUserFile /etc/httpd/svn-auth.htpasswd # Authorization: Authenticated users only <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>
Prompt message:
"/Svn" in "<Location/svn>" indicates that the svn access URL is "http: // ip/svn ", "DAV svn" indicates that the "mod_dav_svn" module is used. dav is an http 1.1 extension protocol. mod_dav_svn is only an application of this Protocol. "SVNParentPath/var/svn" indicates the service "http: // ip/svn" request, use the corresponding content under the "/var/svn" path. AuthName indicates the authentication type of the prompt message when the user name and password are entered. Here we use the basic authentication type AuthUserFile to indicate the location of the authentication file. We will create it later. The limit10000t node indicates that user authentication is required only for write requests.
16. Create a svn-auth.htppasswd File
Command:Htpasswd-c-m/etc/httpd/svn-auth.htpasswd Username
For example:htpasswd –c -m /etc/httpd/svn-auth.htpasswd abcd
Enter the password twice as prompted!
17. Authorize apache users to the svn directory and execute the following three commands in sequence:
Command 1: usermod-a-G root apache command 2: chmod-R g + w/home/svn/project command 3: groups apache
18. Start apache
Command: systemctl start httpd. service
19. Start troubleshooting if an error occurs
Generally, ports are occupied. The default apache port is 80. Modify the listening port to modify the httpd. conf configuration file and set it to 9999 to restart apache: systemctl restart httpd. service.
20. Access svn
Http: // 123.123.123.123: 9999/svn/project/enter the User name: abcd password :******
21. Add AN httpd User:
Command: htpasswd/etc/httpd/svn-auth.htpasswd abcd
Enter the password twice and prompt that the password is successfully added!