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