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