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