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