Debian / Kali under Subversion configuration

20,190,624 recorded

Originally intended to directly engage in subversion with Nginx, and then found nginx does not support, like the lack of support for what dav

So do with apache, then use nginx reverse proxy

Installation no longer remember, the computer comes with nginx and apache, subversion can be installed with apt

Operating system Kali2

First, configure Subversion

First configure subversion, svn protocol at least be able to run up and say the next step

I put the library built in the / srv / svn directory

A project to be put into / srv / svn / demo1 inside to create the directory does not say

Command svnadmin create / srv / svn / demo1 after completing construction

Other options I use less than this is enough

Then modify the configuration, add users, set permissions

1, we /srv/svn/demo1/conf/svnserve.conf

anon-access = none of this is to set the default anonymous user permissions are set to read-only read is none that prohibit access
auth-access = write this is to set permissions for user authentication will certainly have to be written is set to write

password-db = passwd this is to set authentication password authentication is generally enough passwd file this password is stored in plain text file that is under the same directory

authz-db = authz this is the same as with the above set permissions

2, we / srv / svn / demo1 / conf / passwd

In [Users] Add the following line of the recording format of a user <user name> = <password>

3, we / srv / svn / demo1 / conf / AuthZ

I admit that I'm lazy I add at the bottom of a

[/]

admin = rw

* = r

Means that the root directory permissions

admin user privileges to read and write

Other user permissions to read-only

Here the user must have in passwd '

 

After configuring svnserve start over

Command svnserve -d -r / srv / svn / demo1

-d background -r specified directory

If you have a firewall to open port 3690

The software then through the svn: // <your IP address> / svn protocol to access do not support the browser browser

Enter your username and password if successful, can do the next step

Second, configure Apache2

My system comes with apache2, but has no built-svn support, you need to download

apt install libapache2-mod-svn

After Bahrain in apache2 directory / etc / apache2 of mods-enabled which should have several files

authz_svn.load

dav_svn.conf

dav_svn.load

If not, then go to mods-available inside to see if any come softlinks

Then edit dav_svn.conf

Note that I listed only place I modify or add a comment that is released
<the Location / svn>
  DAV svn
  SVNParentPath / SRV / svn
  SVNListParentPath ON Note that this line is I added
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile / etc / apache2 / dav_svn.passwd Note that this file you need to create your own
  AuthzSVNAccessFile /etc/apache2/dav_svn.authz Notice that the file you need to create your own
  the require the User-! Valid
</ the Location>
the following is what I add the
<Directory "/ SRV / svn">
  AllowOverride None
  Options None
  the allow the Order, the deny
  the Allow All from
  Satisfy All
</ Directory>

After he saved

Then configure user

htpasswd -c /etc/apache2/dav_svn.passwd <user name>

Then let you enter the password twice

If we add users do not have the -c option

htpasswd /etc/apache2/dav_svn.passwd <user name>

this is OK

Configuring Permissions

we /etc/apache2/dav_svn.passwd

[demo1:/]
admin = rw
* = r

In fact, here and subversion of the same rights

Because I svn apache2 configuration in which the root directory is not that there is no direct demo1 write [/]

Here apache2 configuration also completed

Restart apache2 service

service apache2 restart

If the error is not configured correctly

Browser to open http: // localhost: 81 / svn

After authentication should be displayed

Collection of Repositories

  • demo1/

Powered by Apache Subversion version 1.10.4 (r1850624).

Here apache2 configuration is complete

 

Third, configure Nginx to forward Apache

Because I think it's easily 80 with nginx is also used to nginx apache then put into the port 81

apache port arranged inside /etc/apache/ports.conf

Modify Listen 81

Nginx modify configuration files

vi /etc/nginx/sites-enabled/default

Add inside server segment

    location /svn {
        proxy_pass http://localhost:81;
    }

I pay attention to the default document is not changed the default

His website root directory / var / www / html

He listens on port 80

His server_name is _ is to underscore

Start nginx Service

service nginx restart

Then use the browser to visit http: // localhost / svn

If the effect is just 81 and port access so as to complete the configuration

Guess you like

Origin www.cnblogs.com/panther1942/p/11078506.html