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