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