Show More
@@ -1,128 +1,130 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| protocol, you have to |
|
6 | To use |svn| with read/write support over the |svn| protocol, you have to | |
7 | configure HTTP |svn| backend. |
|
7 | configure HTTP |svn| backend. | |
8 |
|
8 | |||
9 | Prerequisites |
|
9 | Prerequisites | |
10 | ^^^^^^^^^^^^^ |
|
10 | ^^^^^^^^^^^^^ | |
11 |
|
11 | |||
12 | - Enable HTTP support inside labs setting on your |RCE| instance, |
|
12 | - Enable HTTP support inside labs setting on your |RCE| instance, | |
13 | see :ref:`lab-settings`. |
|
13 | see :ref:`lab-settings`. | |
14 | - You need to install the following tools on the machine that is running an |
|
14 | - You need to install the following tools on the machine that is running an | |
15 | instance of |RCE|: |
|
15 | instance of |RCE|: | |
16 | ``Apache HTTP Server`` and |
|
16 | ``Apache HTTP Server`` and | |
17 | ``mod_dav_svn``. |
|
17 | ``mod_dav_svn``. | |
18 |
|
18 | |||
19 |
|
19 | |||
20 | Using Ubuntu Distribution as an example you can run: |
|
20 | Using Ubuntu Distribution as an example you can run: | |
21 |
|
21 | |||
22 | .. code-block:: bash |
|
22 | .. code-block:: bash | |
23 |
|
23 | |||
24 | $ sudo apt-get install apache2 libapache2-mod-svn |
|
24 | $ sudo apt-get install apache2 libapache2-mod-svn | |
25 |
|
25 | |||
26 | Once installed you need to enable ``dav_svn``: |
|
26 | Once installed you need to enable ``dav_svn`` and ``anon``: | |
27 |
|
27 | |||
28 | .. code-block:: bash |
|
28 | .. code-block:: bash | |
29 |
|
29 | |||
30 | $ sudo a2enmod dav_svn |
|
30 | $ sudo a2enmod dav_svn | |
|
31 | $ sudo a2enmod authn_anon | |||
|
32 | ||||
31 |
|
33 | |||
32 | Configuring Apache Setup |
|
34 | Configuring Apache Setup | |
33 | ^^^^^^^^^^^^^^^^^^^^^^^^ |
|
35 | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
34 |
|
36 | |||
35 | .. tip:: |
|
37 | .. tip:: | |
36 |
|
38 | |||
37 | It is recommended to run Apache on a port other than 80, due to possible |
|
39 | It is recommended to run Apache on a port other than 80, due to possible | |
38 | conflicts with other HTTP servers like nginx. To do this, set the |
|
40 | conflicts with other HTTP servers like nginx. To do this, set the | |
39 | ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example |
|
41 | ``Listen`` parameter in the ``/etc/apache2/ports.conf`` file, for example | |
40 | ``Listen 8090``. |
|
42 | ``Listen 8090``. | |
41 |
|
43 | |||
42 |
|
44 | |||
43 | .. warning:: |
|
45 | .. warning:: | |
44 |
|
46 | |||
45 | Make sure your Apache instance which runs the mod_dav_svn module is |
|
47 | Make sure your Apache instance which runs the mod_dav_svn module is | |
46 | only accessible by RhodeCode. Otherwise everyone is able to browse |
|
48 | only accessible by RhodeCode. Otherwise everyone is able to browse | |
47 | the repositories or run subversion operations (checkout/commit/etc.). |
|
49 | the repositories or run subversion operations (checkout/commit/etc.). | |
48 |
|
50 | |||
49 | It is also recommended to run apache as the same user as |RCE|, otherwise |
|
51 | It is also recommended to run apache as the same user as |RCE|, otherwise | |
50 | permission issues could occur. To do this edit the ``/etc/apache2/envvars`` |
|
52 | permission issues could occur. To do this edit the ``/etc/apache2/envvars`` | |
51 |
|
53 | |||
52 | .. code-block:: apache |
|
54 | .. code-block:: apache | |
53 |
|
55 | |||
54 | export APACHE_RUN_USER=rhodecode |
|
56 | export APACHE_RUN_USER=rhodecode | |
55 | export APACHE_RUN_GROUP=rhodecode |
|
57 | export APACHE_RUN_GROUP=rhodecode | |
56 |
|
58 | |||
57 | 1. To configure Apache, create and edit a virtual hosts file, for example |
|
59 | 1. To configure Apache, create and edit a virtual hosts file, for example | |
58 | :file:`/etc/apache2/sites-available/default.conf`. Below is an example |
|
60 | :file:`/etc/apache2/sites-available/default.conf`. Below is an example | |
59 | how to use one with auto-generated config ```mod_dav_svn.conf``` |
|
61 | how to use one with auto-generated config ```mod_dav_svn.conf``` | |
60 | from configured |RCE| instance. |
|
62 | from configured |RCE| instance. | |
61 |
|
63 | |||
62 | .. code-block:: apache |
|
64 | .. code-block:: apache | |
63 |
|
65 | |||
64 | <VirtualHost *:8080> |
|
66 | <VirtualHost *:8080> | |
65 | ServerAdmin rhodecode-admin@localhost |
|
67 | ServerAdmin rhodecode-admin@localhost | |
66 | DocumentRoot /var/www/html |
|
68 | DocumentRoot /var/www/html | |
67 |
ErrorLog |
|
69 | ErrorLog ${APACHE_LOG_DIR}/error.log | |
68 |
CustomLog |
|
70 | CustomLog ${APACHE_LOG_DIR}/access.log combined | |
69 | Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf |
|
71 | Include /home/user/.rccontrol/enterprise-1/mod_dav_svn.conf | |
70 | </VirtualHost> |
|
72 | </VirtualHost> | |
71 |
|
73 | |||
72 |
|
74 | |||
73 | 2. Go to the :menuselection:`Admin --> Settings --> Labs` page, and |
|
75 | 2. Go to the :menuselection:`Admin --> Settings --> Labs` page, and | |
74 | enable :guilabel:`Proxy Subversion HTTP requests`, and specify the |
|
76 | enable :guilabel:`Proxy Subversion HTTP requests`, and specify the | |
75 | :guilabel:`Subversion HTTP Server URL`. |
|
77 | :guilabel:`Subversion HTTP Server URL`. | |
76 |
|
78 | |||
77 | 3. Open the |RCE| configuration file, |
|
79 | 3. Open the |RCE| configuration file, | |
78 | :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` |
|
80 | :file:`/home/{user}/.rccontrol/{instance-id}/rhodecode.ini` | |
79 |
|
81 | |||
80 | 4. Add the following configuration option in the ``[app:main]`` |
|
82 | 4. Add the following configuration option in the ``[app:main]`` | |
81 | section if you don't have it yet. |
|
83 | section if you don't have it yet. | |
82 |
|
84 | |||
83 | This enable mapping of created |RCE| repo groups into special |svn| paths. |
|
85 | This enable mapping of created |RCE| repo groups into special |svn| paths. | |
84 | Each time a new repository group will be created the system will update |
|
86 | Each time a new repository group will be created the system will update | |
85 | the template file, and create new mapping. Apache web server needs to be |
|
87 | the template file, and create new mapping. Apache web server needs to be | |
86 | reloaded to pick up the changes on this file. |
|
88 | reloaded to pick up the changes on this file. | |
87 | It's recommended to add reload into a crontab so the changes can be picked |
|
89 | It's recommended to add reload into a crontab so the changes can be picked | |
88 | automatically once someone creates an repository group inside RhodeCode. |
|
90 | automatically once someone creates an repository group inside RhodeCode. | |
89 |
|
91 | |||
90 |
|
92 | |||
91 | .. code-block:: ini |
|
93 | .. code-block:: ini | |
92 |
|
94 | |||
93 | ############################################## |
|
95 | ############################################## | |
94 | ### Subversion proxy support (mod_dav_svn) ### |
|
96 | ### Subversion proxy support (mod_dav_svn) ### | |
95 | ############################################## |
|
97 | ############################################## | |
96 | ## Enable or disable the config file generation. |
|
98 | ## Enable or disable the config file generation. | |
97 | svn.proxy.generate_config = true |
|
99 | svn.proxy.generate_config = true | |
98 | ## Generate config file with `SVNListParentPath` set to `On`. |
|
100 | ## Generate config file with `SVNListParentPath` set to `On`. | |
99 | svn.proxy.list_parent_path = true |
|
101 | svn.proxy.list_parent_path = true | |
100 | ## Set location and file name of generated config file. |
|
102 | ## Set location and file name of generated config file. | |
101 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf |
|
103 | svn.proxy.config_file_path = %(here)s/mod_dav_svn.conf | |
102 | ## File system path to the directory containing the repositories served by |
|
104 | ## File system path to the directory containing the repositories served by | |
103 | ## RhodeCode. |
|
105 | ## RhodeCode. | |
104 | svn.proxy.parent_path_root = /path/to/repo_store |
|
106 | svn.proxy.parent_path_root = /path/to/repo_store | |
105 | ## Used as a prefix to the <Location> block in the generated config file. In |
|
107 | ## Used as a prefix to the <Location> block in the generated config file. In | |
106 | ## most cases it should be set to `/`. |
|
108 | ## most cases it should be set to `/`. | |
107 | svn.proxy.location_root = / |
|
109 | svn.proxy.location_root = / | |
108 |
|
110 | |||
109 |
|
111 | |||
110 | This would create a special template file called ```mod_dav_svn.conf```. We |
|
112 | This would create a special template file called ```mod_dav_svn.conf```. We | |
111 | used that file path in the apache config above inside the Include statement. |
|
113 | used that file path in the apache config above inside the Include statement. | |
112 |
|
114 | |||
113 |
|
115 | |||
114 | Using |svn| |
|
116 | Using |svn| | |
115 | ^^^^^^^^^^^ |
|
117 | ^^^^^^^^^^^ | |
116 |
|
118 | |||
117 | Once |svn| has been enabled on your instance, you can use it using the |
|
119 | Once |svn| has been enabled on your instance, you can use it using the | |
118 | following examples. For more |svn| information, see the `Subversion Red Book`_ |
|
120 | following examples. For more |svn| information, see the `Subversion Red Book`_ | |
119 |
|
121 | |||
120 | .. code-block:: bash |
|
122 | .. code-block:: bash | |
121 |
|
123 | |||
122 | # To clone a repository |
|
124 | # To clone a repository | |
123 | svn checkout http://my-svn-server.example.com/my-svn-repo |
|
125 | svn checkout http://my-svn-server.example.com/my-svn-repo | |
124 |
|
126 | |||
125 | # svn commit |
|
127 | # svn commit | |
126 | svn commit |
|
128 | svn commit | |
127 |
|
129 | |||
128 | .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn |
|
130 | .. _Subversion Red Book: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.svn |
General Comments 0
You need to be logged in to leave comments.
Login now