##// END OF EJS Templates
docs: update docs on svn-http and mod-dav generation.
marcink -
r1585:9c528e45 default
parent child Browse files
Show More
@@ -1,138 +1,150 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 Using Ubuntu 14.04 Distribution as an example execute the following:
18 Using Ubuntu 14.04 Distribution as an example execute the following:
19
19
20 .. code-block:: bash
20 .. code-block:: bash
21
21
22 $ sudo apt-get install apache2 libapache2-mod-svn
22 $ sudo apt-get install apache2 libapache2-mod-svn
23
23
24 Once installed you need to enable ``dav_svn``:
24 Once installed you need to enable ``dav_svn``:
25
25
26 .. code-block:: bash
26 .. code-block:: bash
27
27
28 $ sudo a2enmod dav_svn
28 $ sudo a2enmod dav_svn
29 $ sudo a2enmod headers
29 $ sudo a2enmod headers
30 $ sudo a2enmod authn_anon
30 $ sudo a2enmod authn_anon
31
31
32
32
33 Configuring Apache Setup
33 Configuring Apache Setup
34 ========================
34 ========================
35
35
36 .. tip::
36 .. tip::
37
37
38 It is recommended to run Apache on a port other than 80, due to possible
38 It is recommended to run Apache on a port other than 80, due to possible
39 conflicts with other HTTP servers like nginx. To do this, set the
39 conflicts with other HTTP servers like nginx. To do this, set the
40 ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example
40 ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example
41 ``Listen 8090``.
41 ``Listen 8090``.
42
42
43
43
44 .. warning::
44 .. warning::
45
45
46 Make sure your Apache instance which runs the mod_dav_svn module is
46 Make sure your Apache instance which runs the mod_dav_svn module is
47 only accessible by |RCE|. Otherwise everyone is able to browse
47 only accessible by |RCE|. Otherwise everyone is able to browse
48 the repositories or run subversion operations (checkout/commit/etc.).
48 the repositories or run subversion operations (checkout/commit/etc.).
49
49
50 It is also recommended to run apache as the same user as |RCE|, otherwise
50 It is also recommended to run apache as the same user as |RCE|, otherwise
51 permission issues could occur. To do this edit the ``/etc/apache2/envvars``
51 permission issues could occur. To do this edit the ``/etc/apache2/envvars``
52
52
53 .. code-block:: apache
53 .. code-block:: apache
54
54
55 export APACHE_RUN_USER=rhodecode
55 export APACHE_RUN_USER=rhodecode
56 export APACHE_RUN_GROUP=rhodecode
56 export APACHE_RUN_GROUP=rhodecode
57
57
58 1. To configure Apache, create and edit a virtual hosts file, for example
58 1. To configure Apache, create and edit a virtual hosts file, for example
59 :file:`/etc/apache2/sites-enabled/default.conf`. Below is an example
59 :file:`/etc/apache2/sites-enabled/default.conf`. Below is an example
60 how to use one with auto-generated config ```mod_dav_svn.conf```
60 how to use one with auto-generated config ```mod_dav_svn.conf```
61 from configured |RCE| instance.
61 from configured |RCE| instance.
62
62
63 .. code-block:: apache
63 .. code-block:: apache
64
64
65 <VirtualHost *:8090>
65 <VirtualHost *:8090>
66 ServerAdmin rhodecode-admin@localhost
66 ServerAdmin rhodecode-admin@localhost
67 DocumentRoot /var/www/html
67 DocumentRoot /var/www/html
68 ErrorLog ${'${APACHE_LOG_DIR}'}/error.log
68 ErrorLog ${'${APACHE_LOG_DIR}'}/error.log
69 CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined
69 CustomLog ${'${APACHE_LOG_DIR}'}/access.log combined
70 Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf
70 Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf
71 </VirtualHost>
71 </VirtualHost>
72
72
73
73
74 2. Go to the :menuselection:`Admin --> Settings --> VCS` page, and
74 2. Go to the :menuselection:`Admin --> Settings --> VCS` page, and
75 enable :guilabel:`Proxy Subversion HTTP requests`, and specify the
75 enable :guilabel:`Proxy Subversion HTTP requests`, and specify the
76 :guilabel:`Subversion HTTP Server URL`.
76 :guilabel:`Subversion HTTP Server URL`.
77
77
78 3. Open the |RCE| configuration file,
78 3. Open the |RCE| configuration file,
79 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini`
79 :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini`
80
80
81 4. Add the following configuration option in the ``[app:main]``
81 4. Add the following configuration option in the ``[app:main]``
82 section if you don't have it yet.
82 section if you don't have it yet.
83
83
84 This enables mapping of the created |RCE| repo groups into special
84 This enables mapping of the created |RCE| repo groups into special
85 |svn| paths. Each time a new repository group is created, the system will
85 |svn| paths. Each time a new repository group is created, the system will
86 update the template file and create new mapping. Apache web server needs to
86 update the template file and create new mapping. Apache web server needs to
87 be reloaded to pick up the changes on this file.
87 be reloaded to pick up the changes on this file.
88 To do this, simply configure `svn.proxy.reload_cmd` inside the .ini file.
88 To do this, simply configure `svn.proxy.reload_cmd` inside the .ini file.
89 Example configuration:
89 Example configuration:
90
90
91
91
92 .. code-block:: ini
92 .. code-block:: ini
93
93
94 ############################################################
94 ############################################################
95 ### Subversion proxy support (mod_dav_svn) ###
95 ### Subversion proxy support (mod_dav_svn) ###
96 ### Maps RhodeCode repo groups into SVN paths for Apache ###
96 ### Maps RhodeCode repo groups into SVN paths for Apache ###
97 ############################################################
97 ############################################################
98 ## Enable or disable the config file generation.
98 ## Enable or disable the config file generation.
99 svn.proxy.generate_config = true
99 svn.proxy.generate_config = true
100 ## Generate config file with `SVNListParentPath` set to `On`.
100 ## Generate config file with `SVNListParentPath` set to `On`.
101 svn.proxy.list_parent_path = true
101 svn.proxy.list_parent_path = true
102 ## Set location and file name of generated config file.
102 ## Set location and file name of generated config file.
103 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
103 svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf
104 ## Used as a prefix to the <Location> block in the generated config file.
104 ## Used as a prefix to the <Location> block in the generated config file.
105 ## In most cases it should be set to `/`.
105 ## In most cases it should be set to `/`.
106 svn.proxy.location_root = /
106 svn.proxy.location_root = /
107 ## Command to reload the mod dav svn configuration on change.
107 ## Command to reload the mod dav svn configuration on change.
108 ## Example: `/etc/init.d/apache2 reload`
108 ## Example: `/etc/init.d/apache2 reload`
109 svn.proxy.reload_cmd = /etc/init.d/apache2 reload
109 svn.proxy.reload_cmd = /etc/init.d/apache2 reload
110 ## If the timeout expires before the reload command finishes, the command will
110 ## If the timeout expires before the reload command finishes, the command will
111 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
111 ## be killed. Setting it to zero means no timeout. Defaults to 10 seconds.
112 #svn.proxy.reload_timeout = 10
112 #svn.proxy.reload_timeout = 10
113
113
114
114
115 This would create a special template file called ```mod_dav_svn.conf```. We
115 This would create a special template file called ```mod_dav_svn.conf```. We
116 used that file path in the apache config above inside the Include statement.
116 used that file path in the apache config above inside the Include statement.
117 It's also possible to generate the config from the
117 It's also possible to manually generate the config from the
118 :menuselection:`Admin --> Settings --> VCS` page.
118 :menuselection:`Admin --> Settings --> VCS` page by clicking a
119 `Generate Apache Config` button.
120
121 5. Now only things left is to enable svn support, and generate the initial
122 configuration.
123
124 - Select `Proxy subversion HTTP requests` checkbox
125 - Enter http://localhost:8090 into `Subversion HTTP Server URL`
126 - Click the `Generate Apache Config` button.
127
128 This config will be automatically re-generated once an user-groups is added
129 to properly map the additional paths generated.
130
119
131
120
132
121 Using |svn|
133 Using |svn|
122 ===========
134 ===========
123
135
124 Once |svn| has been enabled on your instance, you can use it with the
136 Once |svn| has been enabled on your instance, you can use it with the
125 following examples. For more |svn| information, see the `Subversion Red Book`_
137 following examples. For more |svn| information, see the `Subversion Red Book`_
126
138
127 .. code-block:: bash
139 .. code-block:: bash
128
140
129 # To clone a repository
141 # To clone a repository
130 svn checkout http://my-svn-server.example.com/my-svn-repo
142 svn checkout http://my-svn-server.example.com/my-svn-repo
131
143
132 # svn commit
144 # svn commit
133 svn commit
145 svn commit
134
146
135
147
136 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
148 .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn
137
149
138 .. _Ask Ubuntu: http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue No newline at end of file
150 .. _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