##// END OF EJS Templates
svn: add example path for mod_dav_svn.conf include.
marcink -
r4243:b0aa1ce9 stable
parent child Browse files
Show More
@@ -1,207 +1,208 b''
1 1 .. _svn-http:
2 2
3 3 |svn| With Write Over HTTP
4 4 ^^^^^^^^^^^^^^^^^^^^^^^^^^
5 5
6 6 To use |svn| with read/write support over the |svn| HTTP protocol, you have to
7 7 configure the HTTP |svn| backend.
8 8
9 9 Prerequisites
10 10 =============
11 11
12 12 - Enable HTTP support inside the admin VCS settings on your |RCE| instance
13 13 - You need to install the following tools on the machine that is running an
14 14 instance of |RCE|:
15 15 ``Apache HTTP Server`` and ``mod_dav_svn``.
16 16
17 17
18 18 .. tip::
19 19
20 20 We recommend using Wandisco repositories which provide latest SVN versions
21 21 for most platforms. If you skip this version you'll have to ensure the Client version
22 22 is compatible with installed SVN version which might differ depending on the operating system.
23 23 Here is an example how to add the Wandisco repositories for Ubuntu.
24 24
25 25 .. code-block:: bash
26 26
27 27 $ sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu `lsb_release -cs` svn110" >> /etc/apt/sources.list.d/subversion110.list'
28 28 $ sudo wget -q http://opensource.wandisco.com/wandisco-debian-new.gpg -O- | sudo apt-key add -
29 29 $ sudo apt-get update
30 30
31 31 Here is an example how to add the Wandisco repositories for Centos/Redhat. Using
32 32 a yum config
33 33
34 34 .. code-block:: bash
35 35
36 36 [wandisco-Git]
37 37 name=CentOS-6 - Wandisco Git
38 38 baseurl=http://opensource.wandisco.com/centos/6/git/$basearch/
39 39 enabled=1
40 40 gpgcheck=1
41 41 gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
42 42
43 43
44 44
45 45 Example installation of required components for Ubuntu platform:
46 46
47 47 .. code-block:: bash
48 48
49 49 $ sudo apt-get install apache2
50 50 $ sudo apt-get install libapache2-svn
51 51
52 52 Once installed you need to enable ``dav_svn`` on Ubuntu:
53 53
54 54 .. code-block:: bash
55 55
56 56 $ sudo a2enmod dav_svn
57 57 $ sudo a2enmod headers
58 58 $ sudo a2enmod authn_anon
59 59
60 60
61 61 Example installation of required components for RedHat/CentOS platform:
62 62
63 63 .. code-block:: bash
64 64
65 65 $ sudo yum install httpd
66 66 $ sudo yum install subversion mod_dav_svn
67 67
68 68
69 69 Once installed you need to enable ``dav_svn`` on RedHat/CentOS:
70 70
71 71 .. code-block:: bash
72 72
73 73 sudo vi /etc/httpd/conf.modules.d/10-subversion.conf
74 74 ## The file should read:
75 75
76 76 LoadModule dav_svn_module modules/mod_dav_svn.so
77 77 LoadModule headers_module modules/mod_headers.so
78 78 LoadModule authn_anon_module modules/mod_authn_anon.so
79 79
80 80 .. tip::
81 81
82 82 To check the installed mod_dav_svn module version, you can use such command.
83 83
84 84 `strings /usr/lib/apache2/modules/mod_dav_svn.so | grep 'Powered by'`
85 85
86 86
87 87 Configuring Apache Setup
88 88 ========================
89 89
90 90 .. tip::
91 91
92 92 It is recommended to run Apache on a port other than 80, due to possible
93 93 conflicts with other HTTP servers like nginx. To do this, set the
94 94 ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example
95 95 ``Listen 8090``.
96 96
97 97
98 98 .. warning::
99 99
100 100 Make sure your Apache instance which runs the mod_dav_svn module is
101 101 only accessible by |RCE|. Otherwise everyone is able to browse
102 102 the repositories or run subversion operations (checkout/commit/etc.).
103 103
104 104 It is also recommended to run apache as the same user as |RCE|, otherwise
105 105 permission issues could occur. To do this edit the ``/etc/apache2/envvars``
106 106
107 107 .. code-block:: apache
108 108
109 109 export APACHE_RUN_USER=rhodecode
110 110 export APACHE_RUN_GROUP=rhodecode
111 111
112 112 1. To configure Apache, create and edit a virtual hosts file, for example
113 113 :file:`/etc/apache2/sites-enabled/default.conf`. Below is an example
114 114 how to use one with auto-generated config ```mod_dav_svn.conf```
115 115 from configured |RCE| instance.
116 116
117 117 .. code-block:: apache
118 118
119 119 <VirtualHost *:8090>
120 120 ServerAdmin rhodecode-admin@localhost
121 121 DocumentRoot /var/www/html
122 122 ErrorLog ${'${APACHE_LOG_DIR}'}/error.log
123 123 CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined
124 124 LogLevel info
125 125 # allows custom host names, prevents 400 errors on checkout
126 126 HttpProtocolOptions Unsafe
127 # Most likely this will be: /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf
127 128 Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf
128 129 </VirtualHost>
129 130
130 131
131 132 2. Go to the :menuselection:`Admin --> Settings --> VCS` page, and
132 133 enable :guilabel:`Proxy Subversion HTTP requests`, and specify the
133 134 :guilabel:`Subversion HTTP Server URL`.
134 135
135 136 3. Open the |RCE| configuration file,
136 137 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini`
137 138
138 139 4. Add the following configuration option in the ``[app:main]``
139 140 section if you don't have it yet.
140 141
141 142 This enables mapping of the created |RCE| repo groups into special
142 143 |svn| paths. Each time a new repository group is created, the system will
143 144 update the template file and create new mapping. Apache web server needs to
144 145 be reloaded to pick up the changes on this file.
145 146 To do this, simply configure `svn.proxy.reload_cmd` inside the .ini file.
146 147 Example configuration:
147 148
148 149
149 150 .. code-block:: ini
150 151
151 152 ############################################################
152 153 ### Subversion proxy support (mod_dav_svn) ###
153 154 ### Maps RhodeCode repo groups into SVN paths for Apache ###
154 155 ############################################################
155 156 ## Enable or disable the config file generation.
156 157 svn.proxy.generate_config = true
157 158 ## Generate config file with `SVNListParentPath` set to `On`.
158 159 svn.proxy.list_parent_path = true
159 160 ## Set location and file name of generated config file.
160 161 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
161 162 ## Used as a prefix to the <Location> block in the generated config file.
162 163 ## In most cases it should be set to `/`.
163 164 svn.proxy.location_root = /
164 165 ## Command to reload the mod dav svn configuration on change.
165 166 ## Example: `/etc/init.d/apache2 reload`
166 167 svn.proxy.reload_cmd = /etc/init.d/apache2 reload
167 168 ## If the timeout expires before the reload command finishes, the command will
168 169 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
169 170 #svn.proxy.reload_timeout = 10
170 171
171 172
172 173 This would create a special template file called ```mod_dav_svn.conf```. We
173 174 used that file path in the apache config above inside the Include statement.
174 175 It's also possible to manually generate the config from the
175 176 :menuselection:`Admin --> Settings --> VCS` page by clicking a
176 177 `Generate Apache Config` button.
177 178
178 179 5. Now only things left is to enable svn support, and generate the initial
179 180 configuration.
180 181
181 182 - Select `Proxy subversion HTTP requests` checkbox
182 183 - Enter http://localhost:8090 into `Subversion HTTP Server URL`
183 184 - Click the `Generate Apache Config` button.
184 185
185 186 This config will be automatically re-generated once an user-groups is added
186 187 to properly map the additional paths generated.
187 188
188 189
189 190
190 191 Using |svn|
191 192 ===========
192 193
193 194 Once |svn| has been enabled on your instance, you can use it with the
194 195 following examples. For more |svn| information, see the `Subversion Red Book`_
195 196
196 197 .. code-block:: bash
197 198
198 199 # To clone a repository
199 200 svn checkout http://my-svn-server.example.com/my-svn-repo
200 201
201 202 # svn commit
202 203 svn commit
203 204
204 205
205 206 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
206 207
207 208 .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue No newline at end of file
@@ -1,94 +1,95 b''
1 1 # Auto generated configuration for use with the Apache mod_dav_svn module.
2 2 #
3 3 # WARNING: Make sure your Apache instance which runs the mod_dav_svn module is
4 4 # only accessible by RhodeCode. Otherwise everyone is able to browse
5 5 # the repositories or run subversion operations (checkout/commit/etc.).
6 6 #
7 7 # The mod_dav_svn module does not support subversion repositories which are
8 8 # organized in subfolders. To support the repository groups of RhodeCode it is
9 9 # required to provide a <Location> block for each group pointing to the
10 10 # repository group sub folder. To ease the configuration RhodeCode auto
11 11 # generates this file whenever a repository group is created/changed/deleted.
12 12 # Auto generation can be configured in the ini file. Settings are prefixed with
13 13 # ``svn.proxy``.
14 14 #
15 15 # To include this configuration into your apache config you can use the
16 16 # `Include` directive. See the following example snippet of a virtual host how
17 17 # to include this configuration file.
18 18 #
19 19 # <VirtualHost *:8090>
20 20 # ServerAdmin webmaster@localhost
21 21 # DocumentRoot /var/www/html
22 22 # ErrorLog ${'${APACHE_LOG_DIR}'}/error.log
23 23 # CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined
24 24 # LogLevel info
25 25 # # allows custom host names, prevents 400 errors on checkout
26 26 # HttpProtocolOptions Unsafe
27 # # Most likely this will be: /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf
27 28 # Include /path/to/generated/mod_dav_svn.conf
28 29 # </VirtualHost>
29 30 #
30 31 # Depending on the apache configuration you may encounter the following error if
31 32 # you are using special characters in your repository or repository group
32 33 # names.
33 34 #
34 35 # ``Error converting entry in directory '/path/to/repo' to UTF-8``
35 36 #
36 37 # In this case you have to change the LANG environment variable in the apache
37 38 # configuration. This setting is typically located at ``/etc/apache2/envvars``.
38 39 # You have to change it to an UTF-8 value like ``export LANG="en_US.UTF-8"``.
39 40 # After changing this a stop and start of Apache is required (using restart
40 41 # doesn't work).
41 42
42 43 # fix https -> http downgrade with DAV. It requires an header downgrade for
43 44 # https -> http reverse proxy to work properly
44 45 % if use_https:
45 46 RequestHeader edit Destination ^https: http: early
46 47 % else:
47 48 #RequestHeader edit Destination ^https: http: early
48 49 % endif
49 50
50 51 <Location "${location_root|n}">
51 52 # The mod_dav_svn module takes the username from the apache request object.
52 53 # Without authorization this will be empty and no username is logged for the
53 54 # transactions. This will result in "(no author)" for each revision. The
54 55 # following directives implement a fake authentication that allows every
55 56 # username/password combination.
56 57 AuthType Basic
57 58 AuthName "${rhodecode_realm|n}"
58 59 AuthBasicProvider anon
59 60 Anonymous *
60 61 Anonymous_LogEmail off
61 62 Require valid-user
62 63
63 64 DAV svn
64 65 SVNParentPath "${parent_path_root|n}"
65 66 SVNListParentPath ${"On" if svn_list_parent_path else "Off"|n}
66 67
67 68 # use specific SVN conf/authz file for each repository
68 69 #AuthzSVNReposRelativeAccessFile authz
69 70
70 71 Allow from all
71 72 Order allow,deny
72 73 </Location>
73 74
74 75 % for location, parent_path in repo_group_paths:
75 76
76 77 <Location "${location|n}">
77 78 AuthType Basic
78 79 AuthName "${rhodecode_realm|n}"
79 80 AuthBasicProvider anon
80 81 Anonymous *
81 82 Anonymous_LogEmail off
82 83 Require valid-user
83 84
84 85 DAV svn
85 86 SVNParentPath "${parent_path|n}"
86 87 SVNListParentPath ${"On" if svn_list_parent_path else "Off"|n}
87 88
88 89 # use specific SVN conf/authz file for each repository
89 90 #AuthzSVNReposRelativeAccessFile authz
90 91
91 92 Allow from all
92 93 Order allow,deny
93 94 </Location>
94 95 % endfor
General Comments 0
You need to be logged in to leave comments. Login now